Removed dependency on commrec of mdrun setup
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 21 May 2019 14:45:17 +0000 (16:45 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 1 Oct 2019 05:24:02 +0000 (07:24 +0200)
commite39949c724b1eab099e81212951e05b082d67243
tree1b211165ae0f08191487445696b8c54161bf67f0
parent671412d57c162426b7fe2c860d87fbc697fc4af8
Removed dependency on commrec of mdrun setup

Changes no functionality.

Setup is now parameterized directly on MPI_COMM_WORLD, which we will
want later for letting library-based callers pass in an
MPI_Communicator. This permits commrec to be initialized later, once
the threads have been spawned for the thread-MPI ranks.

The initialization of multi-simulations moves from LegacyMdrunOptions
to SimulationContext, which is more appropriate for
ensemble-parallelism established directly by the user.

Before the decision about the duty of a rank, there is no difference
between MASTER(cr) and SIMMASTER(cr), so several calls to macros
taking a t_commrec pointer are replaced by booleans. Introduced
findIsSimulationMasterRank to compute that value. This eliminates
early use of t_commrec that has necessitated other hacks and
workarounds.

Removed redundant check for replica exchange when the number of multi
simulations is less than two, because gmx_multisim_t constructor
already prohibits that.

Resolves several TODO items and improves modularity, too.

Refs #2587, #2605, #3081

Change-Id: I48bd3b713bc181b5c1e4cbcd648706a9f00eab96
20 files changed:
src/api/cpp/context.cpp
src/api/cpp/createsession.h
src/api/cpp/session.cpp
src/api/cpp/session_impl.h
src/gromacs/applied_forces/tests/electricfield.cpp
src/gromacs/gmxlib/network.cpp
src/gromacs/gmxlib/network.h
src/gromacs/hardware/printhardware.h
src/gromacs/mdrun/legacymdrunoptions.cpp
src/gromacs/mdrun/legacymdrunoptions.h
src/gromacs/mdrun/runner.cpp
src/gromacs/mdrun/runner.h
src/gromacs/mdrun/simulationcontext.cpp
src/gromacs/mdrun/simulationcontext.h
src/gromacs/mdrunutility/handlerestart.cpp
src/gromacs/mdrunutility/handlerestart.h
src/gromacs/mdrunutility/multisim.cpp
src/gromacs/mdrunutility/multisim.h
src/gromacs/tools/pme_error.cpp
src/programs/mdrun/mdrun.cpp