From: Berk Hess Date: Sun, 13 Sep 2020 09:30:20 +0000 (+0000) Subject: Decouple nsttcouple and nstpcouple from nstlist X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=b7195d75e34c3bd9ec9bef66845a81192da483e5;p=alexxy%2Fgromacs.git Decouple nsttcouple and nstpcouple from nstlist The default values of nsttcouple and nstpcouple of -1 would cause nstlist to be used as the coupling interval. But coupling intervals should not be linked to nstlist. The default is now set to 10, which will not change settings for mdp files where nstlist was not specified as the default nstlist value is also 10. --- diff --git a/docs/release-notes/2021/major/miscellaneous.rst b/docs/release-notes/2021/major/miscellaneous.rst index 712b93da87..68c87e9f81 100644 --- a/docs/release-notes/2021/major/miscellaneous.rst +++ b/docs/release-notes/2021/major/miscellaneous.rst @@ -7,6 +7,12 @@ Miscellaneous Also, please use the syntax :issue:`number` to reference issues on GitLab, without the a space between the colon and number! +Default values for temperature and pressure coupling intervals are now 10 +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +With the default mdp input value of -1 for nsttcouple and nstpcouple, grompp would +set these values to nstlist. Now these are set to 10 and thus independent of nstlist +(note that grompp may choose smaller values when needed for accurate integration). + Uniform and manual CMake GPU-support configuration """""""""""""""""""""""""""""""""""""""""""""""""" The GPU accelerations setup has been changed to be uniform for CUDA and OpenCL. Either diff --git a/docs/user-guide/mdp-options.rst b/docs/user-guide/mdp-options.rst index cd78e3151e..2ea402530c 100644 --- a/docs/user-guide/mdp-options.rst +++ b/docs/user-guide/mdp-options.rst @@ -976,8 +976,10 @@ Temperature coupling (-1) The frequency for coupling the temperature. The default value of -1 - sets :mdp:`nsttcouple` equal to :mdp:`nstlist`, unless - :mdp:`nstlist` <=0, then a value of 10 is used. For velocity + sets :mdp:`nsttcouple` equal to 10, or fewer steps if required + for accurate integration. Note that the default value is not 1 + because additional computation and communication is required for + obtaining the kinetic energy. For velocity Verlet integrators :mdp:`nsttcouple` is set to 1. .. mdp:: nh-chain-length @@ -1110,8 +1112,10 @@ Pressure coupling (-1) The frequency for coupling the pressure. The default value of -1 - sets :mdp:`nstpcouple` equal to :mdp:`nstlist`, unless - :mdp:`nstlist` <=0, then a value of 10 is used. For velocity + sets :mdp:`nstpcouple` equal to 10, or fewer steps if required + for accurate integration. Note that the default value is not 1 + because additional computation and communication is required for + obtaining the virial. For velocity Verlet integrators :mdp:`nstpcouple` is set to 1. .. mdp:: tau-p diff --git a/src/gromacs/mdtypes/inputrec.cpp b/src/gromacs/mdtypes/inputrec.cpp index d712869dde..89dc64b4ca 100644 --- a/src/gromacs/mdtypes/inputrec.cpp +++ b/src/gromacs/mdtypes/inputrec.cpp @@ -65,6 +65,9 @@ //! Macro to select a bool name #define EBOOL(e) gmx::boolToString(e) +/* Default values for nstcalcenergy, used when the are no other restrictions. */ +constexpr int c_defaultNstCalcEnergy = 10; + /* The minimum number of integration steps required for reasonably accurate * integration of first and second order coupling algorithms. */ @@ -72,6 +75,12 @@ const int nstmin_berendsen_tcouple = 5; const int nstmin_berendsen_pcouple = 10; const int nstmin_harmonic = 20; +/* Default values for nst T- and P- coupling intervals, used when the are no other + * restrictions. + */ +constexpr int c_defaultNstTCouple = 10; +constexpr int c_defaultNstPCouple = 10; + t_inputrec::t_inputrec() { // TODO When this memset is removed, remove the suppression of @@ -87,21 +96,20 @@ t_inputrec::~t_inputrec() done_inputrec(this); } -static int nst_wanted(const t_inputrec* ir) +int ir_optimal_nstcalcenergy(const t_inputrec* ir) { + int nst; + if (ir->nstlist > 0) { - return ir->nstlist; + nst = ir->nstlist; } else { - return 10; + nst = c_defaultNstCalcEnergy; } -} -int ir_optimal_nstcalcenergy(const t_inputrec* ir) -{ - return nst_wanted(ir); + return nst; } int tcouple_min_integration_steps(int etc) @@ -134,7 +142,7 @@ int ir_optimal_nsttcouple(const t_inputrec* ir) nmin = tcouple_min_integration_steps(ir->etc); - nwanted = nst_wanted(ir); + nwanted = c_defaultNstTCouple; tau_min = 1e20; if (ir->etc != etcNO) @@ -191,7 +199,7 @@ int ir_optimal_nstpcouple(const t_inputrec* ir) nmin = pcouple_min_integration_steps(ir->epc); - nwanted = nst_wanted(ir); + nwanted = c_defaultNstPCouple; if (nmin == 0 || ir->delta_t * nwanted <= ir->tau_p) {