DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::MPIInfo Struct Reference

Lightweight bundle of an MPI communicator and the calling rank's coordinates. More...

#include <MPI.hpp>

Public Member Functions

 MPIInfo ()=default
 
 MPIInfo (MPI_Comm ncomm)
 Wrap an existing MPI communicator; queries rank and size.
 
 MPIInfo (MPI_Comm nc, int r, int s)
 Low-level constructor for callers that already know (rank, size).
 
void setWorld ()
 Initialise the object to MPI_COMM_WORLD. Requires MPI_Init to have run.
 
bool operator== (const MPIInfo &r) const
 Exact triple equality.
 

Public Attributes

MPI_Comm comm = MPI_COMM_NULL
 The underlying MPI communicator handle.
 
int rank = -1
 This rank's 0-based index within comm (-1 until initialised).
 
int size = -1
 Number of ranks in comm (-1 until initialised).
 

Detailed Description

Lightweight bundle of an MPI communicator and the calling rank's coordinates.

The canonical "where am I in the parallel world" object passed almost everywhere in DNDSR. Cheap to copy (three ints). Two-phase construction is supported:

  • default-construct, then call setWorld (or the MPI_Comm ctor) once MPI_Init has run.

Comparison (operator==) tests exact equality of the triple (comm, rank, size).

Definition at line 214 of file MPI.hpp.

Constructor & Destructor Documentation

◆ MPIInfo() [1/3]

DNDS::MPIInfo::MPIInfo ( )
default

◆ MPIInfo() [2/3]

DNDS::MPIInfo::MPIInfo ( MPI_Comm  ncomm)
inline

Wrap an existing MPI communicator; queries rank and size.

Definition at line 226 of file MPI.hpp.

◆ MPIInfo() [3/3]

DNDS::MPIInfo::MPIInfo ( MPI_Comm  nc,
int  r,
int  s 
)
inline

Low-level constructor for callers that already know (rank, size).

Warning
Bug: the fourth argument stores r into size too; callers currently pass matching values. Prefer the single-arg MPI_Comm ctor.

Definition at line 237 of file MPI.hpp.

Member Function Documentation

◆ operator==()

bool DNDS::MPIInfo::operator== ( const MPIInfo r) const
inline

Exact triple equality.

Definition at line 251 of file MPI.hpp.

Here is the call graph for this function:

◆ setWorld()

void DNDS::MPIInfo::setWorld ( )
inline

Initialise the object to MPI_COMM_WORLD. Requires MPI_Init to have run.

Definition at line 242 of file MPI.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ comm

MPI_Comm DNDS::MPIInfo::comm = MPI_COMM_NULL

The underlying MPI communicator handle.

Definition at line 217 of file MPI.hpp.

◆ rank

int DNDS::MPIInfo::rank = -1

This rank's 0-based index within comm (-1 until initialised).

Definition at line 219 of file MPI.hpp.

◆ size

int DNDS::MPIInfo::size = -1

Number of ranks in comm (-1 until initialised).

Definition at line 221 of file MPI.hpp.


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