UPstream::communicator Class Reference

Wrapper class for allocating/freeing communicators. Always invokes allocateCommunicatorComponents() and freeCommunicatorComponents() More...

Public Member Functions

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

Detailed Description

Wrapper class for allocating/freeing communicators. Always invokes allocateCommunicatorComponents() and freeCommunicatorComponents()

Definition at line 566 of file UPstream.H.

Constructor & Destructor Documentation

◆ communicator() [1/5]

communicator ( const communicator )
delete

No copy construct.

◆ communicator() [2/5]

communicator ( )
inlinenoexcept

Default construct (a placeholder communicator)

Definition at line 585 of file UPstream.H.

◆ communicator() [3/5]

communicator ( communicator &&  c)
inline

Move construct, takes ownership.

Definition at line 590 of file UPstream.H.

References Foam::constant::universal::c.

◆ 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 596 of file UPstream.H.

◆ 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 611 of file UPstream.H.

◆ ~communicator()

~communicator ( )
inline

Free allocated communicator.

Definition at line 625 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.

◆ good()

bool good ( ) const
inlinenoexcept

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

Definition at line 630 of file UPstream.H.

◆ comm()

label comm ( ) const
inlinenoexcept

The communicator label.

Definition at line 635 of file UPstream.H.

Referenced by globalMeshData::updateMesh().

Here is the caller 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 642 of file UPstream.H.

References Foam::constant::universal::c.

◆ reset() [1/4]

void reset ( )
inline

Free allocated communicator.

Definition at line 647 of file UPstream.H.

References UPstream::freeCommunicator().

Referenced by UPstream::communicator::operator=().

Here is the call graph for this function:
Here is the caller 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 652 of file UPstream.H.

References UPstream::allocateCommunicator(), UPstream::freeCommunicator(), 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 661 of file UPstream.H.

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

Here is the call graph for this function:

◆ reset() [4/4]

void reset ( communicator &&  c)
inline

Take ownership, free allocated communicator.

do not call as self-assignment

Definition at line 672 of file UPstream.H.

References Foam::constant::universal::c, and UPstream::freeCommunicator().

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( communicator &&  c)
inline

Move assignment, takes ownership.

do not call as self-assignment

Definition at line 684 of file UPstream.H.

References Foam::constant::universal::c, and UPstream::communicator::reset().

Here is the call graph for this function:

◆ operator label()

operator label ( ) const
inlinenoexcept

Cast to label - the same as comm()

Definition at line 689 of file UPstream.H.


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