interface functions for initialization of a MPI environment
More...
#include <MHO_MPIInterface.hh>
interface functions for initialization of a MPI environment
- Date
- Sat Mar 11 18:35:02 2023 -0500
- Author
- J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
◆ MHO_MPIInterface()
hops::MHO_MPIInterface::MHO_MPIInterface |
( |
| ) |
|
|
protected |
◆ ~MHO_MPIInterface()
hops::MHO_MPIInterface::~MHO_MPIInterface |
( |
| ) |
|
|
protectedvirtualdefault |
◆ BeginSequentialProcess()
void hops::MHO_MPIInterface::BeginSequentialProcess |
( |
| ) |
|
Isolates a section of code for sequential processing by each process one at a time.
◆ BroadcastString()
void hops::MHO_MPIInterface::BroadcastString |
( |
std::string & |
msg | ) |
|
Broadcasts a string message to all processes from root/master process.
- Parameters
-
msg | Reference to string message to be broadcasted. |
◆ Check()
bool hops::MHO_MPIInterface::Check |
( |
| ) |
const |
|
inline |
Checks if global process ID is non-negative and number of processes is greater than zero.
- Returns
- True if conditions are met, false otherwise.
◆ DetermineLocalRank()
void hops::MHO_MPIInterface::DetermineLocalRank |
( |
| ) |
|
|
protected |
◆ EndSequentialProcess()
void hops::MHO_MPIInterface::EndSequentialProcess |
( |
| ) |
|
Sends a flag to the next process and waits for all processes to finish.
◆ Finalize()
void hops::MHO_MPIInterface::Finalize |
( |
| ) |
|
Finalizes MPI by calling MPI_Finalize if not already finalized.
◆ GetEvenCommunicator()
MPI_Comm* hops::MHO_MPIInterface::GetEvenCommunicator |
( |
| ) |
|
|
inline |
◆ GetEvenGroup()
MPI_Group* hops::MHO_MPIInterface::GetEvenGroup |
( |
| ) |
|
|
inline |
◆ GetGlobalProcessID()
int hops::MHO_MPIInterface::GetGlobalProcessID |
( |
| ) |
const |
|
inline |
Getter for global process id.
- Returns
- The global process ID as an integer.
◆ GetHostName()
std::string hops::MHO_MPIInterface::GetHostName |
( |
| ) |
const |
|
inline |
Getter for host name.
- Returns
- Host name as a string
◆ GetInstance()
Getter for instance.
- Returns
- MHO_MPIInterface* singleton instance
- Note
- This is a static function.
◆ GetLocalProcessID()
int hops::MHO_MPIInterface::GetLocalProcessID |
( |
| ) |
const |
|
inline |
Getter for local process id.
- Returns
- Local process ID as an integer.
◆ GetNProcesses()
int hops::MHO_MPIInterface::GetNProcesses |
( |
| ) |
const |
|
inline |
Getter for N processes.
- Returns
- The number of processes as an integer.
◆ GetNSubGroupProcesses()
int hops::MHO_MPIInterface::GetNSubGroupProcesses |
( |
| ) |
|
|
inline |
Getter for nsub group processes.
- Returns
- Number of subgroup processes.
◆ GetOddCommunicator()
MPI_Comm* hops::MHO_MPIInterface::GetOddCommunicator |
( |
| ) |
|
|
inline |
◆ GetOddGroup()
MPI_Group* hops::MHO_MPIInterface::GetOddGroup |
( |
| ) |
|
|
inline |
◆ GetPartnerProcessID()
int hops::MHO_MPIInterface::GetPartnerProcessID |
( |
| ) |
|
|
inline |
Getter for partner process id.
- Returns
- ID of the partner process as an integer.
◆ GetSubGroup()
MPI_Group* hops::MHO_MPIInterface::GetSubGroup |
( |
| ) |
|
|
inline |
Getter for sub group.
- Returns
- MPI_Group* representing the sub-group rank
◆ GetSubGroupCommunicator()
MPI_Comm* hops::MHO_MPIInterface::GetSubGroupCommunicator |
( |
| ) |
|
|
inline |
◆ GetSubGroupRank()
int hops::MHO_MPIInterface::GetSubGroupRank |
( |
| ) |
|
|
inline |
Getter for sub group rank.
- Returns
- The subgroup rank as an integer.
◆ GlobalBarrier()
void hops::MHO_MPIInterface::GlobalBarrier |
( |
| ) |
const |
|
inline |
Waits for all processes in MPI_COMM_WORLD to reach this barrier.
◆ Initialize()
void hops::MHO_MPIInterface::Initialize |
( |
int * |
argc, |
|
|
char *** |
argv, |
|
|
bool |
split_mode = true |
|
) |
| |
Initializes MPI environment and sets up process groups/communicators.
- Parameters
-
argc | Pointer to integer for command line argument count |
argv | Double pointer to character array for command line arguments |
split_mode | Boolean flag indicating whether to split processes |
◆ IsEvenGroupMember()
bool hops::MHO_MPIInterface::IsEvenGroupMember |
( |
| ) |
|
|
inline |
Checks if the current process is a member of the even subgroup.
- Returns
- True if it's an even group member, false otherwise.
◆ IsSplitValid()
bool hops::MHO_MPIInterface::IsSplitValid |
( |
| ) |
|
|
inline |
Checks if even/odd split is valid.
- Returns
- True if split is valid, false otherwise.
◆ PrintMessage()
void hops::MHO_MPIInterface::PrintMessage |
( |
std::string |
msg | ) |
|
Collects and prints messages from all processes in a MPI parallel environment. when called, this function must be encountered by all processes or the program will lock up, treat it as a global barrier use it to safely print messages from each process without clobbering the ouput.
- Parameters
-
msg | Message to be printed by all processes. |
◆ SetupSubGroups()
void hops::MHO_MPIInterface::SetupSubGroups |
( |
| ) |
|
|
protected |
◆ SplitMode()
bool hops::MHO_MPIInterface::SplitMode |
( |
| ) |
|
|
inline |
Checks if processes are split into two groups based on even/odd ranks.
- Returns
- True if in split mode, false otherwise.
◆ fCoHostedProcessIDs
std::vector< int > hops::MHO_MPIInterface::fCoHostedProcessIDs |
|
protected |
◆ fEvenCommunicator
MPI_Comm hops::MHO_MPIInterface::fEvenCommunicator |
|
protected |
◆ fEvenGroup
MPI_Group hops::MHO_MPIInterface::fEvenGroup |
|
protected |
◆ fGlobalProcessID
int hops::MHO_MPIInterface::fGlobalProcessID |
|
protected |
◆ fHostName
std::string hops::MHO_MPIInterface::fHostName |
|
protected |
◆ fIsEvenGroupMember
bool hops::MHO_MPIInterface::fIsEvenGroupMember |
|
protected |
◆ fLocalProcessID
int hops::MHO_MPIInterface::fLocalProcessID |
|
protected |
◆ fMPIInterface
◆ fNProcesses
int hops::MHO_MPIInterface::fNProcesses |
|
protected |
◆ fNSubGroupProcesses
int hops::MHO_MPIInterface::fNSubGroupProcesses |
|
protected |
◆ fOddCommunicator
MPI_Comm hops::MHO_MPIInterface::fOddCommunicator |
|
protected |
◆ fOddGroup
MPI_Group hops::MHO_MPIInterface::fOddGroup |
|
protected |
◆ fPartnerProcessID
int hops::MHO_MPIInterface::fPartnerProcessID |
|
protected |
◆ fSplitMode
bool hops::MHO_MPIInterface::fSplitMode |
|
protected |
◆ fStatus
MPI_Status hops::MHO_MPIInterface::fStatus |
|
protected |
◆ fSubGroupRank
int hops::MHO_MPIInterface::fSubGroupRank |
|
protected |
◆ fValidSplit
bool hops::MHO_MPIInterface::fValidSplit |
|
protected |
The documentation for this class was generated from the following files: