Centralized handling of multi-world MPI connections. More...
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 Time & | mesh () const |
virtual bool | writeData (Ostream &os) const |
Static Public Member Functions | |
static const multiWorldConnections & | New (const Time &runTime) |
Access mesh object. More... | |
Static Public Member Functions inherited from MeshObject< Time, TopologicalMeshObject, multiWorldConnections > | |
static const multiWorldConnections & | New (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 Time & | mesh_ |
Centralized handling of multi-world MPI connections.
Definition at line 55 of file multiWorldConnectionsObject.H.
|
explicit |
Construct.
Definition at line 182 of file multiWorldConnectionsObject.C.
Destructor.
Definition at line 199 of file multiWorldConnectionsObject.C.
TypeName | ( | "multiWorld" | ) |
Run-time type information.
|
static |
Access mesh object.
Definition at line 191 of file multiWorldConnectionsObject.C.
References runTime.
|
noexcept |
True if no world-to-world connections are defined.
Definition at line 205 of file multiWorldConnectionsObject.C.
|
noexcept |
Number of world-to-world connections defined.
Definition at line 211 of file multiWorldConnectionsObject.C.
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().
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().
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().
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.
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.
Foam::labelList comms | ( | ) | const |
Get communicators used for myWorld to other worlds in sorted order.
Definition at line 425 of file multiWorldConnectionsObject.C.
References multiWorldConnections::createComms(), UList< T >::empty(), forAllConstIters, List< T >::resize(), Foam::sort(), and UPstream::worldComm.