cgma
ProcData Class Reference

#include <ProcData.hpp>

List of all members.

Public Member Functions

 ~ProcData ()
int initialize (int &argc, char **&argv)
int is_master () const

Static Public Member Functions

static ProcDatainstance ()

Public Attributes

int numProcs
int myRank
int masterRank

Private Member Functions

 ProcData ()

Static Private Attributes

static ProcDatainstance_ = 0
static int isInitialized = 0

Detailed Description

Definition at line 8 of file ProcData.hpp.


Constructor & Destructor Documentation

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.

{};

Member Function Documentation

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]

Definition at line 46 of file ProcData.hpp.

{
   if (instance_ == 0 ) {
     instance_ = new ProcData;
   }
   return instance_;
}
int ProcData::is_master ( ) const [inline]

Definition at line 21 of file ProcData.hpp.

{return myRank == masterRank;};

Member Data Documentation

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.

Definition at line 27 of file ProcData.hpp.

Definition at line 21 of file ProcData.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines