![]() |
fpmas 1.6
|
#include <communication.h>
Public Member Functions | |
virtual int | getRank () const =0 |
virtual int | getSize () const =0 |
virtual void | send (const void *data, int count, MPI_Datatype datatype, int destination, int tag)=0 |
virtual void | send (const DataPack &data, MPI_Datatype datatype, int destination, int tag)=0 |
virtual void | send (int destination, int tag)=0 |
virtual void | Isend (const void *data, int count, MPI_Datatype datatype, int destination, int tag, Request &request)=0 |
virtual void | Isend (const DataPack &data, MPI_Datatype datatype, int destination, int tag, Request &request)=0 |
virtual void | Isend (int destination, int tag, Request &request)=0 |
virtual void | Issend (const void *data, int count, MPI_Datatype datatype, int destination, int tag, Request &request)=0 |
virtual void | Issend (const DataPack &data, MPI_Datatype datatype, int destination, int tag, Request &request)=0 |
virtual void | Issend (int destination, int tag, Request &request)=0 |
virtual void | probe (MPI_Datatype type, int source, int tag, Status &status)=0 |
virtual bool | Iprobe (MPI_Datatype type, int source, int tag, Status &status)=0 |
virtual void | recv (int source, int tag, Status &status=Status::IGNORE)=0 |
virtual void | recv (void *buffer, int count, MPI_Datatype datatype, int source, int tag, Status &status)=0 |
virtual void | recv (DataPack &data, MPI_Datatype datatype, int source, int tag, Status &status)=0 |
virtual bool | test (Request &request)=0 |
virtual void | wait (Request &request)=0 |
virtual void | waitAll (std::vector< Request > &requests)=0 |
virtual std::unordered_map< int, DataPack > | allToAll (std::unordered_map< int, DataPack > export_map, MPI_Datatype datatype)=0 |
virtual std::vector< DataPack > | gather (DataPack data, MPI_Datatype datatype, int root)=0 |
virtual std::vector< DataPack > | allGather (DataPack data, MPI_Datatype datatype)=0 |
virtual DataPack | bcast (DataPack data, MPI_Datatype datatype, int root)=0 |
virtual void | barrier ()=0 |
Static Public Attributes | |
static MPI_Datatype | IGNORE_TYPE = MPI_INT |
MpiCommunicator interface.
Defines a low-level wrapper around MPI functions to make it more C++ compliant.
A limited set of functions, that are actually used in the fpmas
library, have been adapted. More functions might be added in the future.
|
inlinevirtual |
Reimplemented in fpmas::communication::MpiCommunicator.
|
pure virtual |
Returns the rank of this communicator.
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Returns the size of the group to which this communicator belongs.
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Sends data
to destination
(blocking, asynchronous).
This corresponds to the MPI standard mode. In this case, it is up to the MPI implementation to decide if the message is buffered or not (for example, depending on the message size):
data | input buffer |
count | items count in the buffer |
datatype | MPI type of the data to send |
destination | rank of the destination process |
tag | message tag |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Equivalent to send(data.buffer, data.count, datatype, destination, tag)
data | input DataPack |
datatype | MPI type of the data to send |
destination | rank of the destination process |
tag | message tag |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Sends a void message to destination
(blocking, asynchronous).
This might be useful to send END message for example, when only a message tag without body might be enough.
destination | rank of the destination process |
tag | message tag |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Sends data
to destination
(non-blocking, asynchronous).
The FPMAS implementation always copy the input data to the input Request.
The method returns immediately, without waiting for the message to be buffered or received by the destination process.
The operation must be completed with wait() or waitAll() so that the request object is properly freed.
data | input buffer |
count | items count in the buffer |
datatype | MPI type of the data to send |
destination | rank of the destination process |
tag | message tag |
request | output Request |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Equivalent to send(data.buffer, data.count, datatype, destination, tag, request)
data | input DataPack |
datatype | MPI type of the data to send |
destination | rank of the destination process |
tag | message tag |
request | output Request |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Sends a void message to destination
(non-blocking, asynchronous).
This might be useful to send END message for example, when only a message tag without body might be enough.
destination | rank of the destination process |
tag | message tag |
request | output Request |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Sends data
to destination
(non-blocking, synchronous).
Contrary to the default MPI specification, the specified data
buffer can be reused immediately when the method return. This is allowed because the specified data is copied to the input request
.
In consequence, the Request must be completed using either test(Request&) or wait(Request&) to properly free the data buffer with the specified request
.
The request completes when it is guaranteed that the message has been received by the destination process.
data | input buffer |
count | items count in the buffer |
datatype | MPI type of the data to send |
destination | rank of the destination process |
tag | message tag |
request | output Request |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Equivalent to Issend(data.buffer, data.count, datatype, destination, tag, request).
data | input DataPack |
datatype | MPI type of the data to send |
destination | rank of the destination process |
tag | message tag |
request | output Request |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Sends a void message to destination
(non-blocking, synchronous).
This might be useful to send notification messages when only a message tag without body might be enough.
The test(Request&) or wait(Request&) functions can be used to wait for completion.
The request completes when it is guaranteed that the message has been received by the destination process.
destination | rank of the destination process |
tag | message tag |
request | output Request |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Blocking probe.
Blocks until a message with the specified tag is received from source.
Upon return, the output status
contains information about the message to receive.
type | expected message type |
source | source rank |
tag | recv tag |
status | MPI status |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Non-blocking probe.
Returns true if and only if a message with the specified tag can be received from source.
Upon return, the output status
contains information about the message to receive.
type | expected message type |
source | source rank |
tag | recv tag |
status | MPI status |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Receives a message without data.
Completes an eventually corresponding synchronous send operation.
source | rank of the process to receive from |
tag | message tag |
status | output MPI status |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Receives data from source
into buffer
.
The length of the output buffer
should be large enough to contain the message to receive. probe() and Iprobe() might be use to query the length of a message before receiving it.
buffer | output buffer |
count | items count to receive |
datatype | MPI type of the data to receive |
source | rank of the process to receive from |
tag | message tag |
status | output MPI status |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Equivalent to recv(data.buffer, data.count, datatype, source, tag, status)
data | output DataPack |
datatype | MPI type of the data to receive |
source | rank of the process to receive from |
tag | message tag |
status | output MPI status |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Tests if the input request
is complete.
Might be use to check the status of requests performed using non-blocking communication methods.
Moreover, the request
internal data buffer is freed if completion is detected.
request | Request to test |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Waits for the input request
to complete.
Can be used to complete non-blocking communications. Upon return, the request
internal data buffer is freed.
request | Request to wait |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Waits for the completion of all requests
.
Can be used to complete non-blocking communications. Upon return, all requests
internal data buffers are freed.
requests | Requests to wait |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Performs a complete data exchange among processor.
The export_map
is a [rank, data]
map : each DataPack is sent to the corresponding rank. The map is not required to contain an entry (i.e. data to send) for all available ranks.
From each process, received data is gathered by origin rank in the returned [rank, data]
map.
export_map | data to export to each process |
datatype | MPI type of the data to send / receive |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Gathers data at root
.
All processes (including root
), specify data
to send to root
. If the current process rank corresponds to root
, sent data, ordered by rank, are returned in the output vector. Else, an empty vector is returned.
Notice that input DataPacks might have different length, and can be empty for some processes.
data | data to send to root |
datatype | MPI datatype |
root | rank of the root process |
rank == root
, a vector containing gathered data, else an empty vector. Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Gathers data on all processes.
Each process sends a data
instance, and all sent data are received on all processes, ordered by rank. In consequence, vectors returned on all processes are the same.
Notice that input DataPacks might have different length, and can be empty for some processes.
data | to send to all processes |
datatype | MPI datatype |
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Broadcasts data.
data
is sent from root
to all other processes, and received data is returned (including at root
). On other processes than root, the data
parameter is ignored.
Notice that the input DataPack might be empty.
data | data to broadcast |
datatype | MPI datatype |
root | rank of the process from which data is sent |
root
Implemented in fpmas::communication::MpiCommunicatorBase.
|
pure virtual |
Defines a synchronization barrier.
Blocks the caller until all processes have called it. The call returns at any process only after all processes have entered the call.
Implemented in fpmas::communication::MpiCommunicatorBase.
|
static |
Datatype used for recv / send operation without data.