#include "gromacs/commandline/pargs.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/mdlib/stophandler.h"
-#include "gromacs/mdrun/logging.h"
-#include "gromacs/mdrun/multisim.h"
+#include "gromacs/mdrunutility/logging.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdrun/runner.h"
#include "gromacs/mdrunutility/handlerestart.h"
#include "gromacs/mdtypes/commrec.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 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.
* \ingroup gmxapi
*/
-#include "gromacs/mdrun/logging.h"
+#include "gromacs/mdrunutility/logging.h"
#include "gmxapi/context.h"
#include "gmxapi/session.h"
#include <memory>
#include "gromacs/gmxlib/network.h"
#include "gromacs/mdlib/sighandler.h"
-#include "gromacs/mdrun/logging.h"
-#include "gromacs/mdrun/multisim.h"
+#include "gromacs/mdrunutility/logging.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/restraint/restraintpotential.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/basenetwork.h"
#include <map>
-#include "gromacs/mdrun/logging.h"
+#include "gromacs/mdrunutility/logging.h"
#include "gromacs/mdrun/runner.h"
#include "gromacs/mdrun/simulationcontext.h"
#include "gromacs/fileio/enxio.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/math/units.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/awh_history.h"
#include "gromacs/mdtypes/awh_params.h"
#include "gromacs/mdtypes/commrec.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
#include "gromacs/hardware/hardwaretopology.h"
#include "gromacs/hardware/hw_info.h"
#include "gromacs/hardware/identifyavx512fmaunits.h"
-#include "gromacs/mdtypes/commrec.h"
#include "gromacs/simd/support.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/basenetwork.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/logger.h"
#include "gromacs/utility/programcontext.h"
#include "gromacs/utility/stringutil.h"
return s;
}
-void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
- const gmx_multisim_t *ms,
+void gmx_print_detected_hardware(FILE *fplog,
+ const bool warnToStdErr,
const gmx::MDLogger &mdlog,
const gmx_hw_info_t *hwinfo)
{
*/
if (cpuInfo.supportLevel() >= gmx::CpuInfo::SupportLevel::Features)
{
- gmx::simdCheck(static_cast<gmx::SimdType>(hwinfo->simd_suggest_min), fplog, isMasterSimMasterRank(ms, cr));
+ gmx::simdCheck(static_cast<gmx::SimdType>(hwinfo->simd_suggest_min), fplog, warnToStdErr);
}
/* For RDTSCP we only check on our local node and skip the MPI reduction */
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
#include <cstdio>
struct gmx_hw_info_t;
-struct gmx_multisim_t;
-struct t_commrec;
namespace gmx
{
/* Print information about the detected hardware to fplog (if != NULL)
* and to stderr the master rank.
*/
-void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
- const gmx_multisim_t *ms,
+void gmx_print_detected_hardware(FILE *fplog,
+ bool warnToStdErr,
const gmx::MDLogger &mdlog,
const gmx_hw_info_t *hwinfo);
#include "gromacs/mdlib/groupcoord.h"
#include "gromacs/mdlib/sighandler.h"
#include "gromacs/mdlib/stat.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/enerdata.h"
#include "gromacs/mdtypes/imdmodule.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/math/do_fit.h"
#include "gromacs/math/functions.h"
#include "gromacs/math/vec.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/fcdata.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/math/vec.h"
#include "gromacs/mdlib/constr.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
#include <algorithm>
#include "gromacs/gmxlib/network.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/gmxassert.h"
gmx_add_libgromacs_sources(
integrator.cpp
legacymdrunoptions.cpp
- logging.cpp
shellfc.cpp
md.cpp
mdmodules.cpp
minimize.cpp
- multisim.cpp
replicaexchange.cpp
rerun.cpp
mimic.cpp
#include "gromacs/gmxlib/network.h"
#include "gromacs/math/functions.h"
-#include "gromacs/mdrun/multisim.h"
#include "gromacs/mdrunutility/handlerestart.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/domdec/options.h"
#include "gromacs/hardware/hw_info.h"
-#include "gromacs/mdrun/logging.h"
+#include "gromacs/mdrunutility/logging.h"
#include "gromacs/mdtypes/mdrunoptions.h"
#include "replicaexchange.h"
#include "gromacs/mdlib/update.h"
#include "gromacs/mdlib/vcm.h"
#include "gromacs/mdlib/vsite.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdrunutility/printtime.h"
#include "gromacs/mdtypes/awh_history.h"
#include "gromacs/mdtypes/awh_params.h"
state->fep_state = lamnew;
}
/* Print the remaining wall clock time for the run */
- if (isMasterSimMasterRank(ms, cr) &&
+ if (isMasterSimMasterRank(ms, MASTER(cr)) &&
(do_verbose || gmx_got_usr_signal()) &&
!bPMETunePrinting)
{
#include "gromacs/mdlib/update.h"
#include "gromacs/mdlib/vcm.h"
#include "gromacs/mdlib/vsite.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdrunutility/printtime.h"
#include "gromacs/mdtypes/awh_history.h"
#include "gromacs/mdtypes/awh_params.h"
}
/* Print the remaining wall clock time for the run */
- if (isMasterSimMasterRank(ms, cr) &&
+ if (isMasterSimMasterRank(ms, MASTER(cr)) &&
(mdrunOptions.verbose || gmx_got_usr_signal()))
{
if (shellfc)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
#include "gromacs/gmxlib/network.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
-#include "gromacs/mdrun/multisim.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/enerdata.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdlib/update.h"
#include "gromacs/mdlib/vcm.h"
#include "gromacs/mdlib/vsite.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdrunutility/printtime.h"
#include "gromacs/mdtypes/awh_history.h"
#include "gromacs/mdtypes/awh_params.h"
}
/* Print the remaining wall clock time for the run */
- if (isMasterSimMasterRank(ms, cr) &&
+ if (isMasterSimMasterRank(ms, MASTER(cr)) &&
(mdrunOptions.verbose || gmx_got_usr_signal()))
{
if (shellfc)
#include "gromacs/mdlib/qmmm.h"
#include "gromacs/mdlib/sighandler.h"
#include "gromacs/mdlib/stophandler.h"
-#include "gromacs/mdrun/logging.h"
#include "gromacs/mdrun/mdmodules.h"
-#include "gromacs/mdrun/multisim.h"
#include "gromacs/mdrun/simulationcontext.h"
+#include "gromacs/mdrunutility/logging.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdrunutility/printtime.h"
#include "gromacs/mdrunutility/threadaffinity.h"
#include "gromacs/mdtypes/commrec.h"
PhysicalNodeCommunicator physicalNodeComm(MPI_COMM_WORLD, gmx_physicalnode_id_hash());
hwinfo = gmx_detect_hardware(mdlog, physicalNodeComm);
- gmx_print_detected_hardware(fplog, cr, ms, mdlog, hwinfo);
+ gmx_print_detected_hardware(fplog, isMasterSimMasterRank(ms, MASTER(cr)), mdlog, hwinfo);
std::vector<int> gpuIdsToUse;
auto compatibleGpus = getCompatibleGpus(hwinfo->gpu_info);
gmx_add_libgromacs_sources(
handlerestart.cpp
+ logging.cpp
+ multisim.cpp
printtime.cpp
threadaffinity.cpp
)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 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.
#include "gromacs/fileio/checkpoint.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/gmxlib/network.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/fatalerror.h"
&sim_part_fn, cr,
bTryToAppendFiles, NFILE, fnm,
part_suffix, &bAddPart, bDoAppendFiles);
- if (sim_part_fn == 0 && isMasterSimMasterRank(ms, cr))
+ if (sim_part_fn == 0 && isMasterSimMasterRank(ms, MASTER(cr)))
{
fprintf(stdout, "No previous checkpoint file present with -cpi option, assuming this is a new run.\n");
}
if (isMultiSim(ms) && MASTER(cr))
{
// Only the master simulation should report on problems.
- if (isMasterSimMasterRank(ms, cr))
+ if (isMasterSimMasterRank(ms, MASTER(cr)))
{
/* Log file is not yet available, so if there's a
* problem we can only write to stderr. */
sprintf(suffix, "%s%04d", part_suffix, sim_part_fn);
add_suffix_to_output_names(fnm, NFILE, suffix);
- if (isMasterSimMasterRank(ms, cr))
+ if (isMasterSimMasterRank(ms, MASTER(cr)))
{
fprintf(stdout, "Checkpoint file is from part %d, new output files will be suffixed '%s'.\n", sim_part-1, suffix);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 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.
* \brief Implements the MD log file handling routines.
*
* \author Mark Abraham <mark.j.abraham@gmail.com>
- * \ingroup module_mdrun
+ * \ingroup module_mdrunutility
*/
#include "gmxpre.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 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.
*
* \author Mark Abraham <mark.j.abraham@gmail.com>
* \inlibraryapi
- * \ingroup module_mdrun
+ * \ingroup module_mdrunutility
*/
-#ifndef GMX_MDRUN_LOGGING_H
-#define GMX_MDRUN_LOGGING_H
+#ifndef GMX_MDRUNUTILITY_LOGGING_H
+#define GMX_MDRUNUTILITY_LOGGING_H
#include <memory>
* \brief Implements the multi-simulation support routines.
*
* \author Mark Abraham <mark.j.abraham@gmail.com>
- * \ingroup module_mdrun
+ * \ingroup module_mdrunutility
*/
#include "gmxpre.h"
delete ms;
}
}
+
+bool isMasterSim(const gmx_multisim_t *ms)
+{
+ return !isMultiSim(ms) || ms->sim == 0;
+}
+
+bool isMasterSimMasterRank(const gmx_multisim_t *ms,
+ const bool isMaster)
+{
+ return (isMaster && isMasterSim(ms));
+}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 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.
*
* \author Mark Abraham <mark.j.abraham@gmail.com>
* \inlibraryapi
- * \ingroup module_mdrun
+ * \ingroup module_mdrunutility
*/
-#ifndef GMX_MDRUN_MULTISIM_H
-#define GMX_MDRUN_MULTISIM_H
+#ifndef GMX_MDRUNUTILITY_MULTISIM_H
+#define GMX_MDRUNUTILITY_MULTISIM_H
#include <string>
//! Cleans up multi-system handler.
void done_multisim(gmx_multisim_t *ms);
+//! Are we doing multiple independent simulations?
+static bool inline isMultiSim(const gmx_multisim_t *ms)
+{
+ return ms != nullptr;
+}
+
+//! Are we the master simulation of a possible multi-simulation?
+bool isMasterSim(const gmx_multisim_t *ms);
+
+/*! \brief Are we the master rank (of the master simulation, for a multi-sim).
+ *
+ * This rank prints the remaining run time etc. */
+bool isMasterSimMasterRank(const gmx_multisim_t *ms,
+ bool isMaster);
+
#endif
cr->nnodes - cr->npmenodes > 1);
}
-//! Are we doing multiple independent simulations?
-static bool inline isMultiSim(const gmx_multisim_t *ms)
-{
- return ms != nullptr;
-}
-
-//! Are we the master simulation of a possible multi-simulation?
-static bool inline isMasterSim(const gmx_multisim_t *ms)
-{
- return !isMultiSim(ms) || ms->sim == 0;
-}
-
-/*! \brief Are we the master rank (of the master simulation, for a multi-sim).
- *
- * This rank prints the remaining run time etc. */
-static bool inline isMasterSimMasterRank(const gmx_multisim_t *ms,
- const t_commrec *cr)
-{
- return (SIMMASTER(cr) && isMasterSim(ms));
-}
-
#endif
#include "gromacs/hardware/hw_info.h"
#include "gromacs/math/functions.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
#include <vector>
#include "gromacs/hardware/hw_info.h"
+#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/taskassignment/usergpuids.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/mdrun/legacymdrunoptions.h"
-#include "gromacs/mdrun/logging.h"
#include "gromacs/mdrun/runner.h"
#include "gromacs/mdrun/simulationcontext.h"
+#include "gromacs/mdrunutility/logging.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/smalloc.h"