Divide default communicator from DD communicators
authorPascal Merz <pascal.merz@me.com>
Thu, 9 Jul 2020 12:08:59 +0000 (12:08 +0000)
committerChristian Blau <cblau.mail@gmail.com>
Thu, 9 Jul 2020 12:08:59 +0000 (12:08 +0000)
commit5734027bc8e73b683cfc4c9d697b1c6ca8d6cb37
tree5d975c3b512fc415f25e736a6d260945979c04d7
parent5fe72d9e84a9be123e883bd6fb2ffad4a3b189d0
Divide default communicator from DD communicators

The communicators mpi_comm_mysim and mpi_comm_mygroup inside
t_commrec got initialized in init_commrec (to MPI_COMM_WORLD
if no multisim, to a subset otherwise). These communicators
were then used in subsequent setup work, before they got
reassigned during the construction of the DDBuilder object
and the construction of the actual domain decomposition object.
Effectively, this means that the same communicators (and, hence,
identical function calls) do very different things depending on
whether they get used before or after the setup of domain
decomposition. It also means that before DD set up, mpi_comm_mysim
and mpi_comm_mygroup are *identical*.

This change introduces an additional communicator within
t_commrec, mpiDefaulCommunicator, which helps to make these
implicit assumptions explicit. Consequently, this also redefines
PAR(cr), MASTER(cr), and SIMMASTER(cr).

This change will allow to move the sim and group communicators,
which are now only created at DD time, into the DD object,
logically separating the DD object from t_commrec.

Refs #2395
12 files changed:
src/gromacs/domdec/box.cpp
src/gromacs/domdec/box.h
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec_setup.cpp
src/gromacs/domdec/domdec_setup.h
src/gromacs/fileio/checkpoint.cpp
src/gromacs/gmxlib/network.cpp
src/gromacs/mdlib/simulationsignal.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/mdrunutility/tests/threadaffinitytest.cpp
src/gromacs/mdtypes/commrec.h
src/gromacs/nbnxm/pairlist_tuning.cpp