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

Wrapper for internally indexed communicator label. Always invokes UPstream::allocateCommunicatorComponents() and UPstream::freeCommunicatorComponents(). More...

#include <UPstream.H>

Public Member Functions

 communicator (const communicator &)=delete
 No copy construct.
void operator= (const communicator &)=delete
 No copy assignment.
 communicator () noexcept
 Default construct (a placeholder communicator).
 communicator (communicator &&c)
 Move construct, takes ownership.
 communicator (const label parentComm, const labelRange &subRanks)
 Allocate communicator for contiguous sub-ranks on given parent.
 communicator (const label parentComm, const labelUList &subRanks)
 Allocate communicator for sub-ranks on given parent.
 ~communicator ()
 Free allocated communicator.
bool good () const noexcept
 True if communicator is non-negative (ie, was allocated).
label comm () const noexcept
 The communicator label.
communicatorconstCast () const noexcept
 Return non-const reference to this.
label release () noexcept
 Release ownership of the communicator, return old value.
void reset ()
 Free allocated communicator.
void reset (label parent, const labelRange &subRanks)
 Allocate with contiguous sub-ranks of parent communicator.
void reset (label parent, const labelUList &subRanks)
 Allocate with sub-ranks of parent communicator.
void reset (communicator &&c)
 Take ownership, free managed communicator.
void swap (communicator &c)
 Swap communicator labels.
 operator label () const noexcept
 Implicit cast to label - the same as comm().
void operator= (communicator &&c)
 Move assignment, takes ownership.
bool operator== (const communicator &c) const noexcept
 Test for equality.
bool operator!= (const communicator &c) const noexcept
 Test for inequality.

Static Public Member Functions

static communicator duplicate (const label parentComm)
 Duplicate the given communicator.
static communicator split (const label parentComm, const int colour, const bool two_step=true)
 Factory Method : Split the communicator on the given colour.

Detailed Description

Wrapper for internally indexed communicator label. Always invokes UPstream::allocateCommunicatorComponents() and UPstream::freeCommunicatorComponents().

Definition at line 2545 of file UPstream.H.

Constructor & Destructor Documentation

◆ communicator() [1/5]

communicator ( const communicator & )
delete

No copy construct.

References communicator().

Referenced by communicator(), communicator(), constCast(), duplicate(), operator!=(), operator=(), operator=(), operator==(), reset(), split(), and swap().

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

◆ communicator() [2/5]

communicator ( )
inlinenoexcept

Default construct (a placeholder communicator).

Definition at line 2574 of file UPstream.H.

References Foam::noexcept.

◆ communicator() [3/5]

communicator ( communicator && c)
inline

Move construct, takes ownership.

Definition at line 2579 of file UPstream.H.

References communicator().

Here is the call graph for this function:

◆ communicator() [4/5]

communicator ( const label parentComm,
const labelRange & subRanks )
inline

Allocate communicator for contiguous sub-ranks on given parent.

Parameters
parentCommThe parent communicator
subRanksThe contiguous sub-ranks of parent to use

Definition at line 2584 of file UPstream.H.

References UPstream::newCommunicator(), and UPstream::UPstream().

Here is the call graph for this function:

◆ communicator() [5/5]

communicator ( const label parentComm,
const labelUList & subRanks )
inline

Allocate communicator for sub-ranks on given parent.

Parameters
parentCommThe parent communicator
subRanksThe sub-ranks of parent to use (negative values ignored)

Definition at line 2598 of file UPstream.H.

References UPstream::newCommunicator(), and UPstream::UPstream().

Here is the call graph for this function:

◆ ~communicator()

~communicator ( )
inline

Free allocated communicator.

Definition at line 2615 of file UPstream.H.

References UPstream::freeCommunicator().

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

void operator= ( const communicator & )
delete

No copy assignment.

References communicator().

Here is the call graph for this function:

◆ duplicate()

communicator duplicate ( const label parentComm)
inlinestatic

Duplicate the given communicator.

Definition at line 2623 of file UPstream.H.

References communicator(), and UPstream::dupCommunicator().

Here is the call graph for this function:

◆ split()

communicator split ( const label parentComm,
const int colour,
const bool two_step = true )
inlinestatic

Factory Method : Split the communicator on the given colour.

Parameters
parentCommThe parent communicator
colourThe colouring to select which ranks to include. Negative values correspond to 'ignore'
two_stepUse MPI_Allgather+MPI_Comm_create_group vs MPI_Comm_split

Definition at line 2634 of file UPstream.H.

References communicator(), and UPstream::splitCommunicator().

Here is the call graph for this function:

◆ good()

bool good ( ) const
inlinenoexcept

True if communicator is non-negative (ie, was allocated).

Definition at line 2656 of file UPstream.H.

References Foam::noexcept.

◆ comm()

label comm ( ) const
inlinenoexcept

The communicator label.

Definition at line 2661 of file UPstream.H.

References Foam::noexcept.

◆ constCast()

communicator & constCast ( ) const
inlinenoexcept

Return non-const reference to this.

Definition at line 2666 of file UPstream.H.

References communicator(), and Foam::noexcept.

Here is the call graph for this function:

◆ release()

label release ( )
inlinenoexcept

Release ownership of the communicator, return old value.

Leave further management to the caller

Definition at line 2676 of file UPstream.H.

References Foam::noexcept.

◆ reset() [1/4]

void reset ( )
inline

Free allocated communicator.

Definition at line 2681 of file UPstream.H.

References UPstream::freeCommunicator().

Here is the call graph for this function:

◆ reset() [2/4]

void reset ( label parent,
const labelRange & subRanks )
inline

Allocate with contiguous sub-ranks of parent communicator.

Definition at line 2686 of file UPstream.H.

References UPstream::freeCommunicator(), UPstream::newCommunicator(), and UPstream::parent().

Here is the call graph for this function:

◆ reset() [3/4]

void reset ( label parent,
const labelUList & subRanks )
inline

Allocate with sub-ranks of parent communicator.

Definition at line 2695 of file UPstream.H.

References UPstream::freeCommunicator(), UPstream::newCommunicator(), and UPstream::parent().

Here is the call graph for this function:

◆ reset() [4/4]

void reset ( communicator && c)
inline

Take ownership, free managed communicator.

Definition at line 2704 of file UPstream.H.

References communicator(), and UPstream::freeCommunicator().

Here is the call graph for this function:

◆ swap()

void swap ( communicator & c)
inline

Swap communicator labels.

Definition at line 2715 of file UPstream.H.

References communicator().

Here is the call graph for this function:

◆ operator label()

operator label ( ) const
inlinenoexcept

Implicit cast to label - the same as comm().

Definition at line 2723 of file UPstream.H.

References Foam::noexcept.

◆ operator=() [2/2]

void operator= ( communicator && c)
inline

Move assignment, takes ownership.

Definition at line 2728 of file UPstream.H.

References communicator(), and reset().

Here is the call graph for this function:

◆ operator==()

bool operator== ( const communicator & c) const
inlinenoexcept

Test for equality.

Definition at line 2733 of file UPstream.H.

References communicator().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const communicator & c) const
inlinenoexcept

Test for inequality.

Definition at line 2741 of file UPstream.H.

References communicator().

Here is the call graph for this function:

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