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 #ifndef SPMD_H
00039 #define SPMD_H
00040
00041 #include "REAL.H"
00042 #include "Vector.H"
00043 #include "Box.H"
00044 #include "MayDay.H"
00045 #include "RealVect.H"
00046 class IntVectSet;
00047
00048
00050
00054 int procID();
00055
00057
00060 unsigned int numProc();
00061
00062
00063 template <class T>
00064 int linearSize(const T& inputT);
00065
00066 template <class T>
00067 void linearIn(T& a_outputT, const void* const inBuf);
00068
00069 template <class T>
00070 void linearOut(void* const a_outBuf, const T& inputT);
00071
00072 #ifdef MPI
00073
00074
00088 template <class T>
00089 void gather(Vector<T>& a_outVec, const T& a_input, int a_dest);
00090
00091
00092
00093
00094
00095
00096
00097 #endif
00098
00100
00109 template <class T>
00110 void broadcast(T& a_inAndOut, int a_src);
00111
00112
00113 template < >
00114 int linearSize(const int& a_input);
00115
00116
00117 template < >
00118 void linearIn(int& a_outputT, const void* const inBuf);
00119
00120
00121 template < >
00122 void linearOut(void* const a_outBuf, const int& a_inputT);
00123
00124
00125 template < >
00126 int linearSize(const Real& a_input);
00127
00128
00129 template < >
00130 void linearIn(Real& a_outputT, const void* const a_inBuf);
00131
00132
00133 template < >
00134 void linearOut(void* const a_outBuf, const Real& a_inputT);
00135
00136
00137 template < >
00138 int linearSize(const Box& a_input);
00139
00140
00141 template < >
00142 void linearIn(Box& a_outputT, const void* const a_inBuf);
00143
00144
00145 template < >
00146 void linearOut(void* const a_outBuf, const Box& a_inputT);
00147
00148
00149 template < >
00150 int linearSize(const Vector<int>& a_input);
00151 template < >
00152 void linearIn(Vector<int>& a_outputT, const void* const inBuf);
00153 template < >
00154 void linearOut(void* const a_outBuf, const Vector<int>& a_inputT);
00155
00156
00157
00158 template < >
00159 int linearSize(const Vector<Real>& a_input);
00160 template < >
00161 void linearIn(Vector<Real>& a_outputT, const void* const inBuf);
00162 template < >
00163 void linearOut(void* const a_outBuf, const Vector<Real>& a_inputT);
00164
00165
00166 template < >
00167 int linearSize(const Vector<Box>& a_input);
00168 template < >
00169 void linearIn(Vector<Box>& a_outputT, const void* const inBuf);
00170 template < >
00171 void linearOut(void* const a_outBuf, const Vector<Box>& a_inputT);
00172
00173
00174 template < >
00175 int linearSize(const Vector<Vector<Box> >& a_input);
00176 template < >
00177 void linearIn(Vector<Vector<Box> >& a_outputT, const void* const inBuf);
00178 template < >
00179 void linearOut(void* const a_outBuf, const Vector<Vector<Box> >& a_inputT);
00180
00181
00182 template < >
00183 int linearSize(const RealVect& vindex);
00184
00185
00186 template < >
00187 void linearIn(RealVect& a_outputT, const void* const inBuf);
00188
00189
00190 template < >
00191 void linearOut(void* const a_outBuf, const RealVect& a_inputT);
00192
00193
00194
00195 template < >
00196 int linearSize(const Vector<Vector<int> >& a_input);
00197 template < >
00198 void linearIn(Vector<Vector<int> >& a_outputT, const void* const inBuf);
00199 template < >
00200 void linearOut(void* const a_outBuf, const Vector<Vector<int> >& a_inputT);
00201
00202
00203
00204
00205 template <class T>
00206 int linearListSize(const Vector<T>& a_input);
00207
00208
00209 template <class T>
00210 void linearListIn(Vector<T>& a_outputT, const void* const a_inBuf);
00211
00212
00213 template <class T>
00214 void linearListOut(void* const a_outBuf, const Vector<T>& a_inputT);
00215
00216 class SerialTask
00217 {
00218 public:
00219 enum task { compute=0 };
00220 };
00221
00222
00223 int
00224 uniqueProc(const SerialTask::task& a_task);
00225
00226 #ifdef MPI
00227 #include <mpi.h>
00228 struct Chombo_MPI{ static MPI_Comm comm;};
00229 void setChomboMPIErrorHandler();
00230
00231 #else
00232
00233 extern int num_procs ;
00234 #endif
00235
00236 #include "SPMDI.H"
00237
00238 #endif // SPMD.H
00239