Nektar++
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Nektar::FieldUtils::FieldConvertComm Class Reference

#include <FieldConvertComm.hpp>

Inheritance diagram for Nektar::FieldUtils::FieldConvertComm:
[legend]

Public Member Functions

 FieldConvertComm (int argc, char *argv[], int size, int rank)
 
 FieldConvertComm (int size, int rank)
 
 ~FieldConvertComm () override
 
void v_SplitComm (int pRows, int pColumns, int pTime) override
 
- Public Member Functions inherited from Nektar::LibUtilities::CommSerial
 CommSerial (int argc, char *argv[])
 
 ~CommSerial () override
 
- 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 ()
 

Protected Member Functions

int v_GetRank (void) override
 
bool v_TreatAsRankZero (void) override
 
bool v_IsSerial (void) override
 
bool v_RemoveExistingFiles (void)
 
- Protected Member Functions inherited from Nektar::LibUtilities::CommSerial
void v_Finalise () final
 
int v_GetRank () override
 
bool v_TreatAsRankZero () override
 
bool v_IsSerial () override
 
std::tuple< int, int, int > v_GetVersion () final
 
void v_Block () final
 
NekDouble 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 sdispls[], 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
 
- 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 ()
 

Private Attributes

int m_rank
 

Additional Inherited Members

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

Definition at line 43 of file FieldConvertComm.hpp.

Constructor & Destructor Documentation

◆ FieldConvertComm() [1/2]

Nektar::FieldUtils::FieldConvertComm::FieldConvertComm ( int  argc,
char *  argv[],
int  size,
int  rank 
)
inline

Definition at line 46 of file FieldConvertComm.hpp.

47 : CommSerial(argc, argv)
48 {
49 m_size = size;
50 m_rank = rank;
51 m_type = "FieldConvert parallel";
52 }
int m_size
Number of processes.
Definition: Comm.h:175
std::string m_type
Type of communication.
Definition: Comm.h:176
CommSerial(int argc, char *argv[])
Definition: CommSerial.cpp:46

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

Referenced by v_SplitComm().

◆ FieldConvertComm() [2/2]

Nektar::FieldUtils::FieldConvertComm::FieldConvertComm ( int  size,
int  rank 
)
inline

Definition at line 53 of file FieldConvertComm.hpp.

53 : CommSerial(0, nullptr)
54 {
55 m_size = size;
56 m_rank = rank;
57 m_type = "FieldConvert parallel";
58 }

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

◆ ~FieldConvertComm()

Nektar::FieldUtils::FieldConvertComm::~FieldConvertComm ( )
inlineoverride

Definition at line 59 of file FieldConvertComm.hpp.

60 {
61 }

Member Function Documentation

◆ v_GetRank()

int Nektar::FieldUtils::FieldConvertComm::v_GetRank ( void  )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::LibUtilities::CommSerial.

Definition at line 74 of file FieldConvertComm.hpp.

75 {
76 return m_rank;
77 }

References m_rank.

◆ v_IsSerial()

bool Nektar::FieldUtils::FieldConvertComm::v_IsSerial ( void  )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::LibUtilities::CommSerial.

Definition at line 84 of file FieldConvertComm.hpp.

85 {
86 return true;
87 }

◆ v_RemoveExistingFiles()

bool Nektar::FieldUtils::FieldConvertComm::v_RemoveExistingFiles ( void  )
inlineprotected

Definition at line 89 of file FieldConvertComm.hpp.

90 {
91 return false;
92 }

◆ v_SplitComm()

void Nektar::FieldUtils::FieldConvertComm::v_SplitComm ( int  pRows,
int  pColumns,
int  pTime 
)
inlineoverridevirtual

Reimplemented from Nektar::LibUtilities::CommSerial.

Definition at line 62 of file FieldConvertComm.hpp.

63 {
64 ASSERTL0(pTime == 1,
65 "FieldConvertComm does not support parallel in time!");
66 // Compute row and column in grid.
67 m_commRow = std::shared_ptr<FieldConvertComm>(
68 new FieldConvertComm(pColumns, m_rank));
70 std::shared_ptr<FieldConvertComm>(new FieldConvertComm(pRows, 0));
71 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
FieldConvertComm(int argc, char *argv[], int size, int rank)
CommSharedPtr m_commColumn
Column communicator.
Definition: Comm.h:178
CommSharedPtr m_commRow
Row communicator.
Definition: Comm.h:177

References ASSERTL0, FieldConvertComm(), Nektar::LibUtilities::Comm::m_commColumn, Nektar::LibUtilities::Comm::m_commRow, and m_rank.

◆ v_TreatAsRankZero()

bool Nektar::FieldUtils::FieldConvertComm::v_TreatAsRankZero ( void  )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::LibUtilities::CommSerial.

Definition at line 79 of file FieldConvertComm.hpp.

80 {
81 return true;
82 }

Member Data Documentation

◆ m_rank

int Nektar::FieldUtils::FieldConvertComm::m_rank
private

Definition at line 95 of file FieldConvertComm.hpp.

Referenced by FieldConvertComm(), v_GetRank(), and v_SplitComm().