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 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 float& a_input);
00155
00156 template < >
00157 int linearSize(const double& a_input);
00158
00159
00160 template < >
00161 void linearIn(float& a_outputT, const void* const a_inBuf);
00162
00163 template < >
00164 void linearIn(double& a_outputT, const void* const a_inBuf);
00165
00166
00167 template < >
00168 void linearOut(void* const a_outBuf, const float& a_inputT);
00169
00170 template < >
00171 void linearOut(void* const a_outBuf, const double& a_inputT);
00172
00173
00174 template < >
00175 int linearSize(const Box& a_input);
00176
00177
00178 template < >
00179 void linearIn(Box& a_outputT, const void* const a_inBuf);
00180
00181
00182 template < >
00183 void linearOut(void* const a_outBuf, const Box& a_inputT);
00184
00185
00186 template < >
00187 int linearSize(const Vector<int>& a_input);
00188 template < >
00189 void linearIn(Vector<int>& a_outputT, const void* const inBuf);
00190 template < >
00191 void linearOut(void* const a_outBuf, const Vector<int>& a_inputT);
00192
00193
00194 template < >
00195 int linearSize(const Vector<float>& a_input);
00196 template < >
00197 void linearIn(Vector<float>& a_outputT, const void* const inBuf);
00198 template < >
00199 void linearOut(void* const a_outBuf, const Vector<float>& a_inputT);
00200
00201 template < >
00202 int linearSize(const Vector<double>& a_input);
00203 template < >
00204 void linearIn(Vector<double>& a_outputT, const void* const inBuf);
00205 template < >
00206 void linearOut(void* const a_outBuf, const Vector<double>& a_inputT);
00207
00208
00209 template < >
00210 int linearSize(const Vector<Box>& a_input);
00211 template < >
00212 void linearIn(Vector<Box>& a_outputT, const void* const inBuf);
00213 template < >
00214 void linearOut(void* const a_outBuf, const Vector<Box>& a_inputT);
00215
00216
00217 template < >
00218 int linearSize(const Vector<Vector<Box> >& a_input);
00219 template < >
00220 void linearIn(Vector<Vector<Box> >& a_outputT, const void* const inBuf);
00221 template < >
00222 void linearOut(void* const a_outBuf, const Vector<Vector<Box> >& a_inputT);
00223
00224
00225 template < >
00226 int linearSize(const RealVect& vindex);
00227
00228
00229 template < >
00230 void linearIn(RealVect& a_outputT, const void* const inBuf);
00231
00232
00233 template < >
00234 void linearOut(void* const a_outBuf, const RealVect& a_inputT);
00235
00236
00237 template < >
00238 int linearSize(const Vector<Vector<int> >& a_input);
00239 template < >
00240 void linearIn(Vector<Vector<int> >& a_outputT, const void* const inBuf);
00241 template < >
00242 void linearOut(void* const a_outBuf, const Vector<Vector<int> >& a_inputT);
00243
00244
00245 template <class T>
00246 int linearListSize(const Vector<T>& a_input);
00247
00248
00249 template <class T>
00250 void linearListIn(Vector<T>& a_outputT, const void* const a_inBuf);
00251
00252
00253 template <class T>
00254 void linearListOut(void* const a_outBuf, const Vector<T>& a_inputT);
00255
00256 class SerialTask
00257 {
00258 public:
00259 enum task { compute=0 };
00260 };
00261
00262
00263 int
00264 uniqueProc(const SerialTask::task& a_task);
00265
00266 #ifdef MPI
00267 #include <mpi.h>
00268 struct Chombo_MPI{ static MPI_Comm comm;};
00269 void setChomboMPIErrorHandler();
00270
00271 #else
00272
00273 extern int num_procs ;
00274 #endif
00275
00276 #include "SPMDI.H"
00277
00278 #endif