minor correction for localProcessors, localRank and localSize

This commit is contained in:
Hamidreza Norouzi 2024-03-22 08:58:01 -07:00
parent 49af1119f9
commit c3821d03c0
3 changed files with 7 additions and 7 deletions

View File

@ -36,7 +36,7 @@ class localProcessors
: :
public processors public processors
{ {
protected: private:
#ifdef pFlow_Build_MPI #ifdef pFlow_Build_MPI
pFlow::MPI::Comm parrentCommunicator_; pFlow::MPI::Comm parrentCommunicator_;
@ -44,9 +44,9 @@ protected:
pFlow::MPI::Comm localCommunicator_; pFlow::MPI::Comm localCommunicator_;
#endif #endif
int localSize_ = 0 ; int localSize_ = 1 ;
int localRank_ = -1; int localRank_ = 0;
bool isPartOfLocal_ = true; bool isPartOfLocal_ = true;

View File

@ -46,7 +46,7 @@ void pFlow::processors::initProcessors(int argc, char *argv[])
if(!processors::isInitialized()) if(!processors::isInitialized())
{ {
CheckMPI(MPI_Init(&argc, &argv), true); CheckMPI(MPI_Init(&argc, &argv), true);
isSelfInitialized_ = true; initProcessorsCelled_ = true;
argc_ = argc; argc_ = argc;
argv_ = argv; argv_ = argv;
@ -84,7 +84,7 @@ void pFlow::processors::finalizeProcessors()
{ {
#ifdef pFlow_Build_MPI #ifdef pFlow_Build_MPI
if(isSelfInitialized_ && !isFinalized()) if(initProcessorsCelled_ && !isFinalized())
{ {
MPI::TypeFree(&pFlow::MPI::realx3Type__); MPI::TypeFree(&pFlow::MPI::realx3Type__);
MPI::TypeFree(&pFlow::MPI::realx4Type__); MPI::TypeFree(&pFlow::MPI::realx4Type__);

View File

@ -50,11 +50,11 @@ namespace pFlow
*/ */
class processors class processors
{ {
protected: private:
/// Is the static member initProcessors is called /// Is the static member initProcessors is called
static inline static inline
bool isSelfInitialized_ = false; bool initProcessorsCelled_ = false;
/// Global rank of the current processor /// Global rank of the current processor
static inline static inline