Gromacs
2021-beta2-UNCHECKED
|
#include <gromacs/mdrunutility/multisim.h>
Coordinate multi-simulation resources for mdrun.
Public Member Functions | |
gmx_multisim_t (int numSimulations, int simulationIndex, MPI_Comm mastersComm, MPI_Comm simulationComm) | |
Constructor. More... | |
~gmx_multisim_t () | |
Destructor. | |
Public Attributes | |
int | numSimulations_ = 1 |
The number of simulations in the set of multi-simulations. | |
int | simulationIndex_ = 0 |
The index of the simulation that owns this object within the set. | |
MPI_Comm | mastersComm_ = MPI_COMM_NULL |
The MPI communicator between master ranks of simulations, valid only on master ranks. | |
MPI_Comm | simulationComm_ = MPI_COMM_NULL |
The MPI communicator between ranks of this simulation. | |
std::vector< int > | intBuffer_ |
Communication buffers needed if MPI_IN_PLACE isn't supported. More... | |
std::vector< int64_t > | int64Buffer_ |
gmx_multisim_t::gmx_multisim_t | ( | int | numSimulations, |
int | simulationIndex, | ||
MPI_Comm | mastersComm, | ||
MPI_Comm | simulationComm | ||
) |
Constructor.
[in] | numSimulations | The number of simulations in the MPI world. |
[in] | simulationIndex | The index of this simulation in the set of simulations. |
[in] | mastersComm | On master ranks, the communicator among master ranks; otherwise MPI_COMM_NULL. |
[in] | simulationComm | The communicator among ranks of this simulation. |
Assumes ownership of the communicators if they are neither MPI_COMM_WORLD nor MPI_COMM_NULL. If so, upon destruction will call MPI_Comm_free on them.
std::vector<int> gmx_multisim_t::intBuffer_ |
Communication buffers needed if MPI_IN_PLACE isn't supported.
Other types could be added as needed.
These vectors are unused when MPI_IN_PLACE is available and could be removed with preprocessing (or perhaps templating) or simply requiring MPI 2.0 (the standard introduced in 1997). However, the additional cache pressure introduced by the extra size of this type is not of great concern, since we have at most one per MPI rank. See issue #3591.