PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
util::parallel::MpiStatus Struct Reference

Struct that stores MPI-related information. More...

#include <parallelUtil.h>

Collaboration diagram for util::parallel::MpiStatus:

Public Member Functions

 MpiStatus ()
 Constructor.
 
std::string printStr (int nt=0, int lvl=0) const
 Returns the string containing printable information about the object.
 

Data Fields

bool d_mpiEnabled
 Specifies if MPI is enabled (yes if code executed with more than one processor)
 
int d_mpiSize
 Size (number) of processors.
 
int d_mpiRank
 Rank (id) of this processor.
 
MPI_Comm d_comm
 MPI comm.
 

Detailed Description

Struct that stores MPI-related information.

Definition at line 23 of file parallelUtil.h.

Constructor & Destructor Documentation

◆ MpiStatus()

util::parallel::MpiStatus::MpiStatus ( )

Constructor.

Definition at line 33 of file parallelUtil.cpp.

33 {
34 d_comm = MPI_COMM_WORLD;
35 MPI_Comm_size(d_comm, &d_mpiSize);
36 MPI_Comm_rank(d_comm, &d_mpiRank);
38}
int d_mpiRank
Rank (id) of this processor.
bool d_mpiEnabled
Specifies if MPI is enabled (yes if code executed with more than one processor)
int d_mpiSize
Size (number) of processors.
MPI_Comm d_comm
MPI comm.

References d_comm, d_mpiEnabled, d_mpiRank, and d_mpiSize.

Member Function Documentation

◆ printStr()

std::string util::parallel::MpiStatus::printStr ( int  nt = 0,
int  lvl = 0 
) const

Returns the string containing printable information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)
Returns
string String containing printable information about the object

Definition at line 40 of file parallelUtil.cpp.

40 {
41 std::string tabS = "";
42 for (int i = 0; i < nt; i++)
43 tabS += "\t";
44 std::ostringstream oss;
45 oss << tabS << "------- MpiStatus --------" << std::endl << std::endl;
46 //oss << tabS << "Comm = " << d_comm << std::endl;
47 oss << tabS << "MPI Size = " << d_mpiSize << std::endl;
48 oss << tabS << "MPI Rank = " << d_mpiRank << std::endl;
49 oss << tabS << "MPI Enabled = " << d_mpiEnabled << std::endl;
50 oss << tabS << std::endl;
51
52 return oss.str();
53}

Field Documentation

◆ d_comm

MPI_Comm util::parallel::MpiStatus::d_comm

MPI comm.

Definition at line 35 of file parallelUtil.h.

Referenced by util::parallel::mpiComm(), and MpiStatus().

◆ d_mpiEnabled

bool util::parallel::MpiStatus::d_mpiEnabled

Specifies if MPI is enabled (yes if code executed with more than one processor)

Definition at line 26 of file parallelUtil.h.

Referenced by util::parallel::isMpiEnabled(), and MpiStatus().

◆ d_mpiRank

int util::parallel::MpiStatus::d_mpiRank

Rank (id) of this processor.

Definition at line 32 of file parallelUtil.h.

Referenced by util::parallel::mpiRank(), and MpiStatus().

◆ d_mpiSize

int util::parallel::MpiStatus::d_mpiSize

Size (number) of processors.

Definition at line 29 of file parallelUtil.h.

Referenced by util::parallel::mpiSize(), and MpiStatus().


The documentation for this struct was generated from the following files: