preCICE
Loading...
Searching...
No Matches
precice::com::MPICommunication Class Referenceabstract

Provides implementation for basic MPI point-to-point communication. More...

#include <MPICommunication.hpp>

Inheritance diagram for precice::com::MPICommunication:
[legend]
Collaboration diagram for precice::com::MPICommunication:
[legend]

Public Member Functions

 MPICommunication ()
 ~MPICommunication () override=default
 Destructor, empty.
void send (std::string const &itemToSend, Rank rankReceiver) override
 Sends a std::string to process with given rank.
void send (precice::span< const int > itemsToSend, Rank rankReceiver) override
 Sends an array of integer values.
PtrRequest aSend (precice::span< const int > itemsToSend, Rank rankReceiver) override
 Asynchronously sends an array of integer values.
void send (precice::span< const double > itemsToSend, Rank rankReceiver) override
 Sends an array of double values.
PtrRequest aSend (precice::span< const double > itemsToSend, Rank rankReceiver) override
 Asynchronously sends an array of double values.
void send (double itemToSend, Rank rankReceiver) override
 Sends a double to process with given rank.
PtrRequest aSend (const double &itemToSend, Rank rankReceiver) override
 Asynchronously sends a double to process with given rank.
void send (int itemToSend, Rank rankReceiver) override
 Sends an int to process with given rank.
PtrRequest aSend (const int &itemToSend, Rank rankReceiver) override
 Asynchronously sends an int to process with given rank.
void send (bool itemToSend, Rank rankReceiver) override
 Sends a bool to process with given rank.
PtrRequest aSend (const bool &itemToSend, Rank rankReceiver) override
 Asynchronously sends a bool to process with given rank.
void receive (std::string &itemToReceive, Rank rankSender) override
 Receives a std::string from process with given rank.
void receive (precice::span< int > itemsToReceive, Rank rankSender) override
 Receives an array of integer values.
void receive (precice::span< double > itemsToReceive, Rank rankSender) override
 Receives an array of double values.
PtrRequest aReceive (precice::span< double > itemsToReceive, int rankSender) override
 Asynchronously receives an array of double values.
void receive (double &itemToReceive, Rank rankSender) override
 Receives a double from process with given rank.
PtrRequest aReceive (double &itemToReceive, Rank rankSender) override
 Asynchronously receives a double from process with given rank.
void receive (int &itemToReceive, Rank rankSender) override
 Receives an int from process with given rank.
PtrRequest aReceive (int &itemToReceive, Rank rankSender) override
 Asynchronously receives an int from process with given rank.
void receive (bool &itemToReceive, Rank rankSender) override
 Receives a bool from process with given rank.
PtrRequest aReceive (bool &itemToReceive, Rank rankSender) override
 Asynchronously receives a bool from process with given rank.

Protected Member Functions

virtual MPI_Commcommunicator (Rank rank)=0
 Returns the communicator.
virtual Rank rank (int rank)=0

Private Attributes

logging::Logger _log {"com::MPICommunication"}

Detailed Description

Provides implementation for basic MPI point-to-point communication.

The methods for establishing a connection between two coupling participants are not implemented and left to subclasses.

Definition at line 20 of file MPICommunication.hpp.

Constructor & Destructor Documentation

◆ MPICommunication()

precice::com::MPICommunication::MPICommunication ( )
default

◆ ~MPICommunication()

precice::com::MPICommunication::~MPICommunication ( )
overridedefault

Destructor, empty.

Member Function Documentation

◆ aReceive() [1/4]

PtrRequest precice::com::MPICommunication::aReceive ( bool & itemToReceive,
Rank rankSender )
override

Asynchronously receives a bool from process with given rank.

Definition at line 315 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ aReceive() [2/4]

PtrRequest precice::com::MPICommunication::aReceive ( double & itemToReceive,
Rank rankSender )
override

Asynchronously receives a double from process with given rank.

Definition at line 261 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ aReceive() [3/4]

PtrRequest precice::com::MPICommunication::aReceive ( int & itemToReceive,
Rank rankSender )
override

Asynchronously receives an int from process with given rank.

Definition at line 282 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ aReceive() [4/4]

PtrRequest precice::com::MPICommunication::aReceive ( precice::span< double > itemsToReceive,
int rankSender )
override

Asynchronously receives an array of double values.

Definition at line 228 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ aSend() [1/5]

PtrRequest precice::com::MPICommunication::aSend ( const bool & itemToSend,
Rank rankReceiver )
override

