MFEM  v3.3
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mfem::MPI_Session Class Reference

A simple convenience 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>

Public Member Functions

 MPI_Session ()
 
 MPI_Session (int &argc, char **&argv)
 
 ~MPI_Session ()
 
int WorldRank () const
 Return MPI_COMM_WORLD's rank. More...
 
int WorldSize () const
 Return MPI_COMM_WORLD's size. More...
 
bool Root () const
 Return true if WorldRank() == 0. More...
 

Protected Member Functions

void GetRankAndSize ()
 

Protected Attributes

int world_rank
 
int world_size
 

Detailed Description

A simple convenience 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 30 of file communication.hpp.

Constructor & Destructor Documentation

mfem::MPI_Session::MPI_Session ( )
inline

Definition at line 40 of file communication.hpp.

mfem::MPI_Session::MPI_Session ( int &  argc,
char **&  argv 
)
inline

Definition at line 41 of file communication.hpp.

mfem::MPI_Session::~MPI_Session ( )
inline

Definition at line 43 of file communication.hpp.

Member Function Documentation

void mfem::MPI_Session::GetRankAndSize ( )
inlineprotected

Definition at line 34 of file communication.hpp.

bool mfem::MPI_Session::Root ( ) const
inline

Return true if WorldRank() == 0.

Definition at line 49 of file communication.hpp.

int mfem::MPI_Session::WorldRank ( ) const
inline

Return MPI_COMM_WORLD's rank.

Definition at line 45 of file communication.hpp.

int mfem::MPI_Session::WorldSize ( ) const
inline

Return MPI_COMM_WORLD's size.

Definition at line 47 of file communication.hpp.

Member Data Documentation

int mfem::MPI_Session::world_rank
protected

Definition at line 33 of file communication.hpp.

int mfem::MPI_Session::world_size
protected

Definition at line 33 of file communication.hpp.


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