Loading...
Searching...
No Matches
UPstream::Communicator Class Reference

An opaque wrapper for MPI_Comm with a vendor-independent representation without any <mpi.h> header. More...

#include <UPstream.H>

Public Types

typedef std::intptr_t value_type
 Storage for MPI_Comm (as integer or pointer).

Public Member Functions

 Communicator (const Communicator &) noexcept=default
 Copy construct.
 Communicator (Communicator &&) noexcept=default
 Move construct.
Communicatoroperator= (const Communicator &) noexcept=default
 Copy assignment.
Communicatoroperator= (Communicator &&) noexcept=default
 Move assignment.
bool operator== (const Communicator &rhs) const noexcept
 Test for equality.
bool operator!= (const Communicator &rhs) const noexcept
 Test for inequality.
 Communicator () noexcept
 Default construct as MPI_COMM_NULL.
 Communicator (const void *p) noexcept
 Construct from MPI_Comm (as pointer type).
 Communicator (value_type val) noexcept
 Construct from MPI_Comm (as integer type).
value_type value () const noexcept
 Return raw value.
const void * pointer () const noexcept
 Return as pointer value.
bool good () const noexcept
 True if not equal to MPI_COMM_NULL.
void reset () noexcept
 Reset to default constructed value (MPI_COMM_NULL).
int size () const
 The number of ranks associated with the communicator.

Static Public Member Functions

static Communicator lookup (int communicator=-1)
 Transcribe internally indexed communicator to wrapped value.

Detailed Description

An opaque wrapper for MPI_Comm with a vendor-independent representation without any <mpi.h> header.

The MPI standard states that MPI_Comm is always an opaque object. Generally it is either an integer (eg, mpich) or a pointer (eg, openmpi).

Definition at line 2759 of file UPstream.H.

Member Typedef Documentation

◆ value_type

typedef std::intptr_t value_type

Storage for MPI_Comm (as integer or pointer).

Definition at line 2768 of file UPstream.H.

Constructor & Destructor Documentation

◆ Communicator() [1/5]

Communicator ( const Communicator & )
defaultnoexcept

Copy construct.

References Communicator().

Referenced by Communicator(), Communicator(), Communicator(), Communicator(), operator!=(), operator=(), operator=(), and operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Communicator() [2/5]

Communicator ( Communicator && )
defaultnoexcept

Move construct.

References Communicator(), and Foam::noexcept.

Here is the call graph for this function:

◆ Communicator() [3/5]

Communicator ( )
noexcept

Default construct as MPI_COMM_NULL.

Definition at line 25 of file UPstreamCommunicator.C.

References Communicator(), Foam::noexcept, and UPstream::UPstream().

Here is the call graph for this function:

◆ Communicator() [4/5]

Communicator ( const void * p)
inlineexplicitnoexcept

Construct from MPI_Comm (as pointer type).

Definition at line 2834 of file UPstream.H.

References Communicator(), Foam::noexcept, and p.

Here is the call graph for this function:

◆ Communicator() [5/5]

Communicator ( value_type val)
inlineexplicitnoexcept

Construct from MPI_Comm (as integer type).

Definition at line 2842 of file UPstream.H.

References Foam::noexcept.

Member Function Documentation

◆ operator=() [1/2]

Communicator & operator= ( const Communicator & )
defaultnoexcept

Copy assignment.

References Communicator(), and Foam::noexcept.

Here is the call graph for this function:

◆ operator=() [2/2]

Communicator & operator= ( Communicator && )
defaultnoexcept

Move assignment.

References Communicator(), and Foam::noexcept.

Here is the call graph for this function:

◆ operator==()

bool operator== ( const Communicator & rhs) const
inlinenoexcept

Test for equality.

Definition at line 2810 of file UPstream.H.

References Communicator(), Foam::noexcept, and Foam::rhs().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const Communicator & rhs) const
inlinenoexcept

Test for inequality.

Definition at line 2818 of file UPstream.H.

References Communicator(), and Foam::rhs().

Here is the call graph for this function:

◆ lookup()

Foam::UPstream::Communicator lookup ( int communicator = -1)
static

Transcribe internally indexed communicator to wrapped value.

Example,

(
)
static Communicator lookup(int communicator=-1)
Transcribe internally indexed communicator to wrapped value.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
Definition UPstream.H:1069
static Type to_mpi(UPstream::Communicator arg) noexcept
Cast UPstream::Communicator to MPI_Comm.
Parameters
communicatorThe internally indexed communicator. The default (-1) is the same as UPstream::worldComm.

Definition at line 34 of file UPstreamCommunicator.C.

◆ value()

value_type value ( ) const
inlinenoexcept

Return raw value.

Definition at line 2877 of file UPstream.H.

References Foam::noexcept.

◆ pointer()

const void * pointer ( ) const
inlinenoexcept

Return as pointer value.

Definition at line 2882 of file UPstream.H.

References Foam::noexcept.

◆ good()

bool good ( ) const
noexcept

True if not equal to MPI_COMM_NULL.

Definition at line 42 of file UPstreamCommunicator.C.

References Foam::noexcept.

◆ reset()

void reset ( )
noexcept

Reset to default constructed value (MPI_COMM_NULL).

Definition at line 48 of file UPstreamCommunicator.C.

References Foam::noexcept.

◆ size()

int size ( ) const

The number of ranks associated with the communicator.

Definition at line 52 of file UPstreamCommunicator.C.


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