Implementation of the Cage communicationPolicy interface based on the MPI implementation boost::mpi.
More...
#include <MinBMPI.hpp>
|
| class | Context |
| | A context represents a set of peers which are able to communicate with each other. More...
|
| |
| class | Event |
| | An event is returned by non-blocking communication operations and can be asked whether an operation has finished or it can be waited for this operation to be finished. More...
|
| |
|
|
typedef unsigned | Tag |
| |
|
typedef unsigned | ContextID |
| |
|
typedef unsigned | VAddr |
| |
|
typedef unsigned | MsgType |
| |
|
typedef int | Uri |
| |
|
|
Non blocking transmission of a message sendData to peer with virtual address destVAddr.
- Parameters
-
| [in] | destVAddr | VAddr of peer that will receive the message |
| [in] | tag | Description of the message to better distinguish messages types |
| [in] | context | Context in which both sender and receiver are included |
| [in] | sendData | Data reference of template type T will be. T need to provide the function data(), that returns the pointer to the data memory address. And the function size(), that return the amount of data elements to send. Notice, that std::vector and std::array implement this interface. |
- Returns
- Event Blocking transmission of a message sendData to peer with virtual address destVAddr.
- Parameters
-
| [in] | destVAddr | VAddr of peer that will receive the message |
| [in] | tag | Description of the message to better distinguish messages types |
| [in] | context | Context in which both sender and receiver are included |
| [in] | sendData | Data reference of template type T will be send to receiver peer. T need to provide the function data(), that returns the pointer to the data memory address. And the function size(), that return the amount of data elements to send. Notice, that std::vector and std::array implement this interface. Non blocking receive of a message recvData from peer with virtual address srcVAddr. |
| [in] | srcVAddr | VAddr of peer that sended the message |
| [in] | tag | Description of the message to better distinguish messages types |
| [in] | context | Context in which both sender and receiver are included |
| [out] | recvData | Data reference of template type T will be received from sender peer. T need to provide the function data(), that returns the pointer to the data memory address. And the function size(), that return the amount of data elements to send. Notice, that std::vector and std::array implement this interface. |
- Returns
- Event Blocking receive of a message recvData from peer with virtual address srcVAddr.
- Parameters
-
| [in] | srcVAddr | VAddr of peer that sended the message |
| [in] | tag | Description of the message to better distinguish messages types |
| [in] | context | Context in which both sender and receiver are included |
| [out] | recvData | Data reference of template type T will be received from sender peer. T need to provide the function data(), that returns the pointer to the data memory address. And the function size(), that return the amount of data elements to send. Notice, that std::vector and std::array implement this interface. |
|
| template<typename T_Send , typename T_Recv > |
| void | allGather (const Context context, const T_Send &sendData, T_Recv &recvData) |
| | Collects sendData from all peers of the context and transmits it as a list to the peer with rootVAddr. Data of all peers has to be from the same size. More...
|
| |
| template<typename T_Send , typename T_Recv , typename T_Op > |
| void | allReduce (const Context context, T_Op op, const T_Send &sendData, T_Recv &recvData) |
| | Collects sendData from all peers of the context. Size of sendData can vary in size. The data is received by every peer in the context. More...
|
| |
|
Send sendData from peer rootVAddr to all peers in context. Every peer will receive the same data.
- Parameters
-
| [in] | rootVAddr | Source peer |
| [in] | context | Set of peers that want to receive Data |
| [in] | sendData | Data that peer with rootVAddr will send to the peers of the context |
| [out] | recvData | Data from peer with rootVAddr. Synchronizes all peers within context to the same point in the programm execution (barrier). Synchronizes all peers within the globalContext in the programm execution (barrier). |
- See also
- getGlobalContext()
|
|
Context | createContext (const std::vector< VAddr > vAddrs, const Context oldContext) |
| | Creates a new context from peer ids of an oldContext
|
| |
|
Context | getGlobalContext () |
| | Returns the context that contains all peers.
|
| |
Implementation of the Cage communicationPolicy interface based on the MPI implementation boost::mpi.
template<typename T_Send , typename T_Recv >
| void graybat::communicationPolicy::MinBMPI::allGather |
( |
const Context |
context, |
|
|
const T_Send & |
sendData, |
|
|
T_Recv & |
recvData |
|
) |
| |
|
inline |
Collects sendData from all peers of the context and transmits it as a list to the peer with rootVAddr. Data of all peers has to be from the same size.
- Parameters
-
| [in] | rootVAddr | Peer that will receive collcted data from context members |
| [in] | context | Set of peers that want to send Data |
| [in] | sendData | Data that every peer in the context sends. Data of all peers in the context need to have same size(). |
| [out] | recvData | Data from all context members, that peer with virtual address rootVAddr will receive. recvData of all other members of the context will be empty. Collects sendData from all members of the context with varying size and transmits it as a list to peer with rootVAddr. |
- Parameters
-
| [in] | rootVAddr | Peer that will receive collcted data from context members |
| [in] | context | Set of peers that want to send Data |
| [in] | sendData | Data that every peer in the context sends. The Data can have varying size |
| [out] | recvData | Data from all context peers, that peer with rootVAddr will receive. recvData of all other peers of the context will be empty. The received data is ordered by the VAddr of the peers. |
| [out] | recvCount | Number of elements each peer sends (can by varying). Collects sendData from all members of the context and transmits it as a list to every peer in the context |
| [in] | context | Set of peers that want to send Data |
| [in] | sendData | Data that every peer in the context sends with same size |
| [out] | recvData | Data from all context members, that all peers* will receive. |
template<typename T_Send , typename T_Recv , typename T_Op >
| void graybat::communicationPolicy::MinBMPI::allReduce |
( |
const Context |
context, |
|
|
T_Op |
op, |
|
|
const T_Send & |
sendData, |
|
|
T_Recv & |
recvData |
|
) |
| |
|
inline |
Collects sendData from all peers of the context. Size of sendData can vary in size. The data is received by every peer in the context.
- Parameters
-
| [in] | context | Set of peers that want to send Data |
| [in] | sendData | Data that every peer in the context sends with varying size |
| [out] | recvData | Data from all context members, that all peers* will receive. |
| [out] | recvCount | Number of elements each peer sends (can by varying). Distributes sendData from peer rootVAddr to all peers in context. Every peer will receive different data. |
- Parameters
-
| [in] | rootVAddr | peer that want to distribute its data |
| [in] | context | Set of peers that want to receive Data |
| [in] | sendData | Data that peer with rootVAddr will distribute over the peers of the context |
| [out] | recvData | Data from peer with rootVAddr. Distributes sendData of all peer in the context to all peers in the context. Every peer will receive data from every other peer (also the own data) |
| [in] | context | Set of peers that want to receive Data |
| [in] | sendData | Data that each peer wants to send. Each peer will receive same number of data elements, but not the same data elements. sendData will be divided in equal chunks of data and is then distributed. |
| [out] | recvData | Data from all peer. Performs a reduction with a binary operator op on all sendData elements from all peers whithin the context. The result will be received by the peer with rootVAddr. Binary operations like std::plus, std::minus can be used. But, they can also be defined as binary operator simular to std::plus etc. |
| [in] | rootVAddr | peer that will receive the result of reduction |
| [in] | context | Set of peers that |
| [in] | op | Binary operator that should be used for reduction |
| [in] | sendData | Data that every peer contributes to the reduction |
| [out] | recvData | Reduced sendData that will be received by peer with rootVAddr. It will have same size of sendData and contains the ith reduced sendData values. Performs a reduction with a binary operator op on all sendData elements from all peers whithin the context. The result will be received by all peers. |
| [in] | context | Set of peers that |
| [in] | op | Binary operator that should be used for reduction |
| [in] | sendData | Data that every peer contributes to the reduction |
| [out] | recvData | Reduced sendData that will be received by all peers. It will have same size of sendData and contains the ith reduced sendData values. |
The documentation for this class was generated from the following file: