Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CommSerial.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File CommSerial.cpp
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: Serial (= no) communication implementation
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifdef NEKTAR_USING_PETSC
37 #include "petscsys.h"
38 #endif
39 
41 
42 namespace Nektar
43 {
44  namespace LibUtilities
45  {
46  std::string CommSerial::className
48  "Serial",
50  "Single-process serial communication.");
51 
52  CommSerial::CommSerial(int argc, char* argv[]) :
53  Comm(argc, argv)
54  {
55 #ifdef NEKTAR_USING_PETSC
56  PetscInitializeNoArguments();
57 #endif
58  m_size = 1;
59  m_type = "Serial";
60  }
61 
63  {
64 
65  }
66 
67  /**
68  *
69  */
71  {
72 #ifdef NEKTAR_USING_PETSC
73  PetscFinalize();
74 #endif
75  }
76 
77  /**
78  *
79  */
81  {
82  return 0;
83  }
84 
85 
86  /**
87  *
88  */
90  {
91  return true;
92  }
93 
94 
95  /**
96  *
97  */
99  {
100  }
101 
102 
103  /**
104  *
105  */
107  {
108  }
109 
110 
111  /**
112  *
113  */
115  {
116  }
117 
118 
119  /**
120  *
121  */
122  void CommSerial::v_Send(int pProc, Array<OneD, int>& pData)
123  {
124  }
125 
126 
127  /**
128  *
129  */
130  void CommSerial::v_Recv(int pProc, Array<OneD, int>& pData)
131  {
132  }
133 
134 
135  /**
136  *
137  */
138  void CommSerial::v_Send(int pProc, std::vector<unsigned int>& pData)
139  {
140  }
141 
142 
143  /**
144  *
145  */
146  void CommSerial::v_Recv(int pProc, std::vector<unsigned int>& pData)
147  {
148  }
149 
150 
151  /**
152  *
153  */
154  void CommSerial::v_SendRecv(int pSendProc,
155  Array<OneD, NekDouble>& pSendData,
156  int pRecvProc,
157  Array<OneD, NekDouble>& pRecvData)
158  {
159  }
160 
161 
162  /**
163  *
164  */
165  void CommSerial::v_SendRecv(int pSendProc,
166  Array<OneD, int>& pSendData,
167  int pRecvProc,
168  Array<OneD, int>& pRecvData)
169  {
170  }
171 
172 
173  /**
174  *
175  */
176  void CommSerial::v_SendRecvReplace(int pSendProc,
177  int pRecvProc,
178  Array<OneD, NekDouble>& pSendData)
179  {
180  }
181 
182 
183  /**
184  *
185  */
186  void CommSerial::v_SendRecvReplace(int pSendProc,
187  int pRecvProc,
188  Array<OneD, int>& pSendData)
189  {
190  }
191 
192 
193  /**
194  *
195  */
197  {
198 
199  }
200 
201 
202  /**
203  *
204  */
205  void CommSerial::v_AllReduce(int& pData, enum ReduceOperator pOp)
206  {
207 
208  }
209 
210 
211  /**
212  *
213  */
215  {
216 
217  }
218 
219 
220  /**
221  *
222  */
224  {
225 
226  }
227 
228 
229  /**
230  *
231  */
232  void CommSerial::v_AllReduce(std::vector<unsigned int>& pData, enum ReduceOperator pOp)
233  {
234 
235  }
236 
237 
238  /**
239  *
240  */
242  {
243 
244  }
245 
246 
247  /**
248  *
249  */
251  {
252 
253  }
254 
255 
256  /**
257  *
258  */
260  Array<OneD, int>& pSendDataSizeMap,
261  Array<OneD, int>& pSendDataOffsetMap,
262  Array<OneD, NekDouble>& pRecvData,
263  Array<OneD, int>& pRecvDataSizeMap,
264  Array<OneD, int>& pRecvDataOffsetMap)
265  {
266 
267  }
268 
269 
270  /**
271  *
272  */
274  Array<OneD, int>& pSendDataSizeMap,
275  Array<OneD, int>& pSendDataOffsetMap,
276  Array<OneD, int>& pRecvData,
277  Array<OneD, int>& pRecvDataSizeMap,
278  Array<OneD, int>& pRecvDataOffsetMap)
279  {
280 
281  }
282 
283 
284  /**
285  *
286  */
287  void CommSerial::v_SplitComm(int pRows, int pColumns)
288  {
289  ASSERTL0(false, "Cannot split a serial process.");
290  }
291  }
292 }
virtual void v_SplitComm(int pRows, int pColumns)
Definition: CommSerial.cpp:287
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
virtual void v_SendRecvReplace(int pSendProc, int pRecvProc, Array< OneD, NekDouble > &pSendData)
Definition: CommSerial.cpp:176
ReduceOperator
Type of operation to perform in AllReduce.
Definition: Comm.h:65
virtual void v_Send(int pProc, Array< OneD, NekDouble > &pData)
Definition: CommSerial.cpp:106
virtual bool v_TreatAsRankZero(void)
Definition: CommSerial.cpp:89
virtual void v_Recv(int pProc, Array< OneD, NekDouble > &pData)
Definition: CommSerial.cpp:114
std::string m_type
Type of communication.
Definition: Comm.h:143
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)
Definition: CommSerial.cpp:259
CommFactory & GetCommFactory()
Definition: Comm.cpp:64
virtual void v_AlltoAll(Array< OneD, NekDouble > &pSendData, Array< OneD, NekDouble > &pRecvData)
Definition: CommSerial.cpp:241
static CommSharedPtr create(int narg, char *arg[])
Creates an instance of this class.
Definition: CommSerial.h:59
double NekDouble
Base communications class.
Definition: Comm.h:73
virtual void v_SendRecv(int pSendProc, Array< OneD, NekDouble > &pSendData, int pRecvProc, Array< OneD, NekDouble > &pRecvData)
Definition: CommSerial.cpp:154
CommSerial(int argc, char *argv[])
Definition: CommSerial.cpp:52
static std::string className
Name of class.
Definition: CommSerial.h:65
virtual void v_AllReduce(NekDouble &pData, enum ReduceOperator pOp)
Definition: CommSerial.cpp:196
int m_size
Number of processes.
Definition: Comm.h:142
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:215