preCICE v3.1.1
Loading...
Searching...
No Matches
GatherScatterCommunication.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <stddef.h>
4#include <string>
5#include <vector>
8#include "logging/Logger.hpp"
10
11namespace precice {
12namespace m2n {
13
21public:
24 mesh::PtrMesh mesh);
25
27
31 bool isConnected() const override;
32
43 const std::string &acceptorName,
44 const std::string &requesterName) override;
45
56 const std::string &acceptorName,
57 const std::string &requesterName) override;
63 std::string const &acceptorName,
64 std::string const &requesterName) override;
65
71 std::string const &acceptorName,
72 std::string const &requesterName) override;
73
76
82 void closeConnection() override;
83
85 void send(precice::span<double const> itemsToSend, int valueDimension) override;
86
88 void receive(precice::span<double> itemsToReceive, int valueDimension) override;
89
91 void broadcastSend(int itemToSend) override;
92
97 void broadcastReceiveAll(std::vector<int> &itemToReceive) override;
98
100 void broadcastSendMesh() override;
101
103 void broadcastReceiveAllMesh() override;
104
106 void scatterAllCommunicationMap(CommunicationMap &localCommunicationMap) override;
107
109 void gatherAllCommunicationMap(CommunicationMap &localCommunicationMap) override;
110
111private:
112 logging::Logger _log{"m2n::GatherScatterCommunication"};
113
116
119};
120
121} // namespace m2n
122} // namespace precice
This class provides a lightweight logger.
Definition Logger.hpp:16
Interface for all distributed solver to solver communication classes.
Implements DistributedCommunication by using a gathering/scattering methodology. Arrays of data are a...
com::PtrCommunication _com
primary to primary basic communication
bool isConnected() const override
Returns true, if a connection to a remote participant has been setup.
void broadcastReceiveAllMesh() override
Receive mesh partitions per connected rank on remote participant. Not available for GatherScatterComm...
void acceptConnection(const std::string &acceptorName, const std::string &requesterName) override
Accepts connection from participant, which has to call requestConnection().
GatherScatterCommunication(com::PtrCommunication com, mesh::PtrMesh mesh)
void broadcastSendMesh() override
Broadcasts a mesh to connected ranks on remote participant. Not available for GatherScatterCommunicat...
void broadcastReceiveAll(std::vector< int > &itemToReceive) override
Receives an int per connected rank on remote participant. Not available for GatherScatterCommunicatio...
void completeSecondaryRanksConnection() override
Completes the secondary connections for both acceptor and requester by updating the vertex list in _m...
void closeConnection() override
Disconnects from communication space, i.e. participant.
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 GatherScatterCommunicat...
void scatterAllCommunicationMap(CommunicationMap &localCommunicationMap) override
Scatters a communication map over connected ranks on remote participant. Not available for GatherScat...
void acceptPreConnection(std::string const &acceptorName, std::string const &requesterName) override
void requestConnection(const std::string &acceptorName, const std::string &requesterName) override
Requests connection from participant, which has to call acceptConnection().
void requestPreConnection(std::string const &acceptorName, std::string const &requesterName) override
void send(precice::span< double const > itemsToSend, int valueDimension) override
Sends an array of double values from all ranks (different for each rank).
bool _isConnected
Global communication is set up or not.
void gatherAllCommunicationMap(CommunicationMap &localCommunicationMap) override
Gathers a communication maps from connected ranks on remote participant. Not available for GatherScat...
A C++ 11 implementation of the non-owning C++20 std::span type.
Definition span.hpp:284
Main namespace of the precice library.