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>
95 Array<OneD, NekDouble>& pSendData,
97 Array<OneD, NekDouble>& pRecvData);
99 Array<OneD, int>& pSendData,
101 Array<OneD, int>& pRecvData);
104 Array<OneD, NekDouble>& pSendData);
107 Array<OneD, int>& pSendData);
117 Array<OneD, NekDouble>& pRecvData);
119 Array<OneD, int>& pRecvData);
121 Array<OneD, int>& pSendDataSizeMap,
122 Array<OneD, int>& pSendDataOffsetMap,
123 Array<OneD, NekDouble>& pRecvData,
124 Array<OneD, int>& pRecvDataSizeMap,
125 Array<OneD, int>& pRecvDataOffsetMap);
127 Array<OneD, int>& pSendDataSizeMap,
128 Array<OneD, int>& pSendDataOffsetMap,
129 Array<OneD, int>& pRecvData,
130 Array<OneD, int>& pRecvDataSizeMap,
131 Array<OneD, int>& pRecvDataOffsetMap);
152 virtual void v_Send(
int pProc, Array<OneD, NekDouble>& pData) = 0;
153 virtual void v_Send(
int pProc, Array<OneD, int>& pData) = 0;
154 virtual void v_Send(
int pProc, std::vector<unsigned int>& pData) = 0;
155 virtual void v_Recv(
int pProc, Array<OneD, NekDouble>& pData) = 0;
156 virtual void v_Recv(
int pProc, Array<OneD, int>& pData) = 0;
157 virtual void v_Recv(
int pProc, std::vector<unsigned int>& pData) = 0;
159 Array<OneD, NekDouble>& pSendData,
161 Array<OneD, NekDouble>& pRecvData) = 0;
163 Array<OneD, int>& pSendData,
165 Array<OneD, int>& pRecvData) = 0;
168 Array<OneD, NekDouble>& pSendData) = 0;
171 Array<OneD, int>& pSendData) = 0;
176 virtual void v_AllReduce(Array<OneD, NekDouble>& pData,
180 virtual void v_AllReduce(std::vector<unsigned int>& pData,
182 virtual void v_AlltoAll(Array<OneD, NekDouble>& pSendData,
183 Array<OneD, NekDouble>& pRecvData) = 0;
184 virtual void v_AlltoAll(Array<OneD, int>& pSendData,
185 Array<OneD, int>& pRecvData) = 0;
186 virtual void v_AlltoAllv(Array<OneD, NekDouble>& pSendData,
187 Array<OneD, int>& pSendDataSizeMap,
188 Array<OneD, int>& pSendDataOffsetMap,
189 Array<OneD, NekDouble>& pRecvData,
190 Array<OneD, int>& pRecvDataSizeMap,
191 Array<OneD, int>& pRecvDataOffsetMap) = 0;
192 virtual void v_AlltoAllv(Array<OneD, int>& pSendData,
193 Array<OneD, int>& pSendDataSizeMap,
194 Array<OneD, int>& pSendDataOffsetMap,
195 Array<OneD, int>& pRecvData,
196 Array<OneD, int>& pRecvDataSizeMap,
197 Array<OneD, int>& pRecvDataOffsetMap) = 0;
198 virtual void v_SplitComm(
int pRows,
int pColumns) = 0;
247 inline void Comm::Send(
int pProc, Array<OneD, NekDouble>& pData)
255 inline void Comm::Recv(
int pProc, Array<OneD, NekDouble>& pData)
280 inline void Comm::Send(
int pProc, std::vector<unsigned int>& pData)
288 inline void Comm::Recv(
int pProc, std::vector<unsigned int>& pData)
297 Array<OneD, NekDouble>& pSendData,
299 Array<OneD, NekDouble>& pRecvData)
301 v_SendRecv(pSendProc, pSendData, pRecvProc, pRecvData);
309 Array<OneD, int>& pSendData,
311 Array<OneD, int>& pRecvData)
313 v_SendRecv(pSendProc, pSendData, pRecvProc, pRecvData);
321 Array<OneD, NekDouble>& pSendData)
332 Array<OneD, int>& pSendData)
386 inline void Comm::AlltoAll(Array<OneD, NekDouble>& pSendData,Array<OneD, NekDouble>& pRecvData)
395 inline void Comm::AlltoAll(Array<OneD, int>& pSendData,Array<OneD, int>& pRecvData)
405 Array<OneD, int>& pSendDataSizeMap,
406 Array<OneD, int>& pSendDataOffsetMap,
407 Array<OneD, NekDouble>& pRecvData,
408 Array<OneD, int>& pRecvDataSizeMap,
409 Array<OneD, int>& pRecvDataOffsetMap)
411 v_AlltoAllv(pSendData,pSendDataSizeMap,pSendDataOffsetMap,pRecvData,pRecvDataSizeMap,pRecvDataOffsetMap);
418 Array<OneD, int>& pSendDataSizeMap,
419 Array<OneD, int>& pSendDataOffsetMap,
420 Array<OneD, int>& pRecvData,
421 Array<OneD, int>& pRecvDataSizeMap,
422 Array<OneD, int>& pRecvDataOffsetMap)
424 v_AlltoAllv(pSendData,pSendDataSizeMap,pSendDataOffsetMap,pRecvData,pRecvDataSizeMap,pRecvDataOffsetMap);
446 return shared_from_this();
463 return shared_from_this();