multiWorldConnections Class Reference

Centralized handling of multi-world MPI connections. More...

Inheritance diagram for multiWorldConnections:
[legend]
Collaboration diagram for multiWorldConnections:
[legend]

Public Member Functions

 TypeName ("multiWorld")
 Run-time type information. More...
 
 multiWorldConnections (const Time &runTime)
 Construct. More...
 
 ~multiWorldConnections ()
 Destructor. More...
 
bool empty () const noexcept
 True if no world-to-world connections are defined. More...
 
label size () const noexcept
 Number of world-to-world connections defined. More...
 
void createComms ()
 
bool addConnectionById (const label otherWorld)
 Define a connection from myWorld to other world by ID. More...
 
bool addConnectionByName (const word &otherWorld)
 Define a connection from myWorld to other world by NAME. More...
 
label getCommById (const label otherWorld) const
 Get communicator for myWorld to other world connection by ID. More...
 
label getCommByName (const word &otherWorld) const
 Get communicator for myWorld to other world connection by NAME. More...
 
labelList comms () const
 Get communicators used for myWorld to other worlds in sorted order. More...
 
- Public Member Functions inherited from MeshObject< Time, TopologicalMeshObject, multiWorldConnections >
 MeshObject (const Time &mesh)
 Construct on Mesh type. More...
 
virtual ~MeshObject ()=default
 Destructor. More...
 
const Timemesh () const
 
virtual bool writeData (Ostream &os) const
 

Static Public Member Functions

static const multiWorldConnectionsNew (const Time &runTime)
 Access mesh object. More...
 
- Static Public Member Functions inherited from MeshObject< Time, TopologicalMeshObject, multiWorldConnections >
static const multiWorldConnectionsNew (const Time &mesh, Args &&... args)
 Get existing or create a new MeshObject. More...
 
static bool Delete (const Time &mesh)
 Static destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from MeshObject< Time, TopologicalMeshObject, multiWorldConnections >
const Timemesh_
 

Detailed Description

Centralized handling of multi-world MPI connections.

Note
This class may move to static only or a singleton in the future.
Source files

Definition at line 55 of file multiWorldConnectionsObject.H.

Constructor & Destructor Documentation

◆ multiWorldConnections()

multiWorldConnections ( const Time runTime)
explicit

Construct.

Definition at line 182 of file multiWorldConnectionsObject.C.

◆ ~multiWorldConnections()

Destructor.

Definition at line 199 of file multiWorldConnectionsObject.C.

Member Function Documentation

◆ TypeName()

TypeName ( "multiWorld"  )

Run-time type information.

◆ New()

const Foam::multiWorldConnections & New ( const Time runTime)
static

Access mesh object.

Definition at line 191 of file multiWorldConnectionsObject.C.

References runTime.

◆ empty()

bool empty ( ) const
noexcept

True if no world-to-world connections are defined.

Definition at line 205 of file multiWorldConnectionsObject.C.

◆ size()

Foam::label size ( ) const
noexcept

Number of world-to-world connections defined.

Definition at line 211 of file multiWorldConnectionsObject.C.

◆ createComms()

void createComms ( )

Create all communicators. Low-level, not normally called directly

Definition at line 217 of file multiWorldConnectionsObject.C.

References Pstream::combineGather(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, FixedList< T, N >::first(), forAllConstIters, Foam::Info, HashTable< T, Key, Hash >::insert(), UPstream::myWorldID(), UPstream::parRun(), Foam::printDOT(), Pstream::scatter(), HashTable< T, Key, Hash >::sortedToc(), UPstream::warnComm, and UPstream::worldComm.

Referenced by multiWorldConnections::comms(), multiWorldConnections::getCommById(), and multiWorldConnections::getCommByName().

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

◆ addConnectionById()

bool addConnectionById ( const label  otherWorld)

Define a connection from myWorld to other world by ID.

Definition at line 305 of file multiWorldConnectionsObject.C.

References UPstream::myWorld(), Foam::nl, Foam::Pout, and edge::valid().

Here is the call graph for this function:

◆ addConnectionByName()

bool addConnectionByName ( const word otherWorld)

Define a connection from myWorld to other world by NAME.

Definition at line 324 of file multiWorldConnectionsObject.C.

References UPstream::myWorld(), Foam::nl, Foam::Pout, and edge::valid().

Here is the call graph for this function:

◆ getCommById()

Foam::label getCommById ( const label  otherWorld) const

Get communicator for myWorld to other world connection by ID.

Uses cached value, or creates a new communicator

Definition at line 343 of file multiWorldConnectionsObject.C.

References multiWorldConnections::createComms(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, edge::valid(), and UPstream::worldComm.

Here is the call graph for this function:

◆ getCommByName()

Foam::label getCommByName ( const word otherWorld) const

Get communicator for myWorld to other world connection by NAME.

Uses cached value, or creates a new communicator

Definition at line 384 of file multiWorldConnectionsObject.C.

References multiWorldConnections::createComms(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, edge::valid(), and UPstream::worldComm.

Here is the call graph for this function:

◆ comms()

Foam::labelList comms ( ) const

Get communicators used for myWorld to other worlds in sorted order.

Returns
worldComm if no world-to-world communicators in use.

Definition at line 425 of file multiWorldConnectionsObject.C.

References multiWorldConnections::createComms(), UList< T >::empty(), forAllConstIters, List< T >::resize(), Foam::sort(), and UPstream::worldComm.

Here is the call graph for this function:

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