![]() |
ryujin 2.5.0 revision 485f4d86eecc4b07216617ffc8f94b531c9f6085
|
#include <include/ryujin/base/mpi_ensemble.h>
Public Member Functions | |
| MPIEnsemble (const MPI_Comm &mpi_communicator, const int n_ensembles=1, const bool global_synchronization=true) | |
| ~MPIEnsemble () | |
| ACCESSOR_READ_ONLY_NO_DEREFERENCE (world_communicator) | |
| ACCESSOR_READ_ONLY (global_synchronization) | |
| ACCESSOR_READ_ONLY (world_rank) | |
| ACCESSOR_READ_ONLY (n_world_ranks) | |
| ACCESSOR_READ_ONLY (ensemble) | |
| ACCESSOR_READ_ONLY (n_ensembles) | |
| ACCESSOR_READ_ONLY (ensemble_rank) | |
| ACCESSOR_READ_ONLY (n_ensemble_ranks) | |
| ACCESSOR_READ_ONLY_NO_DEREFERENCE (ensemble_communicator) | |
| DEAL_II_ALWAYS_INLINE const MPI_Comm & | synchronization_communicator () const |
| ACCESSOR_READ_ONLY_NO_DEREFERENCE (ensemble_leader_communicator) | |
| ACCESSOR_READ_ONLY_NO_DEREFERENCE (peer_communicator) | |
| std::string | base_name (const std::string &base_name) const |
A class responsible for subdividing a given global MPI communicator into a set of "ensembles" with a corresponding 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 29 of file mpi_ensemble.h.
| ryujin::MPIEnsemble::MPIEnsemble | ( | const MPI_Comm & | mpi_communicator, |
| const int | n_ensembles = 1, |
||
| const bool | global_synchronization = true |
||
| ) |
Prepare the MPI ensemble and split the global 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 performed in the HyperbolicModule and ParabolicModule, or whether such synchronization remains local to the ensemble.
| ryujin::MPIEnsemble::~MPIEnsemble | ( | ) |
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY_NO_DEREFERENCE | ( | world_communicator | ) |
Return the world communicator.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY | ( | global_synchronization | ) |
If true, then ensembles run in lockstep with a synchronized tau_max.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY | ( | world_rank | ) |
The (global) world rank of the current MPI process.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY | ( | n_world_ranks | ) |
The total number of (global) MPI processes.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY | ( | ensemble | ) |
Return the ensemble in the interval [0, n_ensembles) that the given MPI process belongs to.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY | ( | n_ensembles | ) |
Return the total number of ensembles.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY | ( | ensemble_rank | ) |
The (local) ensemble rank of the current MPI process.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY | ( | n_ensemble_ranks | ) |
The total number of (local) MPI processes belonging to the ensemble.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY_NO_DEREFERENCE | ( | ensemble_communicator | ) |
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.
|
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.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY_NO_DEREFERENCE | ( | ensemble_leader_communicator | ) |
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.
| ryujin::MPIEnsemble::ACCESSOR_READ_ONLY_NO_DEREFERENCE | ( | peer_communicator | ) |
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.
| std::string ryujin::MPIEnsemble::base_name | ( | const std::string & | base_name | ) | const |
Return the base name of all output files of the ensemble: base_name with the suffix "-ensemble_<n>" if there is more than one ensemble.