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 T > | |
void | AlltoAllv (Array< OneD, T > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, 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 | 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_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_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[] | ||
) |
void Nektar::LibUtilities::Comm::AllReduce | ( | T & | pData, |
enum ReduceOperator | pOp | ||
) |
Definition at line 268 of file Comm.h.
References v_AllReduce().
void Nektar::LibUtilities::Comm::AlltoAll | ( | T & | pSendData, |
T & | pRecvData | ||
) |
Definition at line 275 of file Comm.h.
References ASSERTL0, Nektar::LibUtilities::CommDataTypeTraits< T >::GetCount(), GetSize(), and v_AlltoAll().
void Nektar::LibUtilities::Comm::AlltoAllv | ( | Array< OneD, T > & | pSendData, |
Array< OneD, int > & | pSendDataSizeMap, | ||
Array< OneD, int > & | pSendDataOffsetMap, | ||
Array< OneD, T > & | pRecvData, | ||
Array< OneD, int > & | pRecvDataSizeMap, | ||
Array< OneD, int > & | pRecvDataOffsetMap | ||
) |
Definition at line 299 of file Comm.h.
References Nektar::LibUtilities::CommDataTypeTraits< T >::GetDataType(), and v_AlltoAllv().
void Nektar::LibUtilities::Comm::Bcast | ( | T & | data, |
int | rootProc | ||
) |
|
inline |
|
inline |
If the flag is non-zero create a new communicator.
Definition at line 379 of file Comm.h.
References v_CommCreateIf().
void Nektar::LibUtilities::Comm::Exscan | ( | T & | pData, |
const enum ReduceOperator | pOp, | ||
T & | ans | ||
) |
Definition at line 323 of file Comm.h.
References ASSERTL0, and v_Exscan().
|
inline |
Definition at line 180 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 338 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 413 of file Comm.h.
References m_commColumn.
|
inline |
Definition at line 196 of file Comm.h.
References v_GetRank().
|
inline |
Retrieve the row communicator to which this process belongs.
Definition at line 397 of file Comm.h.
References m_commRow.
|
inline |
Returns number of processes.
Definition at line 188 of file Comm.h.
References m_size.
Referenced by AlltoAll(), Gather(), Scatter(), and Nektar::LibUtilities::CommMpi::v_AllReduce().
|
inline |
void Nektar::LibUtilities::Comm::Recv | ( | int | pProc, |
T & | pData | ||
) |
|
inline |
Definition at line 430 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 358 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 | ||
) |
void Nektar::LibUtilities::Comm::SendRecv | ( | int | pSendProc, |
T & | pSendData, | ||
int | pRecvProc, | ||
T & | pRecvData | ||
) |
Definition at line 243 of file Comm.h.
References v_SendRecv().
void Nektar::LibUtilities::Comm::SendRecvReplace | ( | int | pSendProc, |
int | pRecvProc, | ||
T & | pData | ||
) |
Definition at line 257 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 389 of file Comm.h.
References v_SplitComm().
|
inline |
Definition at line 425 of file Comm.h.
References v_TreatAsRankZero().
|
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::CommSerial, and Nektar::LibUtilities::CommMpi.
Referenced by CommCreateIf().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Exscan().
|
protectedpure virtual |
Implemented in Nektar::LibUtilities::CommMpi, 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::LibUtilities::CommMpi, and Nektar::LibUtilities::CommSerial.
Referenced by Recv().
|
protectedvirtual |
Reimplemented in Nektar::FieldUtils::FieldConvertComm.
Definition at line 56 of file 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::CommSerial, and Nektar::LibUtilities::CommMpi.
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 133 of file Comm.h.
Referenced by GetColumnComm(), and Nektar::LibUtilities::CommMpi::v_SplitComm().
|
protected |
Row communicator.
Definition at line 132 of file Comm.h.
Referenced by GetRowComm(), and Nektar::LibUtilities::CommMpi::v_SplitComm().
|
protected |
Number of processes.
Definition at line 130 of file Comm.h.
Referenced by Nektar::LibUtilities::CommMpi::CommMpi(), Nektar::LibUtilities::CommSerial::CommSerial(), GetSize(), and Nektar::LibUtilities::CommMpi::v_SplitComm().
|
protected |
Type of communication.
Definition at line 131 of file Comm.h.
Referenced by Nektar::LibUtilities::CommMpi::CommMpi(), Nektar::LibUtilities::CommSerial::CommSerial(), and GetType().