ryujin 2.1.1 revision 955e869188d49b3c97ca7b1cf4fd9ceb0e6f46ef
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, const int n_ensembles=1, const bool global_synchronization=true)
 
 ~MPIEnsemble ()
 
const auto & world_communicator () const
 
const auto & global_synchronization () const
 
const auto & world_rank () const
 
const auto & n_world_ranks () const
 
const auto & ensemble () const
 
const auto & n_ensembles () const
 
const auto & ensemble_rank () const
 
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,
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.

◆ ~MPIEnsemble()

ryujin::MPIEnsemble::~MPIEnsemble ( )

Member Function Documentation

◆ world_communicator()

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

Return the world communicator.

Definition at line 51 of file mpi_ensemble.h.

◆ global_synchronization()

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

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

Definition at line 56 of file mpi_ensemble.h.

◆ world_rank()

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

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

Definition at line 61 of file mpi_ensemble.h.

◆ n_world_ranks()

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

The total number of (global) MPI processes.

Definition at line 66 of file mpi_ensemble.h.

◆ ensemble()

const 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 72 of file mpi_ensemble.h.

Referenced by ryujin::MPIEnsembleContainer< T >::MPIEnsembleContainer().

◆ n_ensembles()

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

Return the total number of ensembles.

Definition at line 77 of file mpi_ensemble.h.

Referenced by ryujin::MPIEnsembleContainer< T >::MPIEnsembleContainer().

◆ ensemble_rank()

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

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

Definition at line 82 of file mpi_ensemble.h.

◆ n_ensemble_ranks()

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

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

Definition at line 87 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 94 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 102 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 115 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 123 of file mpi_ensemble.h.


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