//
//
#include "ProcData.hpp"
ProcData *ProcData::instance_ = 0;
int ProcData::isInitialized = 0;
int ProcData::initialize(int &argc, char **&argv)
{
if (isInitialized == 1) return 1;
#ifdef USE_MPI
int ierror;
ierror = MPI_Init(&argc, &argv);<--- ierror is assigned
ierror = MPI_Comm_rank(MPI_COMM_WORLD, &myRank);<--- ierror is overwritten<--- ierror is assigned
ierror = MPI_Comm_size(MPI_COMM_WORLD, &numProcs);<--- ierror is overwritten
#else
myRank = 0;
numProcs = 1;
#endif
/* initialize designated rank of master */
masterRank = 0;
isInitialized = 1;
return ierror;
}
ProcData::~ProcData()
{
#ifdef USE_MPI
MPI_Finalize();
#endif
isInitialized = 0;
}