1 #ifndef MHO_MPIInterface_HH__
2 #define MHO_MPIInterface_HH__
10 #define LOCAL_RANK_MPI
42 void Initialize(
int* argc,
char*** argv,
bool split_mode =
true);
interface functions for initialization of a MPI environment
Definition: MHO_MPIInterface.hh:24
MPI_Group fEvenGroup
Definition: MHO_MPIInterface.hh:214
bool fValidSplit
Definition: MHO_MPIInterface.hh:218
MPI_Group fOddGroup
Definition: MHO_MPIInterface.hh:215
int fNProcesses
Definition: MHO_MPIInterface.hh:206
MPI_Comm * GetSubGroupCommunicator()
Definition: MHO_MPIInterface.hh:179
bool fIsEvenGroupMember
Definition: MHO_MPIInterface.hh:219
std::string GetHostName() const
Getter for host name.
Definition: MHO_MPIInterface.hh:81
MPI_Group * GetEvenGroup()
Definition: MHO_MPIInterface.hh:191
void PrintMessage(std::string msg)
Collects and prints messages from all processes in a MPI parallel environment. when called,...
Definition: MHO_MPIInterface.cc:136
int GetNSubGroupProcesses()
Getter for nsub group processes.
Definition: MHO_MPIInterface.hh:146
MPI_Comm * GetEvenCommunicator()
Definition: MHO_MPIInterface.hh:195
int fPartnerProcessID
Definition: MHO_MPIInterface.hh:222
std::string fHostName
Definition: MHO_MPIInterface.hh:208
MPI_Status fStatus
Definition: MHO_MPIInterface.hh:227
bool IsEvenGroupMember()
Checks if the current process is a member of the even subgroup.
Definition: MHO_MPIInterface.hh:139
MPI_Group * GetSubGroup()
Getter for sub group.
Definition: MHO_MPIInterface.hh:167
void EndSequentialProcess()
Sends a flag to the next process and waits for all processes to finish.
Definition: MHO_MPIInterface.cc:126
int GetNProcesses() const
Getter for N processes.
Definition: MHO_MPIInterface.hh:67
MPI_Comm * GetOddCommunicator()
Definition: MHO_MPIInterface.hh:197
void BeginSequentialProcess()
Isolates a section of code for sequential processing by each process one at a time.
Definition: MHO_MPIInterface.cc:116
int GetGlobalProcessID() const
Getter for global process id.
Definition: MHO_MPIInterface.hh:60
int fLocalProcessID
Definition: MHO_MPIInterface.hh:207
static MHO_MPIInterface * GetInstance()
Getter for instance.
Definition: MHO_MPIInterface.cc:106
int GetLocalProcessID() const
Getter for local process id.
Definition: MHO_MPIInterface.hh:74
bool IsSplitValid()
Checks if even/odd split is valid.
Definition: MHO_MPIInterface.hh:132
bool SplitMode()
Checks if processes are split into two groups based on even/odd ranks.
Definition: MHO_MPIInterface.hh:125
void BroadcastString(std::string &msg)
Broadcasts a string message to all processes from root/master process.
Definition: MHO_MPIInterface.cc:231
int fSubGroupRank
Definition: MHO_MPIInterface.hh:220
MPI_Comm fEvenCommunicator
Definition: MHO_MPIInterface.hh:216
void GlobalBarrier() const
Waits for all processes in MPI_COMM_WORLD to reach this barrier.
Definition: MHO_MPIInterface.hh:97
virtual ~MHO_MPIInterface()
void Finalize()
Finalizes MPI by calling MPI_Finalize if not already finalized.
Definition: MHO_MPIInterface.cc:95
bool Check() const
Checks if global process ID is non-negative and number of processes is greater than zero.
Definition: MHO_MPIInterface.hh:53
int GetSubGroupRank()
Getter for sub group rank.
Definition: MHO_MPIInterface.hh:153
MHO_MPIInterface()
Definition: MHO_MPIInterface.cc:36
void Initialize(int *argc, char ***argv, bool split_mode=true)
Initializes MPI environment and sets up process groups/communicators.
Definition: MHO_MPIInterface.cc:49
MPI_Group * GetOddGroup()
Definition: MHO_MPIInterface.hh:193
std::vector< int > fCoHostedProcessIDs
Definition: MHO_MPIInterface.hh:209
bool fSplitMode
Definition: MHO_MPIInterface.hh:213
int fGlobalProcessID
Definition: MHO_MPIInterface.hh:205
int GetPartnerProcessID()
Getter for partner process id.
Definition: MHO_MPIInterface.hh:160
void SetupSubGroups()
Definition: MHO_MPIInterface.cc:374
MPI_Comm fOddCommunicator
Definition: MHO_MPIInterface.hh:217
static MHO_MPIInterface * fMPIInterface
Definition: MHO_MPIInterface.hh:203
void DetermineLocalRank()
Definition: MHO_MPIInterface.cc:254
int fNSubGroupProcesses
Definition: MHO_MPIInterface.hh:221
void msg(const char *string, int level,...)
Definition: msg.c:25
Definition: MHO_ChannelLabeler.hh:17