MFEM  v3.4
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 32 of file communication.hpp.

Constructor & Destructor Documentation

mfem::MPI_Session::MPI_Session ( )
inline

Definition at line 38 of file communication.hpp.

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

Definition at line 39 of file communication.hpp.

mfem::MPI_Session::~MPI_Session ( )
inline

Definition at line 41 of file communication.hpp.

Member Function Documentation

void mfem::MPI_Session::GetRankAndSize ( )
protected

Definition at line 37 of file communication.cpp.

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

Return true if WorldRank() == 0.

Definition at line 47 of file communication.hpp.

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

Return MPI_COMM_WORLD's rank.

Definition at line 43 of file communication.hpp.

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

Return MPI_COMM_WORLD's size.

Definition at line 45 of file communication.hpp.

Member Data Documentation

int mfem::MPI_Session::world_rank
protected

Definition at line 35 of file communication.hpp.

int mfem::MPI_Session::world_size
protected

Definition at line 35 of file communication.hpp.


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