cgma
|
#include <ProcData.hpp>
Public Member Functions | |
~ProcData () | |
int | initialize (int &argc, char **&argv) |
int | is_master () const |
Static Public Member Functions | |
static ProcData * | instance () |
Public Attributes | |
int | numProcs |
int | myRank |
int | masterRank |
Private Member Functions | |
ProcData () | |
Static Private Attributes | |
static ProcData * | instance_ = 0 |
static int | isInitialized = 0 |
Definition at line 8 of file ProcData.hpp.
Definition at line 30 of file ProcData.cpp.
{ #ifdef USE_MPI MPI_Finalize(); #endif isInitialized = 0; }
ProcData::ProcData | ( | ) | [inline, private] |
Definition at line 41 of file ProcData.hpp.
{};
int ProcData::initialize | ( | int & | argc, |
char **& | argv | ||
) |
Definition at line 8 of file ProcData.cpp.
{ if (isInitialized == 1) return 1; #ifdef USE_MPI int ierror; ierror = MPI_Init(&argc, &argv); ierror = MPI_Comm_rank(MPI_COMM_WORLD, &myRank); ierror = MPI_Comm_size(MPI_COMM_WORLD, &numProcs); #else myRank = 0; numProcs = 1; #endif /* initialize designated rank of master */ masterRank = 0; isInitialized = 1; return ierror; }
ProcData * ProcData::instance | ( | void | ) | [inline, static] |
int ProcData::is_master | ( | ) | const [inline] |
Definition at line 21 of file ProcData.hpp.
{return myRank == masterRank;};
ProcData * ProcData::instance_ = 0 [static, private] |
Definition at line 35 of file ProcData.hpp.
int ProcData::isInitialized = 0 [static, private] |
Definition at line 38 of file ProcData.hpp.
Definition at line 30 of file ProcData.hpp.
int ProcData::myRank |
Definition at line 27 of file ProcData.hpp.
Definition at line 21 of file ProcData.hpp.