Nektar++
|
A global linear system. More...
#include <CommMpi.h>
Public Member Functions | |
CommMpi (int narg, char *arg[]) | |
~CommMpi () override | |
MPI_Comm | GetComm () |
Public Member Functions inherited from Nektar::LibUtilities::Comm | |
Comm (int narg, char *arg[]) | |
virtual | ~Comm () |
void | Finalise () |
int | GetSize () const |
Returns number of processes. More... | |
int | GetRank () |
const std::string & | GetType () const |
bool | TreatAsRankZero () |
bool | IsSerial () |
bool | IsParallelInTime () |
std::tuple< int, int, int > | GetVersion () |
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 | 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 &pData, int pRoot) |
template<class T > | |
T | Gather (int rootProc, T &val) |
template<class T > | |
T | Scatter (int rootProc, T &pData) |
template<class T > | |
void | DistGraphCreateAdjacent (T &sources, T &sourceweights, int reorder) |
template<class T1 , class T2 > | |
void | NeighborAlltoAllv (T1 &pSendData, T2 &pSendDataSizeMap, T2 &pSendDataOffsetMap, T1 &pRecvData, T2 &pRecvDataSizeMap, T2 &pRecvDataOffsetMap) |
template<class T > | |
void | Irsend (int pProc, T &pData, int count, const CommRequestSharedPtr &request, int loc) |
template<class T > | |
void | Isend (int pProc, T &pData, int count, const CommRequestSharedPtr &request, int loc) |
template<class T > | |
void | SendInit (int pProc, T &pData, int count, const CommRequestSharedPtr &request, int loc) |
template<class T > | |
void | Irecv (int pProc, T &pData, int count, const CommRequestSharedPtr &request, int loc) |
template<class T > | |
void | RecvInit (int pProc, T &pData, int count, const CommRequestSharedPtr &request, int loc) |
void | StartAll (const CommRequestSharedPtr &request) |
void | WaitAll (const CommRequestSharedPtr &request) |
CommRequestSharedPtr | CreateRequest (int num) |
CommSharedPtr | CommCreateIf (int flag) |
If the flag is non-zero create a new communicator. More... | |
void | SplitComm (int pRows, int pColumns, int pTime=1) |
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... | |
CommSharedPtr | GetTimeComm () |
Retrieve the time communicator to which this process belongs. More... | |
CommSharedPtr | GetSpaceComm () |
Retrieve the space communicator to which this process belongs. More... | |
bool | RemoveExistingFiles () |
std::pair< CommSharedPtr, CommSharedPtr > | SplitCommNode () |
Static Public Member Functions | |
static CommSharedPtr | create (int narg, char *arg[]) |
Creates an instance of this class. More... | |
Static Public Attributes | |
static std::string | className |
Name of class. More... | |
Protected Member Functions | |
CommMpi (MPI_Comm pComm) | |
void | v_Finalise () override |
int | v_GetRank () final |
bool | v_TreatAsRankZero () final |
bool | v_IsSerial () final |
std::tuple< int, int, int > | v_GetVersion () final |
void | v_Block () final |
double | v_Wtime () final |
void | v_Send (void *buf, int count, CommDataType dt, int dest) final |
void | v_Recv (void *buf, int count, CommDataType dt, int source) final |
void | v_SendRecv (void *sendbuf, int sendcount, CommDataType sendtype, int dest, void *recvbuf, int recvcount, CommDataType recvtype, int source) final |
void | v_AllReduce (void *buf, int count, CommDataType dt, enum ReduceOperator pOp) final |
void | v_AlltoAll (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype) final |
void | v_AlltoAllv (void *sendbuf, int sendcounts[], int sensdispls[], CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype) final |
void | v_AllGather (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype) final |
void | v_AllGatherv (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype) final |
void | v_AllGatherv (void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype) final |
void | v_Bcast (void *buffer, int count, CommDataType dt, int root) final |
void | v_Gather (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root) final |
void | v_Scatter (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root) final |
void | v_DistGraphCreateAdjacent (int indegree, const int sources[], const int sourceweights[], int reorder) final |
void | v_NeighborAlltoAllv (void *sendbuf, int sendcounts[], int sensdispls[], CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype) final |
void | v_Irsend (void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc) final |
void | v_Isend (void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc) final |
void | v_SendInit (void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc) final |
void | v_Irecv (void *buf, int count, CommDataType dt, int source, CommRequestSharedPtr request, int loc) final |
void | v_RecvInit (void *buf, int count, CommDataType dt, int source, CommRequestSharedPtr request, int loc) final |
void | v_StartAll (CommRequestSharedPtr request) final |
void | v_WaitAll (CommRequestSharedPtr request) final |
CommRequestSharedPtr | v_CreateRequest (int num) final |
void | v_SplitComm (int pRows, int pColumns, int pTime) override |
CommSharedPtr | v_CommCreateIf (int flag) final |
std::pair< CommSharedPtr, CommSharedPtr > | v_SplitCommNode () final |
Protected Member Functions inherited from Nektar::LibUtilities::Comm | |
Comm () | |
virtual void | v_Finalise ()=0 |
virtual int | v_GetRank ()=0 |
virtual bool | v_TreatAsRankZero ()=0 |
virtual bool | v_IsSerial ()=0 |
virtual std::tuple< int, int, int > | v_GetVersion ()=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_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_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 void | v_DistGraphCreateAdjacent (int indegree, const int sources[], const int sourceweights[], int reorder)=0 |
virtual void | v_NeighborAlltoAllv (void *sendbuf, int sendcounts[], int sdispls[], CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype)=0 |
virtual void | v_Irsend (void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc)=0 |
virtual void | v_Isend (void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc)=0 |
virtual void | v_SendInit (void *buf, int count, CommDataType dt, int dest, CommRequestSharedPtr request, int loc)=0 |
virtual void | v_Irecv (void *buf, int count, CommDataType dt, int source, CommRequestSharedPtr request, int loc)=0 |
virtual void | v_RecvInit (void *buf, int count, CommDataType dt, int source, CommRequestSharedPtr request, int loc)=0 |
virtual void | v_StartAll (CommRequestSharedPtr request)=0 |
virtual void | v_WaitAll (CommRequestSharedPtr request)=0 |
virtual CommRequestSharedPtr | v_CreateRequest (int num)=0 |
virtual void | v_SplitComm (int pRows, int pColumns, int pTime)=0 |
virtual CommSharedPtr | v_CommCreateIf (int flag)=0 |
virtual std::pair< CommSharedPtr, CommSharedPtr > | v_SplitCommNode () |
Protected Attributes | |
MPI_Comm | m_comm |
int | m_rank {} |
bool | m_controls_mpi |
Protected Attributes inherited from Nektar::LibUtilities::Comm | |
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... | |
CommSharedPtr | m_commTime |
CommSharedPtr | m_commSpace |
Nektar::LibUtilities::CommMpi::CommMpi | ( | int | narg, |
char * | arg[] | ||
) |
Definition at line 50 of file CommMpi.cpp.
References ASSERTL0, Nektar::ErrorUtil::ewarning, m_comm, m_controls_mpi, m_rank, Nektar::LibUtilities::Comm::m_size, Nektar::LibUtilities::Comm::m_type, and NEKERROR.
Referenced by v_CommCreateIf(), v_SplitComm(), and v_SplitCommNode().
|
override |
Definition at line 104 of file CommMpi.cpp.
References m_comm.
|
explicitprotected |
Definition at line 92 of file CommMpi.cpp.
References m_comm, m_rank, Nektar::LibUtilities::Comm::m_size, and Nektar::LibUtilities::Comm::m_type.
|
inlinestatic |
Creates an instance of this class.
Definition at line 93 of file CommMpi.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr().
MPI_Comm Nektar::LibUtilities::CommMpi::GetComm | ( | ) |
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 288 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 313 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 300 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 232 of file CommMpi.cpp.
References ASSERTL0, Nektar::LibUtilities::Comm::GetSize(), m_comm, Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, and Nektar::LibUtilities::ReduceSum.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 262 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 274 of file CommMpi.cpp.
|
finalprotectedvirtual |
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 178 of file CommMpi.cpp.
References m_comm.
|
finalprotectedvirtual |
Create a new communicator if the flag is non-zero.
Implements Nektar::LibUtilities::Comm.
Definition at line 550 of file CommMpi.cpp.
References CommMpi(), and m_comm.
Referenced by v_SplitCommNode().
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 484 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 361 of file CommMpi.cpp.
|
overrideprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 125 of file CommMpi.cpp.
References m_controls_mpi.
Referenced by Nektar::LibUtilities::CommCwipi::v_Finalise().
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 335 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 141 of file CommMpi.cpp.
References m_rank.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 165 of file CommMpi.cpp.
References ASSERTL0.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 435 of file CommMpi.cpp.
References CG_Iterations::loc, and m_comm.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 402 of file CommMpi.cpp.
References CG_Iterations::loc, and m_comm.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 413 of file CommMpi.cpp.
References CG_Iterations::loc, and m_comm.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 157 of file CommMpi.cpp.
References Nektar::LibUtilities::Comm::m_size.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 381 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 209 of file CommMpi.cpp.
References m_comm.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 446 of file CommMpi.cpp.
References CG_Iterations::loc, and m_comm.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 348 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 194 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 424 of file CommMpi.cpp.
References CG_Iterations::loc, and m_comm.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 217 of file CommMpi.cpp.
|
overrideprotectedvirtual |
Processes are considered as a grid of size pRows*pColumns. Comm objects are created corresponding to the rows and columns of this grid. The row and column to which this process belongs is stored in m_commRow and m_commColumn.
Implements Nektar::LibUtilities::Comm.
Definition at line 495 of file CommMpi.cpp.
References ASSERTL0, CommMpi(), m_comm, Nektar::LibUtilities::Comm::m_commColumn, Nektar::LibUtilities::Comm::m_commRow, Nektar::LibUtilities::Comm::m_commSpace, Nektar::LibUtilities::Comm::m_commTime, m_rank, and Nektar::LibUtilities::Comm::m_size.
|
finalprotectedvirtual |
Reimplemented from Nektar::LibUtilities::Comm.
Definition at line 573 of file CommMpi.cpp.
References ASSERTL0, CommMpi(), m_rank, and v_CommCreateIf().
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 457 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 149 of file CommMpi.cpp.
References m_rank.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 470 of file CommMpi.cpp.
|
finalprotectedvirtual |
Implements Nektar::LibUtilities::Comm.
Definition at line 186 of file CommMpi.cpp.
|
static |
Name of class.
|
protected |
Definition at line 107 of file CommMpi.h.
Referenced by Nektar::LibUtilities::CommCwipi::CommCwipi(), CommMpi(), GetComm(), v_AllGather(), v_AllGatherv(), v_AllReduce(), v_AlltoAll(), v_AlltoAllv(), v_Bcast(), v_Block(), v_CommCreateIf(), v_DistGraphCreateAdjacent(), v_Gather(), v_Irecv(), v_Irsend(), v_Isend(), v_NeighborAlltoAllv(), v_Recv(), v_RecvInit(), v_Scatter(), v_Send(), v_SendInit(), v_SendRecv(), v_SplitComm(), and ~CommMpi().
|
protected |
Definition at line 109 of file CommMpi.h.
Referenced by CommMpi(), and v_Finalise().
|
protected |
Definition at line 108 of file CommMpi.h.
Referenced by Nektar::LibUtilities::CommCwipi::CommCwipi(), CommMpi(), v_GetRank(), v_SplitComm(), v_SplitCommNode(), and v_TreatAsRankZero().