ryujin 2.5.0 revision 485f4d86eecc4b07216617ffc8f94b531c9f6085
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ryujin::MPIEnsemble Class Referencefinal

#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
 

Detailed Description

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.

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 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.

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

◆ ~MPIEnsemble()

ryujin::MPIEnsemble::~MPIEnsemble ( )

Member Function Documentation

◆ ACCESSOR_READ_ONLY_NO_DEREFERENCE() [1/4]

ryujin::MPIEnsemble::ACCESSOR_READ_ONLY_NO_DEREFERENCE ( world_communicator  )

Return the world communicator.

◆ ACCESSOR_READ_ONLY() [1/7]

ryujin::MPIEnsemble::ACCESSOR_READ_ONLY ( global_synchronization  )

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

◆ ACCESSOR_READ_ONLY() [2/7]

ryujin::MPIEnsemble::ACCESSOR_READ_ONLY ( world_rank  )

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

◆ ACCESSOR_READ_ONLY() [3/7]

ryujin::MPIEnsemble::ACCESSOR_READ_ONLY ( n_world_ranks  )

The total number of (global) MPI processes.

◆ ACCESSOR_READ_ONLY() [4/7]

ryujin::MPIEnsemble::ACCESSOR_READ_ONLY ( ensemble  )

Return the ensemble in the interval [0, n_ensembles) that the given MPI process belongs to.

◆ ACCESSOR_READ_ONLY() [5/7]

ryujin::MPIEnsemble::ACCESSOR_READ_ONLY ( n_ensembles  )

Return the total number of ensembles.

◆ ACCESSOR_READ_ONLY() [6/7]

ryujin::MPIEnsemble::ACCESSOR_READ_ONLY ( ensemble_rank  )

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

◆ ACCESSOR_READ_ONLY() [7/7]

ryujin::MPIEnsemble::ACCESSOR_READ_ONLY ( n_ensemble_ranks  )

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

◆ ACCESSOR_READ_ONLY_NO_DEREFERENCE() [2/4]

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.

◆ 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.

◆ ACCESSOR_READ_ONLY_NO_DEREFERENCE() [3/4]

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.

◆ ACCESSOR_READ_ONLY_NO_DEREFERENCE() [4/4]

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.

◆ base_name()

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.


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