Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Nektar::LibUtilities::CommSerial Class Reference

A global linear system. More...

#include <CommSerial.h>

Inheritance diagram for Nektar::LibUtilities::CommSerial:
Inheritance graph
[legend]
Collaboration diagram for Nektar::LibUtilities::CommSerial:
Collaboration graph
[legend]

Public Member Functions

 CommSerial (int argc, char *argv[])
 
virtual ~CommSerial ()
 
- 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...
 
void Send (int pProc, Array< OneD, NekDouble > &pData)
 
void Send (int pProc, Array< OneD, int > &pData)
 
void Send (int pProc, std::vector< unsigned int > &pData)
 
void Recv (int pProc, Array< OneD, NekDouble > &pData)
 
void Recv (int pProc, Array< OneD, int > &pData)
 
void Recv (int pProc, std::vector< unsigned int > &pData)
 
void SendRecv (int pSendProc, Array< OneD, NekDouble > &pSendData, int pRecvProc, Array< OneD, NekDouble > &pRecvData)
 
void SendRecv (int pSendProc, Array< OneD, int > &pSendData, int pRecvProc, Array< OneD, int > &pRecvData)
 
void SendRecvReplace (int pSendProc, int pRecvProc, Array< OneD, NekDouble > &pSendData)
 
void SendRecvReplace (int pSendProc, int pRecvProc, Array< OneD, int > &pSendData)
 
void AllReduce (NekDouble &pData, enum ReduceOperator pOp)
 
void AllReduce (int &pData, enum ReduceOperator pOp)
 
void AllReduce (Array< OneD, NekDouble > &pData, enum ReduceOperator pOp)
 
void AllReduce (Array< OneD, int > &pData, enum ReduceOperator pOp)
 
void AllReduce (std::vector< unsigned int > &pData, enum ReduceOperator pOp)
 
void AlltoAll (Array< OneD, NekDouble > &pSendData, Array< OneD, NekDouble > &pRecvData)
 
void AlltoAll (Array< OneD, int > &pSendData, Array< OneD, int > &pRecvData)
 
