This replaces do_md overwriting ir->nstcomm by a warning at grompp
time. Until now, nstcomm was set to the computed global communication
frequency if nstcomm was smaller. The user is now informed at grompp
time that their choice is not optimal, but the set value is respected.
The criterion for the warning now also encompasses any value for
nstcomm that is not a multiple of the global communication frequency.
Resolves a TODO, and refs #3854.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, 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.
* 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.
#include "gromacs/mdlib/calc_verletbuf.h"
#include "gromacs/mdlib/compute_io.h"
#include "gromacs/mdlib/constr.h"
#include "gromacs/mdlib/calc_verletbuf.h"
#include "gromacs/mdlib/compute_io.h"
#include "gromacs/mdlib/constr.h"
+#include "gromacs/mdlib/md_support.h"
#include "gromacs/mdlib/perf_est.h"
#include "gromacs/mdlib/vsite.h"
#include "gromacs/mdrun/mdmodules.h"
#include "gromacs/mdlib/perf_est.h"
#include "gromacs/mdlib/vsite.h"
#include "gromacs/mdrun/mdmodules.h"
std::make_unique<gmx::KeyValueTreeObject>(internalParameterBuilder.build());
}
std::make_unique<gmx::KeyValueTreeObject>(internalParameterBuilder.build());
}
+ if (ir->comm_mode != ecmNO)
+ {
+ const int nstglobalcomm = computeGlobalCommunicationPeriod(ir);
+ if (ir->nstcomm % nstglobalcomm != 0)
+ {
+ warning_note(
+ wi,
+ gmx::formatString(
+ "COM removal frequency is set to (%d).\n"
+ "Other settings require a global communication frequency of %d.\n"
+ "Note that this will require additional global communication steps,\n"
+ "which will reduce performance when using multiple ranks.\n"
+ "Consider setting nstcomm to a multiple of %d.",
+ ir->nstcomm,
+ nstglobalcomm,
+ nstglobalcomm));
+ }
+ }
+
if (bVerbose)
{
GMX_LOG(logger.info).asParagraph().appendTextFormatted("writing run input file...");
if (bVerbose)
{
GMX_LOG(logger.info).asParagraph().appendTextFormatted("writing run input file...");
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 The GROMACS development team.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 The GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, 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.
* 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.
-int computeGlobalCommunicationPeriod(const gmx::MDLogger& mdlog, t_inputrec* ir, const t_commrec* cr)
+int computeGlobalCommunicationPeriod(const t_inputrec* ir)
+ int nstglobalcomm = 10;
{
// Set up the default behaviour
if (!(ir->nstcalcenergy > 0 || ir->nstlist > 0 || ir->etc != etcNO || ir->epc != epcNO))
{
// Set up the default behaviour
if (!(ir->nstcalcenergy > 0 || ir->nstlist > 0 || ir->etc != etcNO || ir->epc != epcNO))
/* The user didn't choose the period for anything
important, so we just make sure we can send signals and
write output suitably. */
/* The user didn't choose the period for anything
important, so we just make sure we can send signals and
write output suitably. */
if (ir->nstenergy > 0 && ir->nstenergy < nstglobalcomm)
{
nstglobalcomm = ir->nstenergy;
if (ir->nstenergy > 0 && ir->nstenergy < nstglobalcomm)
{
nstglobalcomm = ir->nstenergy;
ir->epc != epcNO ? ir->nstpcouple : 0);
}
}
ir->epc != epcNO ? ir->nstpcouple : 0);
}
}
+ return nstglobalcomm;
+}
- // 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("WARNING: Changing nstcomm from %d to %d", ir->nstcomm, nstglobalcomm);
- ir->nstcomm = nstglobalcomm;
- }
+int computeGlobalCommunicationPeriod(const gmx::MDLogger& mdlog, const t_inputrec* ir, const t_commrec* cr)
+{
+ const int nstglobalcomm = computeGlobalCommunicationPeriod(ir);
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 The GROMACS development team.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017 The GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, 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.
* 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.
* will be computed, to check none are missing. */
#define CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS (1u << 12u)
* will be computed, to check none are missing. */
#define CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS (1u << 12u)
/*! \brief Return the number of steps that will take place between
* intra-simulation communications, given the constraints of the
* inputrec. */
/*! \brief Return the number of steps that will take place between
* intra-simulation communications, given the constraints of the
* inputrec. */
-int computeGlobalCommunicationPeriod(const gmx::MDLogger& mdlog, t_inputrec* ir, const t_commrec* cr);
+int computeGlobalCommunicationPeriod(const t_inputrec* ir);
+
+/*! \brief Return the number of steps that will take place between
+ * intra-simulation communications, given the constraints of the
+ * inputrec, and write information to log.
+ * Calls computeGlobalCommunicationPeriod(ir) internally. */
+int computeGlobalCommunicationPeriod(const gmx::MDLogger& mdlog, const t_inputrec* ir, const t_commrec* cr);
void rerun_parallel_comm(t_commrec* cr, t_trxframe* fr, gmx_bool* bLastStep);
void rerun_parallel_comm(t_commrec* cr, t_trxframe* fr, gmx_bool* bLastStep);