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