22 : _intraComm(
std::move(intraComm)),
23 _distrFactory(
std::move(distrFactory)),
24 _useOnlyPrimaryCom(useOnlyPrimaryCom),
25 _useTwoLevelInit(useTwoLevelInit)
70 _intraComm->requestConnection(acceptorName, requesterName,
"PRIMARYCOM", 0, 1);
88 pair.second->acceptConnection(acceptorName, requesterName);
105 pair.second->requestConnection(acceptorName, requesterName);
115 _intraComm->prepareEstablishment(acceptorName, requesterName);
122 _intraComm->cleanupEstablishment(acceptorName, requesterName);
133 pair.second->acceptPreConnection(acceptorName, requesterName);
147 pair.second->requestPreConnection(acceptorName, requesterName);
157 pair.second->completeSecondaryRanksConnection();
189 pair.second->closeConnection();
227 _distComs[meshID]->send(itemsToSend, valueDimension);
270 "This method can only be used for parallel participants");
281 "This method can only be used for parallel participants");
284 _distComs[meshID]->scatterAllCommunicationMap(localCommunicationMap);
290 "This method can only be used for parallel participants");
293 _distComs[meshID]->broadcastSend(itemToSend);
317 _distComs[meshID]->receive(itemsToReceive, valueDimension);
373 "This method can only be used for parallel participants");
376 _distComs[meshID]->broadcastReceiveAll(itemToReceive);
382 "This method can only be used for parallel participants");
387 _distComs[meshID]->broadcastReceiveAllMesh();
393 "This method can only be used for parallel participants");
396 _distComs[meshID]->gatherAllCommunicationMap(localCommunicationMap);
#define PRECICE_DEBUG(...)
#define PRECICE_TRACE(...)
#define PRECICE_ASSERT(...)
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 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()
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.
MeshID getID() const
Returns the base ID of the mesh.
A C++ 11 implementation of the non-owning C++20 std::span type.
constexpr size_type size() const noexcept
static Rank getRank()
Current rank.
static void broadcast(bool &value)
static bool isParallel()
True if this process is running in parallel.
static bool isSecondary()
True if this process is running a secondary rank.
static constexpr FundamentalTag Fundamental
Convenience instance of the FundamentalTag.
static constexpr SynchronizeTag Synchronize
Convenience instance of the SynchronizeTag.
Main namespace of the precice library.
constexpr auto get(span< E, S > s) -> decltype(s[N])
bool syncMode
Enabled further inter- and intra-solver synchronisation.