preCICE v3.1.2
|
Implements DistributedCommunication by using a gathering/scattering methodology. Arrays of data are always gathered and scattered at the primary. No direct communication between secondary ranks is used. For more details see m2n/DistributedCommunication.hpp. More...
#include <GatherScatterCommunication.hpp>
Public Member Functions | |
GatherScatterCommunication (com::PtrCommunication com, mesh::PtrMesh mesh) | |
~GatherScatterCommunication () override | |
bool | isConnected () const override |
Returns true, if a connection to a remote participant has been setup. | |
void | acceptConnection (const std::string &acceptorName, const std::string &requesterName) override |
Accepts connection from participant, which has to call requestConnection(). | |
void | requestConnection (const std::string &acceptorName, const std::string &requesterName) override |
Requests connection from participant, which has to call acceptConnection(). | |
void | acceptPreConnection (std::string const &acceptorName, std::string const &requesterName) override |
void | requestPreConnection (std::string const &acceptorName, std::string const &requesterName) override |
void | completeSecondaryRanksConnection () override |
Completes the secondary connections for both acceptor and requester by updating the vertex list in _mappings. | |
void | closeConnection () override |
Disconnects from communication space, i.e. participant. | |
void | send (precice::span< double const > itemsToSend, int valueDimension) override |
Sends an array of double values from all ranks (different for each rank). | |
void | receive (precice::span< double > itemsToReceive, int valueDimension) override |
All ranks receive an array of doubles (different for each rank). | |
void | broadcastSend (int itemToSend) override |
Broadcasts an int to connected ranks on remote participant. Not available for GatherScatterCommunication. | |
void | broadcastReceiveAll (std::vector< int > &itemToReceive) override |
Receives an int per connected rank on remote participant. Not available for GatherScatterCommunication. @para[out] itemToReceive received ints from remote ranks are stored with the sender rank order. | |
void | broadcastSendMesh () override |
Broadcasts a mesh to connected ranks on remote participant. Not available for GatherScatterCommunication. | |
void | broadcastReceiveAllMesh () override |
Receive mesh partitions per connected rank on remote participant. Not available for GatherScatterCommunication. | |
void | scatterAllCommunicationMap (CommunicationMap &localCommunicationMap) override |
Scatters a communication map over connected ranks on remote participant. Not available for GatherScatterCommunication. | |
void | gatherAllCommunicationMap (CommunicationMap &localCommunicationMap) override |
Gathers a communication maps from connected ranks on remote participant. Not available for GatherScatterCommunication. | |
Public Member Functions inherited from precice::m2n::DistributedCommunication | |
DistributedCommunication (mesh::PtrMesh mesh) | |
virtual | ~DistributedCommunication () |
Destructor, empty. | |
Private Attributes | |
logging::Logger | _log {"m2n::GatherScatterCommunication"} |
com::PtrCommunication | _com |
primary to primary basic communication | |
bool | _isConnected |
Global communication is set up or not. | |
Additional Inherited Members | |
Public Types inherited from precice::m2n::DistributedCommunication | |
using | SharedPointer = std::shared_ptr<DistributedCommunication> |
using | CommunicationMap = std::map<int, std::vector<int>> |
Protected Attributes inherited from precice::m2n::DistributedCommunication | |
mesh::PtrMesh | _mesh |
mesh that dictates the distribution of this mapping | |
Implements DistributedCommunication by using a gathering/scattering methodology. Arrays of data are always gathered and scattered at the primary. No direct communication between secondary ranks is used. For more details see m2n/DistributedCommunication.hpp.
Definition at line 20 of file GatherScatterCommunication.hpp.
precice::m2n::GatherScatterCommunication::GatherScatterCommunication | ( | com::PtrCommunication | com, |
mesh::PtrMesh | mesh ) |
Definition at line 19 of file GatherScatterCommunication.cpp.
|
override |
Definition at line 28 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Accepts connection from participant, which has to call requestConnection().
If several connections are going in to a server, the server has to call this method, while the clients have to call requestConnection().
[in] | acceptorName | Name of calling participant. |
[in] | requesterName | Name of remote participant to connect to. |
Implements precice::m2n::DistributedCommunication.
Definition at line 40 of file GatherScatterCommunication.cpp.
|
overridevirtual |
This method has not been implemented yet.
Implements precice::m2n::DistributedCommunication.
Definition at line 209 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Receives an int per connected rank on remote participant. Not available for GatherScatterCommunication. @para[out] itemToReceive received ints from remote ranks are stored with the sender rank order.
Implements precice::m2n::DistributedCommunication.
Definition at line 228 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Receive mesh partitions per connected rank on remote participant. Not available for GatherScatterCommunication.
Implements precice::m2n::DistributedCommunication.
Definition at line 238 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Broadcasts an int to connected ranks on remote participant. Not available for GatherScatterCommunication.
Implements precice::m2n::DistributedCommunication.
Definition at line 223 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Broadcasts a mesh to connected ranks on remote participant. Not available for GatherScatterCommunication.
Implements precice::m2n::DistributedCommunication.
Definition at line 233 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Disconnects from communication space, i.e. participant.
This method is called on destruction.
Implements precice::m2n::DistributedCommunication.
Definition at line 58 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Completes the secondary connections for both acceptor and requester by updating the vertex list in _mappings.
Implements precice::m2n::DistributedCommunication.
Definition at line 253 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Gathers a communication maps from connected ranks on remote participant. Not available for GatherScatterCommunication.
Implements precice::m2n::DistributedCommunication.
Definition at line 248 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Returns true, if a connection to a remote participant has been setup.
Implements precice::m2n::DistributedCommunication.
Definition at line 35 of file GatherScatterCommunication.cpp.
|
overridevirtual |
All ranks receive an array of doubles (different for each rank).
Implements precice::m2n::DistributedCommunication.
Definition at line 152 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Requests connection from participant, which has to call acceptConnection().
If several connections are going in to a server, the clients have to call this method, while the server has to call acceptConnection().
[in] | acceptorName | Name of remote participant to connect to. |
[in] | nameReuester | Name of calling participant. |
Implements precice::m2n::DistributedCommunication.
Definition at line 49 of file GatherScatterCommunication.cpp.
|
overridevirtual |
This method has not been implemented yet.
Implements precice::m2n::DistributedCommunication.
Definition at line 216 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Scatters a communication map over connected ranks on remote participant. Not available for GatherScatterCommunication.
Implements precice::m2n::DistributedCommunication.
Definition at line 243 of file GatherScatterCommunication.cpp.
|
overridevirtual |
Sends an array of double values from all ranks (different for each rank).
Implements precice::m2n::DistributedCommunication.
Definition at line 100 of file GatherScatterCommunication.cpp.
|
private |
primary to primary basic communication
Definition at line 115 of file GatherScatterCommunication.hpp.
|
private |
Global communication is set up or not.
Definition at line 118 of file GatherScatterCommunication.hpp.
|
private |
Definition at line 112 of file GatherScatterCommunication.hpp.