preCICE v3.2.0
|
Point-to-point communication implementation of DistributedCommunication. More...
#include <PointToPointCommunication.hpp>
Classes | |
struct | ConnectionData |
this data structure is used to store m2n communication information for the 1 step of bounding box initialization. It stores: More... | |
struct | Mapping |
Defines mapping between: More... |
Public Member Functions | |
PointToPointCommunication (com::PtrCommunicationFactory communicationFactory, mesh::PtrMesh mesh) | |
~PointToPointCommunication () override | |
bool | isConnected () const override |
Returns true, if a connection to a remote participant has been established. | |
void | acceptConnection (std::string const &acceptorName, std::string const &requesterName) override |
Accepts connection from participant, which has to call requestConnection(). | |
void | requestConnection (std::string const &acceptorName, std::string const &requesterName) override |
Requests connection from participant, which has to call acceptConnection(). | |
void | acceptPreConnection (std::string const &acceptorName, std::string const &requesterName) override |
Accepts connection from participant, which has to call requestPreConnection(). Only initial connection is created. | |
void | requestPreConnection (std::string const &acceptorName, std::string const &requesterName) override |
Requests connection from participant, which has to call acceptConnection(). Only initial connection is created. | |
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=1) override |
Sends a subset of local double values corresponding to local indices deduced from the current and remote vertex distributions. | |
void | receive (precice::span< double > itemsToReceive, int valueDimension=1) override |
Receives a subset of local double values corresponding to local indices deduced from the current and remote vertex distributions. | |
void | broadcastSend (int itemToSend) override |
Broadcasts an int to connected ranks on remote participant. | |
void | broadcastReceiveAll (std::vector< int > &itemToReceive) override |
Receives an int per connected rank on remote participant @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. | |
void | broadcastReceiveAllMesh () override |
Receive mesh partitions per connected rank on remote participant. | |
void | scatterAllCommunicationMap (CommunicationMap &localCommunicationMap) override |
Scatters a communication map over connected ranks on remote participant. | |
void | gatherAllCommunicationMap (CommunicationMap &localCommunicationMap) override |
Gathers a communication maps from connected ranks on remote participant. | |
Public Member Functions inherited from precice::m2n::DistributedCommunication | |
DistributedCommunication (mesh::PtrMesh mesh) | |
virtual | ~DistributedCommunication ()=default |
Destructor, empty. |
Private Member Functions | |
void | checkBufferedRequests (bool blocking) |
Checks all stored requests for completion and removes associated buffers. |
Private Attributes | |
logging::Logger | _log {"m2n::PointToPointCommunication"} |
com::PtrCommunicationFactory | _communicationFactory |
com::PtrCommunication | _communication |
Communication class used for this PointToPointCommunication. | |
std::vector< Mapping > | _mappings |
Local (for process rank in the current participant) vector of mappings (one to service each point-to-point connection). | |
std::vector< ConnectionData > | _connectionDataVector |
Local (for process rank in the current participant) vector of ConnectionData (one to service each point-to-point connection). | |
bool | _isConnected = false |
std::list< std::pair< std::shared_ptr< com::Request >, std::shared_ptr< std::vector< double > > > > | bufferedRequests |
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 |
Point-to-point communication implementation of DistributedCommunication.
Direct communication of local data subsets is performed between processes of coupled participants. The two supported implementations of direct communication are SocketCommunication and MPIPortsCommunication which can be supplied via their corresponding instantiation factories SocketCommunicationFactory and MPIPortsCommunicationFactory.
For the detailed implementation documentation refer to PointToPointCommunication.cpp.
Definition at line 32 of file PointToPointCommunication.hpp.
precice::m2n::PointToPointCommunication::PointToPointCommunication | ( | com::PtrCommunicationFactory | communicationFactory, |
mesh::PtrMesh | mesh ) |
Definition at line 308 of file PointToPointCommunication.cpp.
|
override |
Definition at line 316 of file PointToPointCommunication.cpp.
|
overridevirtual |
Accepts connection from participant, which has 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 327 of file PointToPointCommunication.cpp.
|
overridevirtual |
Accepts connection from participant, which has to call requestPreConnection(). Only initial connection is created.
[in] | acceptorName | Name of calling participant. |
[in] | requesterName | Name of remote participant to connect to. |
Implements precice::m2n::DistributedCommunication.
Definition at line 423 of file PointToPointCommunication.cpp.
|
overridevirtual |
Receives an int per connected rank on remote participant @para[out] itemToReceive received ints from remote ranks are stored with the sender rank order.
Implements precice::m2n::DistributedCommunication.
Definition at line 664 of file PointToPointCommunication.cpp.
|
overridevirtual |
Receive mesh partitions per connected rank on remote participant.
Implements precice::m2n::DistributedCommunication.
Definition at line 681 of file PointToPointCommunication.cpp.
|
overridevirtual |
Broadcasts an int to connected ranks on remote participant.
Implements precice::m2n::DistributedCommunication.
Definition at line 657 of file PointToPointCommunication.cpp.
|
overridevirtual |
Broadcasts a mesh to connected ranks on remote participant.
Implements precice::m2n::DistributedCommunication.
Definition at line 674 of file PointToPointCommunication.cpp.
|
private |
Checks all stored requests for completion and removes associated buffers.
[in] | blocking | False means that the function returns, even when there are requests left. |
Definition at line 702 of file PointToPointCommunication.cpp.
|
overridevirtual |
Disconnects from communication space, i.e. participant.
This method is called on destruction.
Implements precice::m2n::DistributedCommunication.
Definition at line 595 of file PointToPointCommunication.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 586 of file PointToPointCommunication.cpp.
|
overridevirtual |
Gathers a communication maps from connected ranks on remote participant.
Implements precice::m2n::DistributedCommunication.
Definition at line 695 of file PointToPointCommunication.cpp.
|
overridevirtual |
Returns true, if a connection to a remote participant has been established.
Implements precice::m2n::DistributedCommunication.
Definition at line 322 of file PointToPointCommunication.cpp.
|
overridevirtual |
Receives a subset of local double values corresponding to local indices deduced from the current and remote vertex distributions.
Implements precice::m2n::DistributedCommunication.
Definition at line 631 of file PointToPointCommunication.cpp.
|
overridevirtual |
Requests connection from participant, which has to call acceptConnection().
[in] | acceptorName | Name of remote participant to connect to. |
[in] | requesterName | Name of calling participant. |
Implements precice::m2n::DistributedCommunication.
Definition at line 454 of file PointToPointCommunication.cpp.
|
overridevirtual |
Requests connection from participant, which has to call acceptConnection(). Only initial connection is created.
[in] | acceptorName | Name of remote participant to connect to. |
[in] | requesterName | Name of calling participant. |
Implements precice::m2n::DistributedCommunication.
Definition at line 556 of file PointToPointCommunication.cpp.
|
overridevirtual |
Scatters a communication map over connected ranks on remote participant.
Implements precice::m2n::DistributedCommunication.
Definition at line 688 of file PointToPointCommunication.cpp.
|
overridevirtual |
Sends a subset of local double values corresponding to local indices deduced from the current and remote vertex distributions.
Implements precice::m2n::DistributedCommunication.
Definition at line 610 of file PointToPointCommunication.cpp.
|
private |
Communication class used for this PointToPointCommunication.
A Communication object represents all connections to all ranks made by this P2P instance.
Definition at line 140 of file PointToPointCommunication.hpp.
|
private |
Definition at line 134 of file PointToPointCommunication.hpp.
|
private |
Local (for process rank in the current participant) vector of ConnectionData (one to service each point-to-point connection).
Definition at line 180 of file PointToPointCommunication.hpp.
|
private |
Definition at line 182 of file PointToPointCommunication.hpp.
|
private |
Definition at line 126 of file PointToPointCommunication.hpp.
|
private |
Local (for process rank in the current participant) vector of mappings (one to service each point-to-point connection).
Definition at line 162 of file PointToPointCommunication.hpp.
|
private |
Definition at line 186 of file PointToPointCommunication.hpp.