MFEM  v4.6.0
Finite element discretization library
Static Public Member Functions | List of all members
mfem::Mpi Class Reference

A simple singleton class that calls MPI_Init() at construction and MPI_Finalize() at destruction. It also provides easy access to MPI_COMM_WORLD's rank and size. More...

#include <communication.hpp>

Static Public Member Functions

static void Init ()
 Singleton creation with Mpi::Init();. More...
 
static void Init (int &argc, char **&argv)
 Singleton creation with Mpi::Init(argc,argv);. More...
 
static void Finalize ()
 Finalize MPI (if it has been initialized and not yet already finalized). More...
 
static bool IsInitialized ()
 Return true if MPI has been initialized. More...
 
static bool IsFinalized ()
 Return true if MPI has been finalized. More...
 
static int WorldRank ()
 Return the MPI rank in MPI_COMM_WORLD. More...
 
static int WorldSize ()
 Return the size of MPI_COMM_WORLD. More...
 
static bool Root ()
 Return true if the rank in MPI_COMM_WORLD is zero. More...
 

Detailed Description

A simple singleton class that calls MPI_Init() at construction and MPI_Finalize() at destruction. It also provides easy access to MPI_COMM_WORLD's rank and size.

Definition at line 32 of file communication.hpp.

Member Function Documentation

◆ Finalize()

static void mfem::Mpi::Finalize ( )
inlinestatic

Finalize MPI (if it has been initialized and not yet already finalized).

Definition at line 40 of file communication.hpp.

◆ Init() [1/2]

static void mfem::Mpi::Init ( )
inlinestatic

Singleton creation with Mpi::Init();.

Definition at line 36 of file communication.hpp.

◆ Init() [2/2]

static void mfem::Mpi::Init ( int &  argc,
char **&  argv 
)
inlinestatic

Singleton creation with Mpi::Init(argc,argv);.

Definition at line 38 of file communication.hpp.

◆ IsFinalized()

static bool mfem::Mpi::IsFinalized ( )
inlinestatic

Return true if MPI has been finalized.

Definition at line 52 of file communication.hpp.

◆ IsInitialized()

static bool mfem::Mpi::IsInitialized ( )
inlinestatic

Return true if MPI has been initialized.

Definition at line 45 of file communication.hpp.

◆ Root()

static bool mfem::Mpi::Root ( )
inlinestatic

Return true if the rank in MPI_COMM_WORLD is zero.

Definition at line 73 of file communication.hpp.

◆ WorldRank()

static int mfem::Mpi::WorldRank ( )
inlinestatic

Return the MPI rank in MPI_COMM_WORLD.

Definition at line 59 of file communication.hpp.

◆ WorldSize()

static int mfem::Mpi::WorldSize ( )
inlinestatic

Return the size of MPI_COMM_WORLD.

Definition at line 66 of file communication.hpp.


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