preCICE v3.1.2
|
Interface for all distributed solver to solver communication classes. More...
#include <DistributedCommunication.hpp>
Public Types | |
using | SharedPointer = std::shared_ptr<DistributedCommunication> |
using | CommunicationMap = std::map<int, std::vector<int>> |
Public Member Functions | |
DistributedCommunication (mesh::PtrMesh mesh) | |
virtual | ~DistributedCommunication () |
Destructor, empty. | |
virtual bool | isConnected () const =0 |
Returns true, if a connection to a remote participant has been setup. | |
virtual void | acceptConnection (const std::string &acceptorName, const std::string &requesterName)=0 |
Connects to another participant, which has to call requestConnection(). | |
virtual void | requestConnection (const std::string &acceptorName, const std::string &requesterName)=0 |
Connects to another participant, which has to call acceptConnection(). | |
virtual void | acceptPreConnection (std::string const &acceptorName, std::string const &requesterName)=0 |
Connects to another participant, which has to call requestPreConnection(). Exchanged vertex list is not included, only connection between ranks is established. | |
virtual void | requestPreConnection (std::string const &acceptorName, std::string const &requesterName)=0 |
Connects to another participant, which has to call acceptPreConnection(). Exchanged vertex list is not included, only connection between ranks is established. | |
virtual void | completeSecondaryRanksConnection ()=0 |
virtual void | closeConnection ()=0 |
Disconnects from communication space, i.e. participant. | |
virtual void | send (precice::span< double const > itemsToSend, int valueDimension)=0 |
Sends an array of double values from all ranks (different for each rank). | |
virtual void | receive (precice::span< double > itemsToReceive, int valueDimension)=0 |
All ranks receive an array of doubles (different for each rank). | |
virtual void | broadcastSend (int itemToSend)=0 |
Broadcasts an int to connected ranks on remote participant. | |
virtual void | broadcastReceiveAll (std::vector< int > &itemToReceive)=0 |
Receives an int per connected rank on remote participant @para[out] itemToReceive received ints from remote ranks are stored with the sender rank order. | |
virtual void | broadcastSendMesh ()=0 |
Broadcasts a mesh to connected ranks on remote participant. | |
virtual void | broadcastReceiveAllMesh ()=0 |
Receive mesh partitions per connected rank on remote participant. | |
virtual void | scatterAllCommunicationMap (CommunicationMap &localCommunicationMap)=0 |
Scatters a communication map over connected ranks on remote participant. | |
virtual void | gatherAllCommunicationMap (CommunicationMap &localCommunicationMap)=0 |
Gathers a communication maps from connected ranks on remote participant. | |
Protected Attributes | |
mesh::PtrMesh | _mesh |
mesh that dictates the distribution of this mapping | |
Interface for all distributed solver to solver communication classes.
By default, communication is done within the local communication space. In order to connect to a different communication space, i.e. coupling participant, the methods acceptConnection() and requestConnection() have to called by the two participants which intend to establish a connection. All following communication and process ranking refers to the remote communication space afterwards.
This interface organizes the communication between 2 distributed participants. The core communication (e.g. Sockets or MPI) is still handled in com/Communication.hpp . The information on how the mesh is distributed can be accessed through the member variable _mesh.
The class offers methods to communicate between all processors. This can either mean that data is communicated in a distributed way, in case of arrays, or that single values are broadcasted.
Definition at line 33 of file DistributedCommunication.hpp.
using precice::m2n::DistributedCommunication::CommunicationMap = std::map<int, std::vector<int>> |
Definition at line 117 of file DistributedCommunication.hpp.
using precice::m2n::DistributedCommunication::SharedPointer = std::shared_ptr<DistributedCommunication> |
Definition at line 35 of file DistributedCommunication.hpp.
|
inlineexplicit |
Definition at line 37 of file DistributedCommunication.hpp.
|
inlinevirtual |
Destructor, empty.
Definition at line 43 of file DistributedCommunication.hpp.
|
pure virtual |
Connects to another participant, which has to call requestConnection().
[in] | acceptorName | Name of calling participant. |
[in] | requesterName | Name of remote participant to connect to. |
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Connects to another participant, which has to call requestPreConnection(). Exchanged vertex list is not included, only connection between ranks is established.
[in] | acceptorName | Name of calling participant. |
[in] | requesterName | Name of remote participant to connect to. |
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Receives an int per connected rank on remote participant @para[out] itemToReceive received ints from remote ranks are stored with the sender rank order.
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Receive mesh partitions per connected rank on remote participant.
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Broadcasts an int to connected ranks on remote participant.
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Broadcasts a mesh to connected ranks on remote participant.
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Disconnects from communication space, i.e. participant.
This method is called on destruction.
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Gathers a communication maps from connected ranks on remote participant.
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Returns true, if a connection to a remote participant has been setup.
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
All ranks receive an array of doubles (different for each rank).
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Connects to another participant, which has to call acceptConnection().
[in] | acceptorName | Name of remote participant to connect to. |
[in] | requesterName | Name of calling participant. |
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Connects to another participant, which has to call acceptPreConnection(). Exchanged vertex list is not included, only connection between ranks is established.
[in] | acceptorName | Name of remote participant to connect to. |
[in] | requesterName | Name of calling participant. |
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Scatters a communication map over connected ranks on remote participant.
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
pure virtual |
Sends an array of double values from all ranks (different for each rank).
Implemented in precice::m2n::GatherScatterCommunication, and precice::m2n::PointToPointCommunication.
|
protected |
mesh that dictates the distribution of this mapping
Definition at line 146 of file DistributedCommunication.hpp.