00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef BL_CCSE_MPP
00024 #define BL_CCSE_MPP
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifdef BL_USE_MPI
00037 #include <winstd.H>
00038
00039 #include <mpi.h>
00040
00041 namespace ParallelDescriptor
00042 {
00043 template <class T>
00044 struct Mpi_typemap
00045 {
00046 static MPI_Datatype type();
00047 };
00048
00049
00050
00051 template <> MPI_Datatype Mpi_typemap<char>::type();
00052 template <> MPI_Datatype Mpi_typemap<short>::type();
00053 template <> MPI_Datatype Mpi_typemap<int>::type();
00054 template <> MPI_Datatype Mpi_typemap<long>::type();
00055 template <> MPI_Datatype Mpi_typemap<unsigned char>::type();
00056 template <> MPI_Datatype Mpi_typemap<unsigned short>::type();
00057 template <> MPI_Datatype Mpi_typemap<unsigned int>::type();
00058 template <> MPI_Datatype Mpi_typemap<unsigned long>::type();
00059 template <> MPI_Datatype Mpi_typemap<float>::type();
00060 template <> MPI_Datatype Mpi_typemap<double>::type();
00061
00062 struct Max { static MPI_Op op(); };
00063 struct Min { static MPI_Op op(); };
00064 struct Sum { static MPI_Op op(); };
00065 struct Prod { static MPI_Op op(); };
00066 struct Logical_And { static MPI_Op op(); };
00067 struct Boolean_And { static MPI_Op op(); };
00068 struct Logical_Or { static MPI_Op op(); };
00069 struct Boolean_Or { static MPI_Op op(); };
00070 struct Logical_XOr { static MPI_Op op(); };
00071 struct Boolean_XOr { static MPI_Op op(); };
00072 }
00073
00074
00075 #else
00076
00077 typedef int MPI_Op;
00078 typedef int MPI_Comm;
00079 typedef int MPI_Datatype;
00080 struct MPI_Status {};
00081 typedef int MPI_Request;
00082 const int MPI_REQUEST_NULL = 0;
00083 const int MPI_COMM_WORLD = 0;
00084
00085 namespace ParallelDescriptor
00086 {
00087 template <class T>
00088 struct Mpi_typemap
00089 {
00090 static MPI_Datatype type();
00091 };
00092 }
00093
00094 #endif
00095
00096 #endif