void AlltoAllv (Array< OneD, NekDouble > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, NekDouble > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
 
void AlltoAllv (Array< OneD, int > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, int > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
 
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)
 

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

virtual void v_Finalise ()
 
virtual int v_GetRank ()
 
virtual bool v_TreatAsRankZero (void)
 
virtual void v_Block ()
 
virtual void v_Send (int pProc, Array< OneD, NekDouble > &pData)
 
virtual void v_Send (int pProc, Array< OneD, int > &pData)
 
virtual void v_Send (int pProc, std::vector< unsigned int > &pData)
 
virtual void v_Recv (int pProc, Array< OneD, NekDouble > &pData)
 
virtual void v_Recv (int pProc, Array< OneD, int > &pData)
 
virtual void v_Recv (int pProc, std::vector< unsigned int > &pData)
 
virtual void v_SendRecv (int pSendProc, Array< OneD, NekDouble > &pSendData, int pRecvProc, Array< OneD, NekDouble > &pRecvData)
 
virtual void v_SendRecv (int pSendProc, Array< OneD, int > &pSendData, int pRecvProc, Array< OneD, int > &pRecvData)
 
virtual void v_SendRecvReplace (int pSendProc, int pRecvProc, Array< OneD, NekDouble > &pSendData)
 
virtual void v_SendRecvReplace (int pSendProc, int pRecvProc, Array< OneD, int > &pSendData)
 
virtual void v_AllReduce (NekDouble &pData, enum ReduceOperator pOp)
 
virtual void v_AllReduce (int &pData, enum ReduceOperator pOp)
 
virtual void v_AllReduce (Array< OneD, NekDouble > &pData, enum ReduceOperator pOp)
 
virtual void v_AllReduce (Array< OneD, int > &pData, enum ReduceOperator pOp)
 
virtual void v_AllReduce (std::vector< unsigned int > &pData, enum ReduceOperator pOp)
 
virtual void v_AlltoAll (Array< OneD, NekDouble > &pSendData, Array< OneD, NekDouble > &pRecvData)
 
virtual void v_AlltoAll (Array< OneD, int > &pSendData, Array< OneD, int > &pRecvData)
 
virtual void v_AlltoAllv (Array< OneD, NekDouble > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, NekDouble > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
 
virtual void v_AlltoAllv (Array< OneD, int > &pSendData, Array< OneD, int > &pSendDataSizeMap, Array< OneD, int > &pSendDataOffsetMap, Array< OneD, int > &pRecvData, Array< OneD, int > &pRecvDataSizeMap, Array< OneD, int > &pRecvDataOffsetMap)
 
virtual void v_SplitComm (int pRows, int pColumns)
 
- Protected Member Functions inherited from Nektar::LibUtilities::Comm
 Comm ()
 
virtual bool v_RemoveExistingFiles (void)
 

Additional Inherited Members

- 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 CommSerial.h.

Constructor & Destructor Documentation

Nektar::LibUtilities::CommSerial::CommSerial ( int  argc,
char *  argv[] 
)

Definition at line 52 of file CommSerial.cpp.

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

52  :
53  Comm(argc, argv)
54  {
55 #ifdef NEKTAR_USING_PETSC
56  PetscInitializeNoArguments();
57 #endif
58  m_size = 1;
59  m_type = "Serial";
60  }
std::string m_type
Type of communication.
Definition: Comm.h:143
int m_size
Number of processes.
Definition: Comm.h:142
Nektar::LibUtilities::CommSerial::~CommSerial ( )
virtual

Definition at line 62 of file CommSerial.cpp.

63  {
64 
65  }

Member Function Documentation

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

Creates an instance of this class.

Definition at line 59 of file CommSerial.h.

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

60  {
62  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::LibUtilities::CommSerial::v_AllReduce ( NekDouble pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 196 of file CommSerial.cpp.

197  {
198 
199  }
void Nektar::LibUtilities::CommSerial::v_AllReduce ( int &  pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 205 of file CommSerial.cpp.

206  {
207 
208  }
void Nektar::LibUtilities::CommSerial::v_AllReduce ( Array< OneD, NekDouble > &  pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 214 of file CommSerial.cpp.

215  {
216 
217  }
void Nektar::LibUtilities::CommSerial::v_AllReduce ( Array< OneD, int > &  pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 223 of file CommSerial.cpp.

224  {
225 
226  }
void Nektar::LibUtilities::CommSerial::v_AllReduce ( std::vector< unsigned int > &  pData,
enum ReduceOperator  pOp 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 232 of file CommSerial.cpp.

233  {
234 
235  }
void Nektar::LibUtilities::CommSerial::v_AlltoAll ( Array< OneD, NekDouble > &  pSendData,
Array< OneD, NekDouble > &  pRecvData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 241 of file CommSerial.cpp.

242  {
243 
244  }
void Nektar::LibUtilities::CommSerial::v_AlltoAll ( Array< OneD, int > &  pSendData,
Array< OneD, int > &  pRecvData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 250 of file CommSerial.cpp.

251  {
252 
253  }
void Nektar::LibUtilities::CommSerial::v_AlltoAllv ( Array< OneD, NekDouble > &  pSendData,
Array< OneD, int > &  pSendDataSizeMap,
Array< OneD, int > &  pSendDataOffsetMap,
Array< OneD, NekDouble > &  pRecvData,
Array< OneD, int > &  pRecvDataSizeMap,
Array< OneD, int > &  pRecvDataOffsetMap 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 259 of file CommSerial.cpp.

265  {
266 
267  }
void Nektar::LibUtilities::CommSerial::v_AlltoAllv ( Array< OneD, int > &  pSendData,
Array< OneD, int > &  pSendDataSizeMap,
Array< OneD, int > &  pSendDataOffsetMap,
Array< OneD, int > &  pRecvData,
Array< OneD, int > &  pRecvDataSizeMap,
Array< OneD, int > &  pRecvDataOffsetMap 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 273 of file CommSerial.cpp.

279  {
280 
281  }
void Nektar::LibUtilities::CommSerial::v_Block ( )
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 98 of file CommSerial.cpp.

99  {
100  }
void Nektar::LibUtilities::CommSerial::v_Finalise ( )
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 70 of file CommSerial.cpp.

71  {
72 #ifdef NEKTAR_USING_PETSC
73  PetscFinalize();
74 #endif
75  }
int Nektar::LibUtilities::CommSerial::v_GetRank ( void  )
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Reimplemented in Nektar::Utilities::FieldConvertComm.

Definition at line 80 of file CommSerial.cpp.

81  {
82  return 0;
83  }
void Nektar::LibUtilities::CommSerial::v_Recv ( int  pProc,
Array< OneD, NekDouble > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 114 of file CommSerial.cpp.

115  {
116  }
void Nektar::LibUtilities::CommSerial::v_Recv ( int  pProc,
Array< OneD, int > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 130 of file CommSerial.cpp.

131  {
132  }
void Nektar::LibUtilities::CommSerial::v_Recv ( int  pProc,
std::vector< unsigned int > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 146 of file CommSerial.cpp.

147  {
148  }
void Nektar::LibUtilities::CommSerial::v_Send ( int  pProc,
Array< OneD, NekDouble > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 106 of file CommSerial.cpp.

107  {
108  }
void Nektar::LibUtilities::CommSerial::v_Send ( int  pProc,
Array< OneD, int > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 122 of file CommSerial.cpp.

123  {
124  }
void Nektar::LibUtilities::CommSerial::v_Send ( int  pProc,
std::vector< unsigned int > &  pData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 138 of file CommSerial.cpp.

139  {
140  }
void Nektar::LibUtilities::CommSerial::v_SendRecv ( int  pSendProc,
Array< OneD, NekDouble > &  pSendData,
int  pRecvProc,
Array< OneD, NekDouble > &  pRecvData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 154 of file CommSerial.cpp.

158  {
159  }
void Nektar::LibUtilities::CommSerial::v_SendRecv ( int  pSendProc,
Array< OneD, int > &  pSendData,
int  pRecvProc,
Array< OneD, int > &  pRecvData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 165 of file CommSerial.cpp.

169  {
170  }
void Nektar::LibUtilities::CommSerial::v_SendRecvReplace ( int  pSendProc,
int  pRecvProc,
Array< OneD, NekDouble > &  pSendData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 176 of file CommSerial.cpp.

179  {
180  }
void Nektar::LibUtilities::CommSerial::v_SendRecvReplace ( int  pSendProc,
int  pRecvProc,
Array< OneD, int > &  pSendData 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Definition at line 186 of file CommSerial.cpp.

189  {
190  }
void Nektar::LibUtilities::CommSerial::v_SplitComm ( int  pRows,
int  pColumns 
)
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Reimplemented in Nektar::Utilities::FieldConvertComm.

Definition at line 287 of file CommSerial.cpp.

References ASSERTL0.

288  {
289  ASSERTL0(false, "Cannot split a serial process.");
290  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
bool Nektar::LibUtilities::CommSerial::v_TreatAsRankZero ( void  )
protectedvirtual

Implements Nektar::LibUtilities::Comm.

Reimplemented in Nektar::Utilities::FieldConvertComm.

Definition at line 89 of file CommSerial.cpp.

90  {
91  return true;
92  }

Member Data Documentation

std::string Nektar::LibUtilities::CommSerial::className
static
Initial value:
"Serial",
"Single-process serial communication.")

Name of class.

Definition at line 65 of file CommSerial.h.