|
Graybat
1.1
Graph Approach for Highly Generic Communication Schemes Based on Adaptive Topologies
|
Implementation of the Cage communicationPolicy interface based on the MPI implementation boost::mpi. More...
#include <BMPI.hpp>
Public Types | |
| using | Tag = typename graybat::communicationPolicy::Tag< BMPI > |
| using | ContextID = typename graybat::communicationPolicy::ContextID< BMPI > |
| using | MsgType = typename graybat::communicationPolicy::MsgType< BMPI > |
| using | VAddr = typename graybat::communicationPolicy::VAddr< BMPI > |
| using | Context = typename graybat::communicationPolicy::Context< BMPI > |
| using | Event = typename graybat::communicationPolicy::Event< BMPI > |
| using | Config = typename graybat::communicationPolicy::Config< BMPI > |
| using | Uri = int |
Public Types inherited from graybat::communicationPolicy::Base< BMPI > | |
| using | CommunicationPolicy = BMPI |
| using | VAddr = typename graybat::communicationPolicy::VAddr< CommunicationPolicy > |
| using | Tag = typename graybat::communicationPolicy::Tag< CommunicationPolicy > |
| using | Context = typename graybat::communicationPolicy::Context< CommunicationPolicy > |
| using | Event = typename graybat::communicationPolicy::Event< CommunicationPolicy > |
Public Member Functions | |
| BMPI (Config const config) | |
Point to Point Communication Interface | |
| template<typename T_Send > | |
| void | send (const VAddr destVAddr, const Tag tag, const Context context, const T_Send &sendData) |
| Blocking transmission of a message sendData to peer with virtual address destVAddr. More... | |
| template<typename T_Send > | |
| Event | asyncSend (const VAddr destVAddr, const Tag tag, const Context context, const T_Send &sendData) |
| Non blocking transmission of a message sendData to peer with virtual address destVAddr. More... | |
| template<typename T_Recv > | |
| void | recv (const VAddr srcVAddr, const Tag tag, const Context context, T_Recv &recvData) |
| Blocking receive of a message recvData from peer with virtual address srcVAddr. More... | |
| template<typename T_Recv > | |
| Event | recv (const Context context, T_Recv &recvData) |
| template<typename T_Recv > | |
| Event | asyncRecv (const VAddr srcVAddr, const Tag tag, const Context context, T_Recv &recvData) |
| Non blocking receive of a message recvData from peer with virtual address srcVAddr. More... | |
Collective Communication Interface | |
| template<typename T_Send , typename T_Recv > | |
| void | gather (const VAddr rootVAddr, 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 > | |
| void | gatherVar (const VAddr rootVAddr, const Context context, const T_Send &sendData, T_Recv &recvData, std::vector< unsigned > &recvCount) |
| Collects sendData from all members of the context with varying size and transmits it as a list to peer with rootVAddr. More... | |
| template<typename T_Send , typename T_Recv > | |
| void | allGather (Context context, const T_Send &sendData, T_Recv &recvData) |
| Collects sendData from all members of the context and transmits it as a list to every peer in the context More... | |
| template<typename T_Send , typename T_Recv > | |
| void | allGatherVar (const Context context, const T_Send &sendData, T_Recv &recvData, std::vector< unsigned > &recvCount) |
| 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... | |
| template<typename T_Send , typename T_Recv > | |
| void | scatter (const VAddr rootVAddr, const Context context, const T_Send &sendData, T_Recv &recvData) |
| Distributes sendData from peer rootVAddr to all peers in context. Every peer will receive different data. More... | |
| template<typename T_Send , typename T_Recv > | |
| void | allToAll (const Context context, const T_Send &sendData, T_Recv &recvData) |
| 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) More... | |
| template<typename T_Send , typename T_Recv , typename T_Op > | |
| void | reduce (const VAddr rootVAddr, const Context context, const T_Op op, const T_Send &sendData, T_Recv &recvData) |
| 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. 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) |
| 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. More... | |
| template<typename T_SendRecv > | |
| void | broadcast (const VAddr rootVAddr, const Context context, T_SendRecv &data) |
| Send sendData from peer rootVAddr to all peers in context. Every peer will receive the same data. More... | |
| void | synchronize (const Context context) |
| Synchronizes all peers within context to the same point in the programm execution (barrier). | |
| void | synchronize () |
| Synchronizes all peers within the globalContext in the programm execution (barrier). More... | |
Context Management Interface | |
| Context | splitContext (const bool isMember, const Context oldContext) |
| Creates a new context with all peers that declared isMember as true. | |
| Context | getGlobalContext () |
| Returns the context that contains all peers. | |
Public Member Functions inherited from graybat::communicationPolicy::Base< BMPI > | |
| void | send (const VAddr destVAddr, const Tag tag, const Context context, const T_Send &sendData)=delete |
| Event | asyncSend (const VAddr destVAddr, const Tag tag, const Context context, const T_Send &sendData)=delete |
| void | recv (const VAddr srcVAddr, const Tag tag, const Context context, T_Recv &recvData)=delete |
| Event | recv (const Context context, T_Recv &recvData)=delete |
| Event | asyncRecv (const VAddr srcVAddr, const Tag tag, const Context context, T_Recv &recvData)=delete |
| void | gather (const VAddr rootVAddr, 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... | |
| void | gatherVar (const VAddr rootVAddr, const Context context, const T_Send &sendData, T_Recv &recvData, std::vector< unsigned > &recvCount) |
| Collects sendData from all members of the context with varying size and transmits it as a list to peer with rootVAddr. More... | |
| void | allGather (Context context, const T_Send &sendData, T_Recv &recvData) |
| Collects sendData from all members of the context and transmits it as a list to every peer in the context More... | |
| void | allGatherVar (const Context context, const T_Send &sendData, T_Recv &recvData, std::vector< unsigned > &recvCount) |
| 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... | |
| void | scatter (const VAddr rootVAddr, const Context context, const T_Send &sendData, T_Recv &recvData) |
| Distributes sendData from peer rootVAddr to all peers in context. Every peer will receive different data. More... | |
| void | allScatter (const Context context, const T_Send &sendData, T_Recv &recvData) |
| 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) More... | |
| void | reduce (const VAddr rootVAddr, const Context context, const T_Op op, const T_Send &sendData, T_Recv &recvData) |
| 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. More... | |
| void | allReduce (const Context context, T_Op op, const T_Send &sendData, T_Recv &recvData) |
| 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. More... | |
| void | broadcast (const VAddr rootVAddr, const Context context, T_SendRecv &data) |
| Send sendData from peer rootVAddr to all peers in context. Every peer will receive the same data. More... | |
| void | synchronize (const Context context) |
| Synchronizes all peers within context to the same point in the programm execution (barrier). | |
Implementation of the Cage communicationPolicy interface based on the MPI implementation boost::mpi.
|
inline |
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. |
|
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.
| [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). |
|
inline |
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. |
|
inline |
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. |
|
inline |
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. |
|
inline |
Non blocking transmission of a message sendData to peer with virtual address destVAddr.
| [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. |
|
inline |
Send sendData from peer rootVAddr to all peers in context. Every peer will receive the same data.
| [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. |
|
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.
| [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. |
|
inline |
Collects sendData from all members of the context with varying size and transmits it as a list to peer with rootVAddr.
| [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). |
|
inline |
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. |
|
inline |
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. |
|
inline |
Distributes sendData from peer rootVAddr to all peers in context. Every peer will receive different data.
| [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. |
|
inline |
Blocking transmission of a message sendData to peer with virtual address destVAddr.
| [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. |
|
inline |
Synchronizes all peers within the globalContext in the programm execution (barrier).