23struct WhiteboxAccessor;
158 void send(
bool itemToSend);
164 void send(
double itemToSend);
176 void send(
int itemToSend);
195 void receive(
bool &itemToReceive);
198 void receive(
double &itemToReceive);
204 void receive(
int &itemToReceive);
259 return m2n->_useOnlyPrimaryCom;
This class provides a lightweight logger.
M2N communication class. This layer is necessary since communication between two participants can be ...
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)
com::PtrCommunication _intraComm
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
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.
void requestPrimaryRankConnection(const std::string &acceptorName, const std::string &requesterName)
Connects to another participant, which has to call acceptConnection().
com::PtrCommunication getPrimaryRankCommunication()
Get the basic communication between the 2 primary ranks.
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
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 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)
void acceptPrimaryRankConnection(const std::string &acceptorName, const std::string &requesterName)
Connects to another participant, which has to call requestConnection().
Container and creator for meshes.
A C++ 11 implementation of the non-owning C++20 std::span type.
Main namespace of the precice library.
struct giving access _useOnlyPrimaryCom
static auto useOnlyPrimaryCom(PtrM2N m2n) -> typename std::add_lvalue_reference< decltype(m2n->_useOnlyPrimaryCom)>::type