Graybat  1.1
Graph Approach for Highly Generic Communication Schemes Based on Adaptive Topologies
graybat::communicationPolicy::Base< T_CommunicationPolicy > Struct Template Reference

Public Types

using CommunicationPolicy = T_CommunicationPolicy
 
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

Point to Point Communication Interface
template<typename T_Send >
void send (const VAddr destVAddr, const Tag tag, const Context context, const T_Send &sendData)=delete
 
template<typename T_Send >
Event asyncSend (const VAddr destVAddr, const Tag tag, const Context context, const T_Send &sendData)=delete
 
template<typename T_Recv >
void recv (const VAddr srcVAddr, const Tag tag, const Context context, T_Recv &recvData)=delete
 
template<typename T_Recv >
Event recv (const Context context, T_Recv &recvData)=delete
 
template<typename T_Recv >
Event asyncRecv (const VAddr srcVAddr, const Tag tag, const Context context, T_Recv &recvData)=delete
 
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 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...
 
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).
 

Member Function Documentation

template<typename T_CommunicationPolicy >
template<typename T_Send , typename T_Recv >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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

Parameters
[in]contextSet of peers that want to send Data
[in]sendDataData that every peer in the context sends with same size
[out]recvDataData from all context members, that all peers* will receive.
template<typename T_CommunicationPolicy >
template<typename T_Send , typename T_Recv >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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.

Parameters
[in]contextSet of peers that want to send Data
[in]sendDataData that every peer in the context sends with varying size
[out]recvDataData from all context members, that all peers* will receive.
[out]recvCountNumber of elements each peer sends (can by varying).
template<typename T_CommunicationPolicy >
template<typename T_Send , typename T_Recv , typename T_Op >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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.

Parameters
[in]contextSet of peers that
[in]opBinary operator that should be used for reduction
[in]sendDataData that every peer contributes to the reduction
[out]recvDataReduced sendData that will be received by all peers. It will have same size of sendData and contains the ith reduced sendData values.
template<typename T_CommunicationPolicy >
template<typename T_Send , typename T_Recv >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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)

Parameters
[in]contextSet of peers that want to receive Data
[in]sendDataData 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]recvDataData from all peer.
template<typename T_CommunicationPolicy >
template<typename T_SendRecv >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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.

Remarks
In Contrast to scatter where every peer receives different data
Parameters
[in]rootVAddrSource peer
[in]contextSet of peers that want to receive Data
[in]sendDataData that peer with rootVAddr will send to the peers of the context
[out]recvDataData from peer with rootVAddr.
template<typename T_CommunicationPolicy >
template<typename T_Send , typename T_Recv >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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.

Parameters
[in]rootVAddrPeer that will receive collcted data from context members
[in]contextSet of peers that want to send Data
[in]sendDataData that every peer in the context sends. Data of all peers in the context need to have same size().
[out]recvDataData from all context members, that peer with virtual address rootVAddr will receive. recvData of all other members of the context will be empty.
template<typename T_CommunicationPolicy >
template<typename T_Send , typename T_Recv >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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.

Parameters
[in]rootVAddrPeer that will receive collcted data from context members
[in]contextSet of peers that want to send Data
[in]sendDataData that every peer in the context sends. The Data can have varying size
[out]recvDataData 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]recvCountNumber of elements each peer sends (can by varying).
template<typename T_CommunicationPolicy >
template<typename T_Send , typename T_Recv , typename T_Op >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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.

Parameters
[in]rootVAddrpeer that will receive the result of reduction
[in]contextSet of peers that
[in]opBinary operator that should be used for reduction
[in]sendDataData that every peer contributes to the reduction
[out]recvDataReduced sendData that will be received by peer with rootVAddr. It will have same size of sendData and contains the ith reduced sendData values.
template<typename T_CommunicationPolicy >
template<typename T_Send , typename T_Recv >
void graybat::communicationPolicy::Base< T_CommunicationPolicy >::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.

Remarks
In Contrast to broadcast where every peer receives the same data
Parameters
[in]rootVAddrpeer that want to distribute its data
[in]contextSet of peers that want to receive Data
[in]sendDataData that peer with rootVAddr will distribute over the peers of the context
[out]recvDataData from peer with rootVAddr.

The documentation for this struct was generated from the following file: