ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
Public Member Functions | List of all members
ryujin::MPIEnsemble Class Referencefinal

#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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MPIEnsemble()

ryujin::MPIEnsemble::MPIEnsemble ( const MPI_Comm &  mpi_communicator)

◆ ~MPIEnsemble()

ryujin::MPIEnsemble::~MPIEnsemble ( )

Member Function Documentation

◆ prepare()

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.

Precondition
The total number of mpi ranks must be an integer multiple of n_ensembles.

◆ world_communicator()

const auto & ryujin::MPIEnsemble::world_communicator ( ) const
inline

Return the world communicator.

Definition at line 52 of file mpi_ensemble.h.

◆ global_synchronization()

auto & ryujin::MPIEnsemble::global_synchronization ( ) const
inline

If true, then ensembles run in lockstep with a synchronized tau_max.

Definition at line 57 of file mpi_ensemble.h.

◆ world_rank()

auto & ryujin::MPIEnsemble::world_rank ( ) const
inline

The (global) world rank of the current MPI process.

Definition at line 62 of file mpi_ensemble.h.

◆ n_world_ranks()

auto & ryujin::MPIEnsemble::n_world_ranks ( ) const
inline

The total number of (global) MPI processes.

Definition at line 67 of file mpi_ensemble.h.

◆ ensemble()

auto & ryujin::MPIEnsemble::ensemble ( ) const
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.

◆ n_ensembles()

auto & ryujin::MPIEnsemble::n_ensembles ( ) const
inline

Return the total number of ensembles.

Definition at line 78 of file mpi_ensemble.h.

◆ ensemble_rank()

auto & ryujin::MPIEnsemble::ensemble_rank ( ) const
inline

The (local) ensemble rank of the current MPI process.

Definition at line 83 of file mpi_ensemble.h.

◆ n_ensemble_ranks()

auto & ryujin::MPIEnsemble::n_ensemble_ranks ( ) const
inline

The total number of (local) MPI processes belonging to the ensemble.

Definition at line 88 of file mpi_ensemble.h.

◆ ensemble_communicator()

const auto & ryujin::MPIEnsemble::ensemble_communicator ( ) const
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.

◆ synchronization_communicator()

DEAL_II_ALWAYS_INLINE const MPI_Comm & ryujin::MPIEnsemble::synchronization_communicator ( ) const
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.

◆ ensemble_leader_communicator()

const auto & ryujin::MPIEnsemble::ensemble_leader_communicator ( ) const
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.

◆ peer_communicator()

const auto & ryujin::MPIEnsemble::peer_communicator ( ) const
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.


The documentation for this class was generated from the following file: