35 #ifndef NEKTAR_LIB_UTILITIES_COMM_H
36 #define NEKTAR_LIB_UTILITIES_COMM_H
40 #include <boost/enable_shared_from_this.hpp>
45 namespace Nektar {
template <
typename Dim,
typename DataType>
class Array; }
50 namespace LibUtilities
73 class Comm:
public boost::enable_shared_from_this<Comm>
154 virtual void v_Send(
int pProc, std::vector<unsigned int>& pData) = 0;
157 virtual void v_Recv(
int pProc, std::vector<unsigned int>& pData) = 0;
180 virtual void v_AllReduce(std::vector<unsigned int>& pData,
198 virtual void v_SplitComm(
int pRows,
int pColumns) = 0;
280 inline void Comm::Send(
int pProc, std::vector<unsigned int>& pData)
288 inline void Comm::Recv(
int pProc, std::vector<unsigned int>& pData)
301 v_SendRecv(pSendProc, pSendData, pRecvProc, pRecvData);
313 v_SendRecv(pSendProc, pSendData, pRecvProc, pRecvData);
411 v_AlltoAllv(pSendData,pSendDataSizeMap,pSendDataOffsetMap,pRecvData,pRecvDataSizeMap,pRecvDataOffsetMap);
424 v_AlltoAllv(pSendData,pSendDataSizeMap,pSendDataOffsetMap,pRecvData,pRecvDataSizeMap,pRecvDataOffsetMap);
446 return shared_from_this();
463 return shared_from_this();
ReduceOperator
Type of operation to perform in AllReduce.
void AllReduce(NekDouble &pData, enum ReduceOperator pOp)
CommSharedPtr m_commColumn
Column communicator.
virtual void v_AlltoAll(Array< OneD, NekDouble > &pSendData, Array< OneD, NekDouble > &pRecvData)=0
std::string m_type
Type of communication.
virtual void v_Send(int pProc, Array< OneD, NekDouble > &pData)=0
bool TreatAsRankZero(void)
void Send(int pProc, Array< OneD, NekDouble > &pData)
void SendRecvReplace(int pSendProc, int pRecvProc, Array< OneD, NekDouble > &pSendData)
virtual void v_AlltoAllv(Array< OneD, NekDouble > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, NekDouble > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)=0
CommFactory & GetCommFactory()
CommSharedPtr m_commRow
Row communicator.
virtual bool v_RemoveExistingFiles(void)
CommSharedPtr GetRowComm()
Retrieve the row communicator to which this process belongs.
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
virtual void v_SendRecvReplace(int pSendProc, int pRecvProc, Array< OneD, NekDouble > &pSendData)=0
virtual void v_SendRecv(int pSendProc, Array< OneD, NekDouble > &pSendData, int pRecvProc, Array< OneD, NekDouble > &pRecvData)=0
const std::string & GetType() const
#define LIB_UTILITIES_EXPORT
virtual int v_GetRank()=0
virtual bool v_TreatAsRankZero(void)=0
virtual void v_Finalise()=0
virtual void v_AllReduce(NekDouble &pData, enum ReduceOperator pOp)=0
void SplitComm(int pRows, int pColumns)
Splits this communicator into a grid of size pRows*pColumns and creates row and column communicators...
Base communications class.
void Block()
Block execution until all processes reach this point.
void SendRecv(int pSendProc, Array< OneD, NekDouble > &pSendData, int pRecvProc, Array< OneD, NekDouble > &pRecvData)
void Recv(int pProc, Array< OneD, NekDouble > &pData)
void AlltoAll(Array< OneD, NekDouble > &pSendData, Array< OneD, NekDouble > &pRecvData)
void AlltoAllv(Array< OneD, NekDouble > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, NekDouble > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
LibUtilities::NekFactory< std::string, Comm, int, char ** > CommFactory
Datatype of the NekFactory used to instantiate classes derived from the EquationSystem class...
int GetSize()
Returns number of processes.
virtual void v_SplitComm(int pRows, int pColumns)=0
virtual void v_Recv(int pProc, Array< OneD, NekDouble > &pData)=0
int m_size
Number of processes.
bool RemoveExistingFiles(void)
Provides a generic Factory class.
CommSharedPtr GetColumnComm()
Retrieve the column communicator to which this process belongs.