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

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

virtual void v_Finalise ()
 
- Protected Member Functions inherited from Nektar::LibUtilities::CommMpi
 CommMpi (MPI_Comm pComm)
 
 CommMpi ()
 
virtual int v_GetRank ()
 
virtual void v_Block ()
 
virtual double v_Wtime ()
 
virtual bool v_TreatAsRankZero (void)
 
virtual bool v_IsSerial (void)
 
virtual void v_Send (void *buf, int count, CommDataType dt, int dest)
 
virtual void v_Recv (void *buf, int count, CommDataType dt, int source)
 
virtual void v_SendRecv (void *sendbuf, int sendcount, CommDataType sendtype, int dest, void *recvbuf, int recvcount, CommDataType recvtype, int source)
 
virtual void v_SendRecvReplace (void *buf, int count, CommDataType dt, int pSendProc, int pRecvProc)
 
virtual void v_AllReduce (void *buf, int count, CommDataType dt, enum ReduceOperator pOp)
 
virtual void v_AlltoAll (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype)
 
virtual void v_AlltoAllv (void *sendbuf, int sendcounts[], int sensdispls[], CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype)
 
virtual void v_AllGather (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype)
 
virtual void v_AllGatherv (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype)
 
virtual void v_AllGatherv (void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype)
 
virtual void v_Bcast (void *buffer, int count, CommDataType dt, int root)
 
virtual void v_Exscan (Array< OneD, unsigned long long > &pData, const enum ReduceOperator pOp, Array< OneD, unsigned long long > &ans)
 
virtual void v_Gather (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root)
 
virtual void v_Scatter (void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root)
 
virtual void v_SplitComm (int pRows, int pColumns)
 
virtual CommSharedPtr v_CommCreateIf (int flag)
 
- Protected Member Functions inherited from Nektar::LibUtilities::Comm
 Comm ()
 
virtual bool v_RemoveExistingFiles (void)
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::LibUtilities::CommMpi
MPI_Comm m_comm
 
int m_rank
 
- 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...
 

Detailed Description

A global linear system.

Definition at line 55 of file CommCwipi.h.

Constructor & Destructor Documentation

◆ CommCwipi()

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

Definition at line 52 of file CommCwipi.cpp.

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

52  : CommMpi()
53 {
54  int init = 0;
55  MPI_Initialized(&init);
56  ASSERTL0(!init, "MPI has already been initialised.");
57 
58  int retval = MPI_Init(&narg, &arg);
59  if (retval != MPI_SUCCESS)
60  {
61  ASSERTL0(false, "Failed to initialise MPI");
62  }
63 
64  std::string localName = "";
65  for (int i = 0; i < narg; ++i)
66  {
67  if (!std::strcmp(arg[i], "--cwipi"))
68  {
69  localName = arg[i + 1];
70  }
71  }
72 
73  MPI_Comm localComm;
74  cwipi_init(MPI_COMM_WORLD, localName.c_str(), &localComm);
75  m_comm = localComm;
76 
77  MPI_Comm_size(m_comm, &m_size);
78  MPI_Comm_rank(m_comm, &m_rank);
79 
80  m_type = "Parallel MPI with CWIPI";
81 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::string m_type
Type of communication.
Definition: Comm.h:149
int m_size
Number of processes.
Definition: Comm.h:148

◆ ~CommCwipi()

Nektar::LibUtilities::CommCwipi::~CommCwipi ( )
virtual

Definition at line 86 of file CommCwipi.cpp.

87 {
88 }

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 60 of file CommCwipi.h.

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

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

◆ v_Finalise()

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

Reimplemented from Nektar::LibUtilities::CommMpi.

Definition at line 93 of file CommCwipi.cpp.

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

94 {
95  cwipi_finalize();
97 }

Member Data Documentation

◆ className

std::string Nektar::LibUtilities::CommCwipi::className
static
Initial value:
"CWIPI", CommCwipi::create, "Parallel communication using MPI with CWIPI.")

Name of class.

Definition at line 66 of file CommCwipi.h.