Asynchronously sends a bool to process with given rank.

Definition at line 161 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ aSend() [2/5]

PtrRequest precice::com::MPICommunication::aSend ( const double & itemToSend,
Rank rankReceiver )
override

Asynchronously sends a double to process with given rank.

Definition at line 127 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ aSend() [3/5]

PtrRequest precice::com::MPICommunication::aSend ( const int & itemToSend,
Rank rankReceiver )
override

Asynchronously sends an int to process with given rank.

Definition at line 144 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ aSend() [4/5]

PtrRequest precice::com::MPICommunication::aSend ( precice::span< const double > itemsToSend,
Rank rankReceiver )
override

Asynchronously sends an array of double values.

Definition at line 98 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ aSend() [5/5]

PtrRequest precice::com::MPICommunication::aSend ( precice::span< const int > itemsToSend,
Rank rankReceiver )
override

Asynchronously sends an array of integer values.

Definition at line 69 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ communicator()

virtual MPI_Comm & precice::com::MPICommunication::communicator ( Rank rank)
protectedpure virtual

Returns the communicator.

Implemented in MPIDirectCommunication, precice::com::MPIDirectCommunication, precice::com::MPIPortsCommunication, and precice::com::MPISinglePortsCommunication.

Here is the call graph for this function:

◆ rank()

virtual Rank precice::com::MPICommunication::rank ( int rank)
protectedpure virtual

Implemented in MPIDirectCommunication, precice::com::MPIDirectCommunication, precice::com::MPIPortsCommunication, and precice::com::MPISinglePortsCommunication.

Here is the call graph for this function:

◆ receive() [1/6]

void precice::com::MPICommunication::receive ( bool & itemToReceive,
Rank rankSender )
override

Receives a bool from process with given rank.

Default MPI point-to-point communication is used.

Definition at line 299 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ receive() [2/6]

void precice::com::MPICommunication::receive ( double & itemToReceive,
Rank rankSender )
override

Receives a double from process with given rank.

Default MPI point-to-point communication is used.

Definition at line 245 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ receive() [3/6]

void precice::com::MPICommunication::receive ( int & itemToReceive,
Rank rankSender )
override

Receives an int from process with given rank.

Default MPI point-to-point communication is used.

Definition at line 266 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ receive() [4/6]

void precice::com::MPICommunication::receive ( precice::span< double > itemsToReceive,
Rank rankSender )
override

Receives an array of double values.

Definition at line 213 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ receive() [5/6]

void precice::com::MPICommunication::receive ( precice::span< int > itemsToReceive,
Rank rankSender )
override

Receives an array of integer values.

Definition at line 198 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ receive() [6/6]

void precice::com::MPICommunication::receive ( std::string & itemToReceive,
Rank rankSender )
override

Receives a std::string from process with given rank.

Default MPI point-to-point communication is used.

Definition at line 178 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ send() [1/6]

void precice::com::MPICommunication::send ( bool itemToSend,
Rank rankReceiver )
override

Sends a bool to process with given rank.

Default MPI point-to-point communication is used.

Definition at line 149 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ send() [2/6]

void precice::com::MPICommunication::send ( double itemToSend,
Rank rankReceiver )
override

Sends a double to process with given rank.

Default MPI point-to-point communication is used.

Definition at line 115 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ send() [3/6]

void precice::com::MPICommunication::send ( int itemToSend,
Rank rankReceiver )
override

Sends an int to process with given rank.

Default MPI point-to-point communication is used.

Definition at line 132 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ send() [4/6]

void precice::com::MPICommunication::send ( precice::span< const double > itemsToSend,
Rank rankReceiver )
override

Sends an array of double values.

Definition at line 86 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ send() [5/6]

void precice::com::MPICommunication::send ( precice::span< const int > itemsToSend,
Rank rankReceiver )
override

Sends an array of integer values.

Definition at line 57 of file MPICommunication.cpp.

Here is the call graph for this function:

◆ send() [6/6]

void precice::com::MPICommunication::send ( std::string const & itemToSend,
Rank rankReceiver )
override

Sends a std::string to process with given rank.

Default MPI point-to-point communication is used.

Definition at line 44 of file MPICommunication.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _log

logging::Logger precice::com::MPICommunication::_log {"com::MPICommunication"}
private

Definition at line 129 of file MPICommunication.hpp.


The documentation for this class was generated from the following files: