(unpublished results), were never well tested, are not widely used,
and we need to simplify pdb2gmx.
-``gmx mdrun -gcom``
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-This feature sometimes overrides the effects of various .mdp settings
-in a way that is difficult to understand and report. A user who wants
-to do communication between PP ranks less often should choose their
-``nst*`` mdp options accordingly.
-
Benchmarking options only available with ``gmx benchmark``
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Options such as ``-confout``, ``-resethway``, ``-resetstep`` are not
"""""""""
The gmx morph tool was removed since it yields non-physical structures
that can easily be done by a script.
+
+gmx mdrun -gcom
+"""""""""""""""
+
+This feature sometimes overrode the effects of various .mdp settings
+in a way that was difficult to understand and report. A user who wants
+to do communication between PP ranks less often should choose their
+``nst*`` mdp options accordingly.
performance. If available, using ``-bonded gpu`` is expected
to improve the ability of DLB to maximize performance.
-``-gcom``
- During the simulation :ref:`gmx mdrun` must communicate between all ranks to
- compute quantities such as kinetic energy. By default, this
- happens whenever plausible, and is influenced by a lot of
- :ref:`mdp options. <mdp-general>` The period between communication phases
- must be a multiple of :mdp:`nstlist`, and defaults to
- the minimum of :mdp:`nstcalcenergy` and :mdp:`nstlist`.
- ``mdrun -gcom`` sets the number of steps that must elapse between
- such communication phases, which can improve performance when
- running on a lot of ranks. Note that this means that _e.g._
- temperature coupling algorithms will
- effectively remain at constant energy until the next
- communication phase. :ref:`gmx mdrun` will always honor the
- setting of ``mdrun -gcom``, by changing :mdp:`nstcalcenergy`,
- :mdp:`nstenergy`, :mdp:`nstlog`, :mdp:`nsttcouple` and/or
- :mdp:`nstpcouple` if necessary.
+During the simulation :ref:`gmx mdrun` must communicate between all
+PP ranks to compute quantities such as kinetic energy for log file
+reporting, or perhaps temperature coupling. By default, this happens
+whenever necessary to honor several :ref:`mdp options <mdp-general>`,
+so that the period between communication phases is the least common
+denominator of :mdp:`nstlist`, :mdp:`nstcalcenergy`,
+:mdp:`nsttcouple`, and :mdp:`nstpcouple`.
Note that ``-tunepme`` has more effect when there is more than one
:term:`node`, because the cost of communication for the PP and PME
:ref:`gmx tune_pme` can help automate this search.
* For massively parallel runs (also ``gmx mdrun -multidir``), or with a slow
network, global communication can become a bottleneck and you can reduce it
- with ``gmx mdrun -gcom`` (note that this does affect the frequency of
- temperature and pressure coupling).
+ by choosing larger periods for algorithms such as temperature and
+ pressure coupling).
Checking and improving performance
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
list to do more non-bonded computation to keep energy drift constant).
* If ``Comm. energies`` takes a lot of time (a note will be printed in the log
- file), increase nstcalcenergy or use ``mdrun -gcom``.
+ file), increase nstcalcenergy.
* If all communication takes a lot of time, you might be running on too many
cores, or you could try running combined MPI/OpenMP parallelization with 2
or 4 OpenMP threads per MPI process.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
real PMELoadBal_max_cutoff;
ivec tric_dir; /**< tric_dir from \p gmx_ddbox_t is only stored here because dd_get_ns_ranges needs it */
- rvec box0; /**< box lower corner, required with dim's without pbc and -gcom */
- rvec box_size; /**< box size, required with dim's without pbc and -gcom */
+ rvec box0; /**< box lower corner, required with dim's without pbc when avoiding communication */
+ rvec box_size; /**< box size, required with dim's without pbc when avoiding communication */
rvec cell_x0; /**< The DD cell lower corner, in triclinic space */
rvec cell_x1; /**< The DD cell upper corner, in triclinic space */
clearDDStateIndices(dd, dd->ncg_home, comm->atomRanges.numHomeAtoms());
ncgindex_set = 0;
- /* Avoid global communication for dim's without pbc and -gcom */
+ /* To avoid global communication, we do not recompute the extent
+ * of the system for dims without pbc. Therefore we need to copy
+ * the previously computed values when we do not communicate.
+ */
if (!bNStGlobalComm)
{
copy_rvec(comm->box0, ddbox.box0 );
bBoxChanged = TRUE;
bRedist = TRUE;
}
- /* For dim's without pbc and -gcom */
+ /* Copy needed for dim's without pbc when avoiding communication */
copy_rvec(ddbox.box0, comm->box0 );
copy_rvec(ddbox.box_size, comm->box_size);
/* COMM STUFF */
if (ir->nstcomm == 0)
{
+ // TODO Change this behaviour. There should be exactly one way
+ // to turn off an algorithm.
ir->comm_mode = ecmNO;
}
if (ir->comm_mode != ecmNO)
{
if (ir->nstcomm < 0)
{
+ // TODO Such input was once valid. Now that we've been
+ // helpful for a few years, we should reject such input,
+ // lest we have to support every historical decision
+ // forever.
warning(wi, "If you want to remove the rotation around the center of mass, you should set comm_mode = Angular instead of setting nstcomm < 0. nstcomm is modified to its absolute value");
ir->nstcomm = abs(ir->nstcomm);
}
}
}
-/* check whether an 'nst'-style parameter p is a multiple of nst, and
- set it to be one if not, with a warning. */
-static void check_nst_param(const gmx::MDLogger &mdlog,
- const char *desc_nst, int nst,
- const char *desc_p, int *p)
-{
- if (*p > 0 && *p % nst != 0)
- {
- /* Round up to the next multiple of nst */
- *p = ((*p)/nst + 1)*nst;
- GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
- "NOTE: %s changes %s to %d", desc_nst, desc_p, *p);
- }
-}
-
void setCurrentLambdasRerun(int64_t step, const t_lambda *fepvals,
const t_trxframe *rerun_fr, const double *lam0,
t_state *globalState)
return nst;
}
-int check_nstglobalcomm(const gmx::MDLogger &mdlog, int nstglobalcomm, t_inputrec *ir, const t_commrec * cr)
+int computeGlobalCommunicationPeriod(const gmx::MDLogger &mdlog,
+ t_inputrec *ir,
+ const t_commrec *cr)
{
- if (!EI_DYNAMICS(ir->eI))
- {
- nstglobalcomm = 1;
- }
-
- if (nstglobalcomm == -1)
+ int nstglobalcomm;
{
// Set up the default behaviour
if (!(ir->nstcalcenergy > 0 ||
ir->epc != epcNO ? ir->nstpcouple : 0);
}
}
- else
- {
- // Check that the user's choice of mdrun -gcom will work
- if (ir->nstlist > 0 &&
- nstglobalcomm > ir->nstlist && nstglobalcomm % ir->nstlist != 0)
- {
- nstglobalcomm = (nstglobalcomm / ir->nstlist)*ir->nstlist;
- GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
- "WARNING: nstglobalcomm is larger than nstlist, but not a multiple, setting it to %d",
- nstglobalcomm);
- }
- if (ir->nstcalcenergy > 0)
- {
- check_nst_param(mdlog, "-gcom", nstglobalcomm,
- "nstcalcenergy", &ir->nstcalcenergy);
- }
- if (ir->etc != etcNO && ir->nsttcouple > 0)
- {
- check_nst_param(mdlog, "-gcom", nstglobalcomm,
- "nsttcouple", &ir->nsttcouple);
- }
- if (ir->epc != epcNO && ir->nstpcouple > 0)
- {
- check_nst_param(mdlog, "-gcom", nstglobalcomm,
- "nstpcouple", &ir->nstpcouple);
- }
-
- check_nst_param(mdlog, "-gcom", nstglobalcomm,
- "nstenergy", &ir->nstenergy);
-
- check_nst_param(mdlog, "-gcom", nstglobalcomm,
- "nstlog", &ir->nstlog);
- }
+ // TODO change this behaviour. Instead grompp should print
+ // a (performance) note and mdrun should not change ir.
if (ir->comm_mode != ecmNO && ir->nstcomm < nstglobalcomm)
{
GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
/*! \brief Return the number of steps that will take place between
* intra-simulation communications, given the constraints of the
- * inputrec and the value of mdrun -gcom. */
-int check_nstglobalcomm(const gmx::MDLogger &mdlog,
- int nstglobalcomm,
- t_inputrec *ir,
- const t_commrec * cr);
+ * inputrec. */
+int computeGlobalCommunicationPeriod(const gmx::MDLogger &mdlog,
+ t_inputrec *ir,
+ const t_commrec *cr);
/*! \brief Return true if the \p value is equal across the set of multi-simulations
*
ImdOptions &imdOptions = mdrunOptions.imdOptions;
- t_pargs pa[48] = {
+ t_pargs pa[47] = {
{ "-dd", FALSE, etRVEC, {&realddxyz},
"Domain decomposition grid, 0 is optimize" },
"HIDDENA string containing a vector of the relative sizes in the z "
"direction of the corresponding DD cells. Only effective with static "
"load balancing." },
- { "-gcom", FALSE, etINT, {&mdrunOptions.globalCommunicationInterval},
- "Global communication frequency" },
{ "-nb", FALSE, etENUM, {nbpu_opt_choices},
"Calculate non-bonded interactions on" },
{ "-nstlist", FALSE, etINT, {&nstlist_cmdline},
bTrotter = (EI_VV(ir->eI) && (inputrecNptTrotter(ir) || inputrecNphTrotter(ir) || inputrecNvtTrotter(ir)));
const bool bRerunMD = false;
- int nstglobalcomm = mdrunOptions.globalCommunicationInterval;
- nstglobalcomm = check_nstglobalcomm(mdlog, nstglobalcomm, ir, cr);
+ int nstglobalcomm = computeGlobalCommunicationPeriod(mdlog, ir, cr);
bGStatEveryStep = (nstglobalcomm == 1);
SimulationGroups *groups = &top_global->groups;
gmx_bool rerun = FALSE;
//! Re-construct virual sites durin a rerun simulation
gmx_bool rerunConstructVsites = FALSE;
- //! Request to do global communication at this interval in steps, -1 is determine from inputrec (deprecated).
- int globalCommunicationInterval = -1;
//! Try to make the simulation binary reproducible
gmx_bool reproducible = FALSE;
//! Write confout.gro at the end of the run
{
GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
"NOTE: %d %% of the run time was spent communicating energies,\n"
- " you might want to use the -gcom option of mdrun\n",
+ " you might want to increase some nst* mdp options\n",
gmx::roundToInt(100*cyc_sum[ewcMoveE]/tot));
}
}