Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Nektar::LibUtilities::CommCwipi Class Reference

A global linear system. More...

#include <CommCwipi.h>

Inheritance diagram for Nektar::LibUtilities::CommCwipi:
[legend]

Public Member Functions

 CommCwipi (int narg, char *arg[])
 
 ~CommCwipi () override
 
- Public Member Functions inherited from Nektar::LibUtilities::CommMpi
 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 >
Gather (int rootProc, T &val)
 
template<class 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, CommSharedPtrSplitCommNode ()
 

Static Public Member Functions

static CommSharedPtr create (int narg, char *arg[])
 Creates an instance of this class. More...
 
- Static Public Member Functions inherited from Nektar::LibUtilities::CommMpi
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...
 
- Static Public Attributes inherited from Nektar::LibUtilities::CommMpi
static std::string className
 Name of class. More...
 

Protected Member Functions

void v_Finalise () override
 
- Protected Member Functions inherited from Nektar::LibUtilities::CommMpi
 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, CommSharedPtrv_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, CommSharedPtrv_SplitCommNode ()
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::LibUtilities::CommMpi
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
 

Detailed Description

A global linear system.

Definition at line 53 of file CommCwipi.h.

Constructor & Destructor Documentation

◆ CommCwipi()

Nektar::LibUtilities::CommCwipi::CommCwipi ( int  narg,
char *  arg[] 
)

Definition at line 53 of file CommCwipi.cpp.

53 : CommMpi(narg, arg)
54{
55 std::string localName = "";
56 for (int i = 0; i < narg; ++i)
57 {
58 if (!std::strcmp(arg[i], "--cwipi"))
59 {
60 localName = arg[i + 1];
61 }
62 }
63
64 // Initialise CWIPI and override MPI_COMM_WORLD communicator set in CommMPI
65 MPI_Comm localComm;
66 cwipi_init(MPI_COMM_WORLD, localName.c_str(), &localComm);
67 m_comm = localComm;
68
69 MPI_Comm_size(m_comm, &m_size);
70 MPI_Comm_rank(m_comm, &m_rank);
71
72#ifdef NEKTAR_USING_PETSC
73 PETSC_COMM_WORLD = m_comm;
74 PetscInitializeNoArguments();
75#endif
76 m_type = "Parallel MPI with CWIPI";
77}
int m_size
Number of processes.
Definition: Comm.h:175
std::string m_type
Type of communication.
Definition: Comm.h:176
CommMpi(int narg, char *arg[])
Definition: CommMpi.cpp:50

References Nektar::LibUtilities::CommMpi::m_comm, Nektar::LibUtilities::CommMpi::m_rank, Nektar::LibUtilities::Comm::m_size, and Nektar::LibUtilities::Comm::m_type.

◆ ~CommCwipi()

Nektar::LibUtilities::CommCwipi::~CommCwipi ( )
override

Definition at line 82 of file CommCwipi.cpp.

83{
84}

Member Function Documentation

◆ create()

static CommSharedPtr Nektar::LibUtilities::CommCwipi::create ( int  narg,
char *  arg[] 
)
inlinestatic

Creates an instance of this class.

Definition at line 58 of file CommCwipi.h.

59 {
61 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ v_Finalise()

void Nektar::LibUtilities::CommCwipi::v_Finalise ( )
overrideprotectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 89 of file CommCwipi.cpp.

90{
91 cwipi_finalize();
93}
void v_Finalise() override
Definition: CommMpi.cpp:125

References Nektar::LibUtilities::CommMpi::v_Finalise().

Member Data Documentation

◆ className

std::string Nektar::LibUtilities::CommCwipi::className
static
Initial value:
"CWIPI", CommCwipi::create, "Parallel communication using MPI with CWIPI.")
static CommSharedPtr create(int narg, char *arg[])
Creates an instance of this class.
Definition: CommCwipi.h:58
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
CommFactory & GetCommFactory()

Name of class.

Definition at line 64 of file CommCwipi.h.