MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
globalmpiinfo.h File Reference

Go to the source code of this file.

Classes

class  GlobalMpiInformation
 Class to store global MPI information and to prevent accidental changes. More...
 

Functions

void printMpiInfo (MPI_Info &mpiInfo)
 Print all information of given MPI_Info object. More...
 
MInt globalDomainId ()
 Return global domain id. More...
 
MInt globalNoDomains ()
 Return global number of domains. More...
 
const MPI_Info & globalMpiInfo ()
 Return global MPI information. More...
 

Variables

GlobalMpiInformation g_mpiInformation
 

Function Documentation

◆ globalDomainId()

MInt globalDomainId ( )
inline

Definition at line 113 of file globalmpiinfo.h.

GlobalMpiInformation g_mpiInformation

◆ globalMpiInfo()

const MPI_Info & globalMpiInfo ( )
inline

Definition at line 117 of file globalmpiinfo.h.

◆ globalNoDomains()

MInt globalNoDomains ( )
inline

Definition at line 115 of file globalmpiinfo.h.

◆ printMpiInfo()

void printMpiInfo ( MPI_Info &  mpiInfo)

Print all information of given MPI_Info object.

Definition at line 14 of file globalmpiinfo.cpp.

14 {
15 MInt i, nkeys;
16
17 MPI_Info_get_nkeys(mpiInfo, &nkeys, AT_);
18 std::cerr << "MPI Info: nkeys = " << nkeys << std::endl;
19 for(i = 0; i < nkeys; i++) {
20 char key[MPI_MAX_INFO_KEY], value[MPI_MAX_INFO_VAL];
21 MInt valuelen, flag;
22
23 MPI_Info_get_nthkey(mpiInfo, i, key, AT_);
24 MPI_Info_get_valuelen(mpiInfo, key, &valuelen, &flag, AT_);
25 MPI_Info_get(mpiInfo, key, valuelen + 1, value, &flag, AT_);
26 std::cerr << "MPI Info: [" << i << "] key = " << key << ", value = " << value << std::endl;
27 }
28}
int32_t MInt
Definition: maiatypes.h:62
int MPI_Info_get(MPI_Info info, const char *key, int valuelen, char *value, int *flag, const MString &name)
same as MPI_Info_get
int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen, int *flag, const MString &name)
same as MPI_Info_get_valuelen
int MPI_Info_get_nthkey(MPI_Info info, int n, char *key, const MString &name)
same as MPI_Info_get_nthkey
int MPI_Info_get_nkeys(MPI_Info info, int *nkeys, const MString &name)
same as MPI_Info_get_nkeys

Variable Documentation

◆ g_mpiInformation

GlobalMpiInformation g_mpiInformation
extern

Definition at line 10 of file globalmpiinfo.cpp.