Nektar++
|
Base communications class. More...
#include <Comm.h>
Public Member Functions | |
Comm (int narg, char *arg[]) | |
virtual | ~Comm () |
void | Finalise () |
int | GetSize () |
Returns number of processes. More... | |
int | GetRank () |
const std::string & | GetType () const |
void | Block () |
Block execution until all processes reach this point. More... | |
NekDouble | Wtime () |
Return the time in seconds. More... | |
template<class T > | |
void | Send (int pProc, T &pData) |
template<class T > | |
void | Recv (int pProc, T &pData) |
template<class T > | |
void | SendRecv (int pSendProc, T &pSendData, int pRecvProc, T &pRecvData) |
template<class T > | |
void | SendRecvReplace (int pSendProc, int pRecvProc, T &pData) |
template<class T > | |
void | AllReduce (T &pData, enum ReduceOperator pOp) |
template<class T > | |
void | AlltoAll (T &pSendData, T &pRecvData) |
template<class T1 , class T2 > | |
void | AlltoAllv (T1 &pSendData, T2 &pSendDataSizeMap, T2 &pSendDataOffsetMap, T1 &pRecvData, T2 &pRecvDataSizeMap, T2 &pRecvDataOffsetMap) |
template<class T > | |
void | AllGather (T &pSendData, T &pRecvData) |
template<class T > | |
void | AllGatherv (T &pSendData, T &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap) |
template<class T > | |
void | AllGatherv (T &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap) |
template<class T > | |
void | Bcast (T &data, int rootProc) |
template<class T > | |
void | Exscan (T &pData, const enum ReduceOperator pOp, T &ans) |
template<class T > | |
T | Gather (const int rootProc, T &val) |
template<class T > | |
T | Scatter (const int rootProc, T &pData) |
CommSharedPtr | CommCreateIf (int flag) |
If the flag is non-zero create a new communicator. More... | |
void | SplitComm (int pRows, int pColumns) |
Splits this communicator into a grid of size pRows*pColumns and creates row and column communicators. By default the communicator is a single row. More... | |
CommSharedPtr | GetRowComm () |
Retrieve the row communicator to which this process belongs. More... | |
CommSharedPtr | GetColumnComm () |
Retrieve the column communicator to which this process belongs. More... | |
bool | TreatAsRankZero (void) |
bool | IsSerial (void) |
bool | RemoveExistingFiles (void) |
Protected Member Functions | |
Comm () | |
virtual void | v_Finalise ()=0 |
virtual int | v_GetRank ()=0 |
virtual void | v_Block ()=0 |
virtual NekDouble | v_Wtime ()=0 |
virtual void | v_Send (void *buf, int count, CommDataType dt, int dest)=0 |
virtual void | v_Recv (void *buf, int count, CommDataType dt, int source)=0 |
virtual void | v_SendRecv (void *sendbuf, int sendcount, CommDataType sendtype, int dest, void *recvbuf, int recvcount, CommDataType recvtype, int source)=0 |
virtual void | v_SendRecvReplace (void *buf, int count, CommDataType dt, int pSendProc, int pRecvProc)=0 |
virtual void | v_AllReduce (void *buf, int count, CommDataType dt, enum ReduceOperator pOp)=0 |
virtual void | v_AlltoAll (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype)=0 |
virtual void | v_AlltoAllv (void *sendbuf, int sendcounts[], int sensdispls[], CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype)=0 |
virtual void | v_AllGather (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype)=0 |
virtual void | v_AllGatherv (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype)=0 |
virtual void | v_AllGatherv (void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype)=0 |
virtual void | v_Bcast (void *buffer, int count, CommDataType dt, int root)=0 |
virtual void | v_Exscan (Array< OneD, unsigned long long > &pData, const enum ReduceOperator pOp, Array< OneD, unsigned long long > &ans)=0 |
virtual void | v_Gather (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root)=0 |
virtual void | v_Scatter (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root)=0 |
virtual CommSharedPtr | v_CommCreateIf (int flag)=0 |
virtual void | v_SplitComm (int pRows, int pColumns)=0 |
virtual bool | v_TreatAsRankZero (void)=0 |
virtual bool | v_IsSerial (void)=0 |
virtual bool | v_RemoveExistingFiles (void) |
Protected Attributes | |
int | m_size |
Number of processes. More... | |
std::string | m_type |
Type of communication. More... | |
CommSharedPtr | m_commRow |
Row communicator. More... | |
CommSharedPtr | m_commColumn |
Column communicator. More... | |
Nektar::LibUtilities::Comm::Comm | ( | int | narg, |
char * | arg[] | ||
) |
Definition at line 43 of file Communication/Comm.cpp.
|
virtual |
Definition at line 52 of file Communication/Comm.cpp.
|
protected |
Definition at line 48 of file Communication/Comm.cpp.
void Nektar::LibUtilities::Comm::AllGather | ( | T & | pSendData, |
T & | pRecvData | ||
) |
Definition at line 351 of file Comm.h.
References Nektar::LibUtilities::CommDataTypeTraits< T >::GetCount(), GetSize(), and v_AllGather().
void Nektar::LibUtilities::Comm::AllGatherv | ( | T & | pSendData, |
T & | pRecvData, | ||
Array< OneD, int > & | pRecvDataSizeMap, | ||
Array< OneD, int > & | pRecvDataOffsetMap | ||
) |
Definition at line 372 of file Comm.h.
References Nektar::LibUtilities::CommDataTypeTraits< T >::GetCount(), Nektar::LibUtilities::CommDataTypeTraits< T >::GetDataType(), and v_AllGatherv().
void Nektar::LibUtilities::Comm::AllGatherv | ( | T & | pRecvData, |
Array< OneD, int > & | pRecvDataSizeMap, | ||
Array< OneD, int > & | pRecvDataOffsetMap | ||
) |
Definition at line 395 of file Comm.h.
References Nektar::LibUtilities::CommDataTypeTraits< T >::GetDataType(), and v_AllGatherv().
void Nektar::LibUtilities::Comm::AllReduce | ( | T & | pData, |
enum ReduceOperator | pOp | ||
) |
Definition at line 295 of file Comm.h.
References v_AllReduce().
void Nektar::LibUtilities::Comm::AlltoAll | ( | T & | pSendData, |
T & | pRecvData | ||
) |
Definition at line 302 of file Comm.h.
References ASSERTL0, Nektar::LibUtilities::CommDataTypeTraits< T >::GetCount(), GetSize(), and v_AlltoAll().
void Nektar::LibUtilities::Comm::AlltoAllv | ( | T1 & | pSendData, |
T2 & | pSendDataSizeMap, | ||
T2 & | pSendDataOffsetMap, | ||
T1 & | pRecvData, | ||
T2 & | pRecvDataSizeMap, | ||
T2 & | pRecvDataOffsetMap | ||
) |
Definition at line 326 of file Comm.h.
References v_AlltoAllv().
void Nektar::LibUtilities::Comm::Bcast | ( | T & | data, |
int | rootProc | ||
) |
Definition at line 412 of file Comm.h.
References v_Bcast().
|
inline |
|
inline |
If the flag is non-zero create a new communicator.
Definition at line 476 of file Comm.h.
References v_CommCreateIf().
void Nektar::LibUtilities::Comm::Exscan | ( | T & | pData, |
const enum ReduceOperator | pOp, | ||
T & | ans | ||
) |
Definition at line 420 of file Comm.h.
References ASSERTL0, and v_Exscan().
|
inline |
Definition at line 207 of file Comm.h.
References v_Finalise().
T Nektar::LibUtilities::Comm::Gather | ( | const int | rootProc, |
T & | val | ||
) |
Concatenate all the input arrays, in rank order, onto the process with rank == rootProc
Definition at line 435 of file Comm.h.
References Nektar::LibUtilities::CommDataTypeTraits< T >::GetCount(), Nektar::LibUtilities::CommDataTypeTraits< T >::GetPointer(), GetRank(), GetSize(), and v_Gather().
|
inline |
Retrieve the column communicator to which this process belongs.
Definition at line 510 of file Comm.h.
References m_commColumn.
|
inline |
Definition at line 223 of file Comm.h.
References v_GetRank().
Referenced by export_Comm(), Gather(), and Scatter().
|
inline |
Retrieve the row communicator to which this process belongs.
Definition at line 494 of file Comm.h.
References m_commRow.
|
inline |
Returns number of processes.
Definition at line 215 of file Comm.h.
References m_size.
Referenced by AllGather(), AlltoAll(), export_Comm(), Gather(), Scatter(), and Nektar::LibUtilities::CommMpi::v_AllReduce().
|
inline |
|
inline |
void Nektar::LibUtilities::Comm::Recv | ( | int | pProc, |
T & | pData | ||
) |
Definition at line 259 of file Comm.h.
References v_Recv().
|
inline |
Definition at line 532 of file Comm.h.
References v_RemoveExistingFiles().
T Nektar::LibUtilities::Comm::Scatter | ( | const int | rootProc, |
T & | pData | ||
) |
Scatter pData across ranks in chunks of len(pData)/num_ranks
Definition at line 455 of file Comm.h.
References Nektar::LibUtilities::CommDataTypeTraits< T >::GetCount(), Nektar::LibUtilities::CommDataTypeTraits< T >::GetPointer(), GetRank(), GetSize(), and v_Scatter().
void Nektar::LibUtilities::Comm::Send | ( | int | pProc, |
T & | pData | ||
) |
Definition at line 252 of file Comm.h.
References v_Send().
void Nektar::LibUtilities::Comm::SendRecv | ( | int | pSendProc, |
T & | pSendData, | ||
int | pRecvProc, | ||
T & | pRecvData | ||
) |
Definition at line 270 of file Comm.h.
References v_SendRecv().
void Nektar::LibUtilities::Comm::SendRecvReplace | ( | int | pSendProc, |
int | pRecvProc, | ||
T & | pData | ||
) |
Definition at line 284 of file Comm.h.
References v_SendRecvReplace().
|
inline |
Splits this communicator into a grid of size pRows*pColumns and creates row and column communicators. By default the communicator is a single row.
Definition at line 486 of file Comm.h.
References v_SplitComm().
|
inline |
Definition at line 522 of file Comm.h.
References v_TreatAsRankZero().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by AllGather().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by AllGatherv().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by AllReduce().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by AlltoAll().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by AlltoAllv().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Bcast().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Block().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by CommCreateIf().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Exscan().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, Nektar::LibUtilities::CommCwipi, and Nektar::LibUtilities::CommSerial.
Referenced by Finalise().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Gather().
|
protectedpure virtual |
Implemented in Nektar::FieldUtils::FieldConvertComm, Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by GetRank().
|
protectedpure virtual |
Implemented in Nektar::FieldUtils::FieldConvertComm, Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by IsSerial().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Recv().
|
protectedvirtual |
Reimplemented in Nektar::FieldUtils::FieldConvertComm.
Definition at line 57 of file Communication/Comm.cpp.
Referenced by RemoveExistingFiles().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Scatter().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Send().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by SendRecv().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by SendRecvReplace().
|
protectedpure virtual |
Implemented in Nektar::FieldUtils::FieldConvertComm, Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by SplitComm().
|
protectedpure virtual |
Implemented in Nektar::FieldUtils::FieldConvertComm, Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by TreatAsRankZero().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Wtime().
|
inline |
|
protected |
Column communicator.
Definition at line 151 of file Comm.h.
Referenced by GetColumnComm(), and Nektar::LibUtilities::CommMpi::v_SplitComm().
|
protected |
Row communicator.
Definition at line 150 of file Comm.h.
Referenced by GetRowComm(), and Nektar::LibUtilities::CommMpi::v_SplitComm().
|
protected |
Number of processes.
Definition at line 148 of file Comm.h.
Referenced by Nektar::LibUtilities::CommCwipi::CommCwipi(), Nektar::LibUtilities::CommMpi::CommMpi(), Nektar::LibUtilities::CommSerial::CommSerial(), GetSize(), Nektar::LibUtilities::CommMpi::v_IsSerial(), and Nektar::LibUtilities::CommMpi::v_SplitComm().
|
protected |
Type of communication.
Definition at line 149 of file Comm.h.
Referenced by Nektar::LibUtilities::CommCwipi::CommCwipi(), Nektar::LibUtilities::CommMpi::CommMpi(), Nektar::LibUtilities::CommSerial::CommSerial(), and GetType().