ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
|
#include <source/mpi_ensemble.h>
Public Member Functions | |
MPIEnsemble (const MPI_Comm &mpi_communicator) | |
~MPIEnsemble () | |
void | prepare (const int n_ensembles=1, const bool global_synchronization=true) |
const auto & | world_communicator () const |
auto & | global_synchronization () const |
auto & | world_rank () const |
auto & | n_world_ranks () const |
auto & | ensemble () const |
auto & | n_ensembles () const |
auto & | ensemble_rank () const |
auto & | n_ensemble_ranks () const |
const auto & | ensemble_communicator () const |
DEAL_II_ALWAYS_INLINE const MPI_Comm & | synchronization_communicator () const |
const auto & | ensemble_leader_communicator () const |
const auto & | peer_communicator () const |
A class responsible for subdividing a given global MPI communicator into a set of "ensembles" with a coresponding ensemble communicator. This allows us to run similar, related hyperbolic systems in parallel on subranges of the set of (global) MPI processes.
After prepare()
is called, all getter functions return valid references.
Definition at line 28 of file mpi_ensemble.h.
ryujin::MPIEnsemble::MPIEnsemble | ( | const MPI_Comm & | mpi_communicator | ) |
ryujin::MPIEnsemble::~MPIEnsemble | ( | ) |
void ryujin::MPIEnsemble::prepare | ( | const int | n_ensembles = 1 , |
const bool | global_synchronization = true |
||
) |
Prepare the MPI ensemble and split the gobal MPI communicator into n_ensembles
different subranges of comparable size. The boolean global_synchronization
indicates whether (global) world synchronization of time step size and other synchronization state is performend in the HyperbolicModule and ParabolicModule, or whether such synchronization remains local to the ensemble.
|
inline |
Return the world communicator.
Definition at line 52 of file mpi_ensemble.h.
|
inline |
If true, then ensembles run in lockstep with a synchronized tau_max.
Definition at line 57 of file mpi_ensemble.h.
|
inline |
The (global) world rank of the current MPI process.
Definition at line 62 of file mpi_ensemble.h.
|
inline |
The total number of (global) MPI processes.
Definition at line 67 of file mpi_ensemble.h.
|
inline |
Return the ensemble in the interval [0, n_ensembles) that the given MPI process belongs to.
Definition at line 73 of file mpi_ensemble.h.
|
inline |
Return the total number of ensembles.
Definition at line 78 of file mpi_ensemble.h.
|
inline |
The (local) ensemble rank of the current MPI process.
Definition at line 83 of file mpi_ensemble.h.
|
inline |
The total number of (local) MPI processes belonging to the ensemble.
Definition at line 88 of file mpi_ensemble.h.
|
inline |
The corresponding subrange communicator of the ensemble. The communicator is collective over all ranks participating in the ensemble. I.e., it allows for ensemble-local communication.
Definition at line 95 of file mpi_ensemble.h.
|
inline |
Return a communicator for synchronization. The method either returns the (global) world communicator if global synchronization is enabled, or the (local) ensemble communicator.
Definition at line 103 of file mpi_ensemble.h.
|
inline |
A communicator spanning over all ensemble leaders that have ensemble rank 0. This communicator is collective over all ensemble leaders and invalid for all other ranks.
Definition at line 116 of file mpi_ensemble.h.
|
inline |
A "peer communicator" that groups all kth ranks of each ensemble together. (Suppose the ensemble_communicator() groups rows, then the peer_communicator() groups columns of the ensemble partition). The peer communicator is collective over all world ranks.
Definition at line 124 of file mpi_ensemble.h.