162 void send(
bool itemToSend);
168 void send(
double itemToSend);
180 void send(
int itemToSend);
199 void receive(
bool &itemToReceive);
202 void receive(
double &itemToReceive);
208 void receive(
int &itemToReceive);
270 return m2n->_useOnlyPrimaryCom;
This class provides a lightweight logger.
std::shared_ptr< DistributedComFactory > SharedPointer
void scatterAllCommunicationMap(std::map< int, std::vector< int > > &localCommunicationMap, mesh::Mesh &mesh)
Scatters a communication map over connected ranks on remote participant (concerning the given mesh)
void broadcastReceiveAll(std::vector< int > &itemToReceive, mesh::Mesh &mesh)
Receives an int per connected rank on remote participant (concerning the given mesh) @para[out] itemT...
bool _isPrimaryRankConnected
void closeDistributedConnections()
Disconnects all connections of the DistributedCommunication.
void createDistributedCommunication(const mesh::PtrMesh &mesh)
Creates a new distributes communication for that mesh, stores the pointer in _distComs.
void closePrimaryRankConnection()
Disconnects the primary connection.
std::map< int, DistributedCommunication::SharedPointer > _distComs
mesh::getID() -> Pointer to distributed communication
com::PtrCommunication _interComm
connection between the primary ranks of the connected participants
void acceptPrimaryRankConnection(const std::string &acceptorName, const std::string &requesterName, std::string_view configHash)
Connects to another participant, which has to call requestConnection().
void cleanupEstablishment(const std::string &acceptorName, const std::string &requesterName)
cleans-up to establish the connections
void gatherAllCommunicationMap(std::map< int, std::vector< int > > &localCommunicationMap, mesh::Mesh &mesh)
Gathers a communication maps from connected ranks on remote participant (concerning the given mesh)
void broadcastSendMesh(mesh::Mesh &mesh)
Broadcasts a mesh to connected ranks on remote participant (concerning the given mesh)
void closeConnection()
Disconnects from communication space, i.e. participant.
com::PtrCommunication getPrimaryRankCommunication()
Get the basic communication between the 2 primary ranks.
void checkRemoteInfo(std::string_view localParticipant, std::string_view remoteParticipant, std::string_view localConfigHash, std::string_view remoteInfo)
checks the info of the remote participant against the version and config hash of the local participan...
void acceptSecondaryRanksPreConnection(const std::string &acceptorName, const std::string &requesterName)
bool _useOnlyPrimaryCom
between two serial participants, only use the primary com and no secondary com
void acceptSecondaryRanksConnection(const std::string &acceptorName, const std::string &requesterName)
Connects to another participant, which has to call requestConnection().
void requestSecondaryRanksConnection(const std::string &acceptorName, const std::string &requesterName)
Connects to another participant, which has to call acceptConnection().
bool _areSecondaryRanksConnected
friend struct WhiteboxAccessor
void broadcastReceiveAllMesh(mesh::Mesh &mesh)
Receive mesh partitions per connected rank on remote participant (concerning the given mesh)
void requestSecondaryRanksPreConnection(const std::string &acceptorName, const std::string &requesterName)
DistributedComFactory::SharedPointer _distrFactory
M2N(com::PtrCommunication intraComm, DistributedComFactory::SharedPointer distrFactory, bool useOnlyPrimaryCom=false, bool useTwoLevelInit=false)
bool usesTwoLevelInitialization()
bool isConnected()
Returns true, if a connection to a remote participant has been setup.
void requestPrimaryRankConnection(const std::string &acceptorName, const std::string &requesterName, std::string_view configHash)
Connects to another participant, which has to call acceptConnection().
void broadcastSend(int itemToSend, mesh::Mesh &mesh)
Broadcasts an int to connected ranks on remote participant (concerning the given mesh)
void completeSecondaryRanksConnection()
bool _useTwoLevelInit
use the two-level initialization concept
void prepareEstablishment(const std::string &acceptorName, const std::string &requesterName)
prepares to establish the connections
void send(precice::span< double const > itemsToSend, int meshID, int valueDimension)
Sends an array of double values from all ranks (different for each rank).
void receive(precice::span< double > itemsToReceive, int meshID, int valueDimension)
Container and creator for meshes.
A C++ 11 implementation of the non-owning C++20 std::span type.
std::shared_ptr< Communication > PtrCommunication
contains the logic of the parallel communication between participants.
std::shared_ptr< M2N > PtrM2N
provides Mesh, Data and primitives.
std::shared_ptr< Mesh > PtrMesh
Main namespace of the precice library.
struct giving access _useOnlyPrimaryCom
static auto useOnlyPrimaryCom(PtrM2N m2n) -> typename std::add_lvalue_reference< decltype(m2n->_useOnlyPrimaryCom)>::type