00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #ifndef _SPMD_H_
00063 #define _SPMD_H_
00064
00065 #include "REAL.H"
00066 #include "Vector.H"
00067 #include "Box.H"
00068 #include "MayDay.H"
00069 #include "RealVect.H"
00070
00071 class IntVectSet;
00072
00074
00078 int procID();
00079
00081
00084 unsigned int numProc();
00085
00087
00089 void barrier(void);
00090
00091 template <class T>
00092 int linearSize(const T& inputT);
00093
00094 template <class T>
00095 void linearIn(T& a_outputT, const void* const inBuf);
00096
00097 template <class T>
00098 void linearOut(void* const a_outBuf, const T& inputT);
00099
00100 #ifdef CH_MPI
00101
00102
00116 template <class T>
00117 void gather(Vector<T>& a_outVec, const T& a_input, int a_dest);
00118
00119
00120
00121
00122
00123
00124
00125 #endif
00126
00128
00137 template <class T>
00138 void broadcast(T& a_inAndOut, int a_src);
00139
00140
00141 template < >
00142 int linearSize(const int& a_input);
00143
00144
00145 template < >
00146 void linearIn(int& a_outputT, const void* const inBuf);
00147
00148
00149 template < >
00150 void linearOut(void* const a_outBuf, const int& a_inputT);
00151
00152
00153 template < >
00154 int linearSize(const long& a_input);
00155
00156
00157 template < >
00158 void linearIn(long& a_outputT, const void* const inBuf);
00159
00160
00161 template < >
00162 void linearOut(void* const a_outBuf, const long& a_inputT);
00163
00164
00165 template < >
00166 int linearSize(const unsigned long& a_input);
00167
00168
00169 template < >
00170 void linearIn(unsigned long& a_outputT, const void* const inBuf);
00171
00172
00173 template < >
00174 void linearOut(void* const a_outBuf, const unsigned long& a_inputT);
00175
00176
00177 template < >
00178 int linearSize(const float& a_input);
00179
00180 template < >
00181 int linearSize(const double& a_input);
00182
00183
00184 template < >
00185 void linearIn(float& a_outputT, const void* const a_inBuf);
00186
00187 template < >
00188 void linearIn(double& a_outputT, const void* const a_inBuf);
00189
00190
00191 template < >
00192 void linearOut(void* const a_outBuf, const float& a_inputT);
00193
00194 template < >
00195 void linearOut(void* const a_outBuf, const double& a_inputT);
00196
00197
00198 template < >
00199 int linearSize(const Box& a_input);
00200
00201
00202 template < >
00203 void linearIn(Box& a_outputT, const void* const a_inBuf);
00204
00205
00206 template < >
00207 void linearOut(void* const a_outBuf, const Box& a_inputT);
00208
00209
00210 template < >
00211 int linearSize(const Vector<int>& a_input);
00212 template < >
00213 void linearIn(Vector<int>& a_outputT, const void* const inBuf);
00214 template < >
00215 void linearOut(void* const a_outBuf, const Vector<int>& a_inputT);
00216
00217
00218 template < >
00219 int linearSize(const Vector<long>& a_input);
00220 template < >
00221 void linearIn(Vector<long>& a_outputT, const void* const inBuf);
00222 template < >
00223 void linearOut(void* const a_outBuf, const Vector<long>& a_inputT);
00224
00225
00226 template < >
00227 int linearSize(const Vector<float>& a_input);
00228 template < >
00229 void linearIn(Vector<float>& a_outputT, const void* const inBuf);
00230 template < >
00231 void linearOut(void* const a_outBuf, const Vector<float>& a_inputT);
00232
00233 template < >
00234 int linearSize(const Vector<double>& a_input);
00235 template < >
00236 void linearIn(Vector<double>& a_outputT, const void* const inBuf);
00237 template < >
00238 void linearOut(void* const a_outBuf, const Vector<double>& a_inputT);
00239
00240
00241 template < >
00242 int linearSize(const Vector<Box>& a_input);
00243 template < >
00244 void linearIn(Vector<Box>& a_outputT, const void* const inBuf);
00245 template < >
00246 void linearOut(void* const a_outBuf, const Vector<Box>& a_inputT);
00247
00248
00249 template < >
00250 int linearSize(const Vector<Vector<Box> >& a_input);
00251 template < >
00252 void linearIn(Vector<Vector<Box> >& a_outputT, const void* const inBuf);
00253 template < >
00254 void linearOut(void* const a_outBuf, const Vector<Vector<Box> >& a_inputT);
00255
00256
00257 template < >
00258 int linearSize(const RealVect& vindex);
00259
00260
00261 template < >
00262 void linearIn(RealVect& a_outputT, const void* const inBuf);
00263
00264
00265 template < >
00266 void linearOut(void* const a_outBuf, const RealVect& a_inputT);
00267
00268
00269 template < >
00270 int linearSize(const Vector<Vector<int> >& a_input);
00271 template < >
00272 void linearIn(Vector<Vector<int> >& a_outputT, const void* const inBuf);
00273 template < >
00274 void linearOut(void* const a_outBuf, const Vector<Vector<int> >& a_inputT);
00275
00276
00277 template <class T>
00278 int linearListSize(const Vector<T>& a_input);
00279
00280
00281 template <class T>
00282 void linearListIn(Vector<T>& a_outputT, const void* const a_inBuf);
00283
00284
00285 template <class T>
00286 void linearListOut(void* const a_outBuf, const Vector<T>& a_inputT);
00287
00288 class SerialTask
00289 {
00290 public:
00291 enum task { compute=0 };
00292 };
00293
00294
00295 int
00296 uniqueProc(const SerialTask::task& a_task);
00297
00298 #ifdef CH_MPI
00299 #include <mpi.h>
00300 struct Chombo_MPI{ static MPI_Comm comm;};
00301 void setChomboMPIErrorHandler();
00302
00303 #else
00304
00305 extern int num_procs ;
00306 #endif
00307
00308 #include "SPMDI.H"
00309
00310 #endif