Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CommSerial.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File CommSerial.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: CommSerial header
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 #ifndef NEKTAR_LIB_UTILITIES_COMMSERIAL_H
36 #define NEKTAR_LIB_UTILITIES_COMMSERIAL_H
37 
38 #include <string>
39 
43 
44 namespace Nektar
45 {
46 namespace LibUtilities
47 {
48 // Forward declarations
49 class CommSerial;
50 
51 /// Pointer to a Communicator object.
52 typedef boost::shared_ptr<CommSerial> CommSerialSharedPtr;
53 
54 /// A global linear system.
55 class CommSerial : public Comm
56 {
57 public:
58  /// Creates an instance of this class
59  LIB_UTILITIES_EXPORT static CommSharedPtr create(int narg, char *arg[])
60  {
62  }
63 
64  /// Name of class
65  LIB_UTILITIES_EXPORT static std::string className;
66 
67  LIB_UTILITIES_EXPORT CommSerial(int argc, char *argv[]);
69 
70 protected:
71  LIB_UTILITIES_EXPORT virtual void v_Finalise();
72  LIB_UTILITIES_EXPORT virtual int v_GetRank();
73  LIB_UTILITIES_EXPORT virtual bool v_TreatAsRankZero(void);
74 
75  LIB_UTILITIES_EXPORT virtual void v_Block();
77  LIB_UTILITIES_EXPORT virtual void v_Send(void *buf, int count,
78  CommDataType dt, int dest);
79  LIB_UTILITIES_EXPORT virtual void v_Recv(void *buf, int count,
80  CommDataType dt, int source);
81  LIB_UTILITIES_EXPORT virtual void v_SendRecv(
82  void *sendbuf, int sendcount, CommDataType sendtype, int dest,
83  void *recvbuf, int recvcount, CommDataType recvtype, int source);
84  LIB_UTILITIES_EXPORT virtual void v_SendRecvReplace(void *buf, int count,
85  CommDataType dt,
86  int pSendProc,
87  int pRecvProc);
88  LIB_UTILITIES_EXPORT virtual void v_AllReduce(void *buf, int count,
89  CommDataType dt,
90  enum ReduceOperator pOp);
91  LIB_UTILITIES_EXPORT virtual void v_AlltoAll(void *sendbuf, int sendcount,
92  CommDataType sendtype,
93  void *recvbuf, int recvcount,
94  CommDataType recvtype);
95  LIB_UTILITIES_EXPORT virtual void v_AlltoAllv(
96  void *sendbuf, int sendcounts[], int sensdispls[],
97  CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[],
98  CommDataType recvtype);
99  LIB_UTILITIES_EXPORT virtual void v_Bcast(void *buffer, int count,
100  CommDataType dt, int root);
101  LIB_UTILITIES_EXPORT virtual void v_Exscan(
102  Array<OneD, unsigned long long> &pData, const enum ReduceOperator pOp,
104  LIB_UTILITIES_EXPORT virtual void v_Gather(void *sendbuf, int sendcount,
105  CommDataType sendtype,
106  void *recvbuf, int recvcount,
107  CommDataType recvtype, int root);
108  LIB_UTILITIES_EXPORT virtual void v_Scatter(void *sendbuf, int sendcount,
109  CommDataType sendtype,
110  void *recvbuf, int recvcount,
111  CommDataType recvtype,
112  int root);
113 
114  LIB_UTILITIES_EXPORT virtual void v_SplitComm(int pRows, int pColumns);
116 };
117 }
118 }
119 
120 #endif
virtual void v_SendRecvReplace(void *buf, int count, CommDataType dt, int pSendProc, int pRecvProc)
Definition: CommSerial.cpp:129
virtual void v_SplitComm(int pRows, int pColumns)
Definition: CommSerial.cpp:186
virtual void v_Exscan(Array< OneD, unsigned long long > &pData, const enum ReduceOperator pOp, Array< OneD, unsigned long long > &ans)
Definition: CommSerial.cpp:164
ReduceOperator
Type of operation to perform in AllReduce.
Definition: Comm.h:67
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual NekDouble v_Wtime()
Definition: CommSerial.cpp:98
virtual bool v_TreatAsRankZero(void)
Definition: CommSerial.cpp:83
array buffer
Definition: GsLib.hpp:60
virtual void v_AlltoAllv(void *sendbuf, int sendcounts[], int sensdispls[], CommDataType sendtype, void *recvbuf, int recvcounts[], int rdispls[], CommDataType recvtype)
Definition: CommSerial.cpp:153
boost::shared_ptr< CommSerial > CommSerialSharedPtr
Pointer to a Communicator object.
Definition: CommSerial.h:49
virtual void v_Send(void *buf, int count, CommDataType dt, int dest)
Definition: CommSerial.cpp:106
virtual void v_AlltoAll(void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype)
Definition: CommSerial.cpp:145
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
A global linear system.
Definition: CommSerial.h:55
#define LIB_UTILITIES_EXPORT
static CommSharedPtr create(int narg, char *arg[])
Creates an instance of this class.
Definition: CommSerial.h:59
virtual void v_Gather(void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root)
Definition: CommSerial.cpp:170
double NekDouble
virtual CommSharedPtr v_CommCreateIf(int flag)
Definition: CommSerial.cpp:194
virtual void v_Recv(void *buf, int count, CommDataType dt, int source)
Definition: CommSerial.cpp:113
virtual void v_Bcast(void *buffer, int count, CommDataType dt, int root)
Definition: CommSerial.cpp:160
Base communications class.
Definition: Comm.h:75
#define dest(otri, vertexptr)
CommSerial(int argc, char *argv[])
Definition: CommSerial.cpp:49
virtual void v_AllReduce(void *buf, int count, CommDataType dt, enum ReduceOperator pOp)
Definition: CommSerial.cpp:137
virtual void v_SendRecv(void *sendbuf, int sendcount, CommDataType sendtype, int dest, void *recvbuf, int recvcount, CommDataType recvtype, int source)
Definition: CommSerial.cpp:120
static std::string className
Name of class.
Definition: CommSerial.h:65
virtual void v_Scatter(void *sendbuf, int sendcount, CommDataType sendtype, void *recvbuf, int recvcount, CommDataType recvtype, int root)
Definition: CommSerial.cpp:177