aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/dist.hh
diff options
context:
space:
mode:
authorschnetter <>2004-03-01 17:43:00 +0000
committerschnetter <>2004-03-01 17:43:00 +0000
commitb85f87f0480e3cc4e381d0a3e7e7ecb53f4ec1cd (patch)
tree2bf4eea58d29b51994c32b0a8dd6186b5ed60384 /Carpet/CarpetLib/src/dist.hh
parent174dd6e9d842b69361fb2014c5b7d0e4f16c4430 (diff)
Create MPI data types for Cactus types instead of C++ types.
darcs-hash:20040301174339-07bb3-7063bdae71cf7c6a4ff6b39692aeb2fa02a800c3.gz
Diffstat (limited to 'Carpet/CarpetLib/src/dist.hh')
-rw-r--r--Carpet/CarpetLib/src/dist.hh31
1 files changed, 30 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/dist.hh b/Carpet/CarpetLib/src/dist.hh
index cb3d422ca..ab89ae580 100644
--- a/Carpet/CarpetLib/src/dist.hh
+++ b/Carpet/CarpetLib/src/dist.hh
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dist.hh,v 1.9 2003/11/05 16:18:39 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dist.hh,v 1.10 2004/03/01 19:43:39 schnetter Exp $
#ifndef DIST_HH
#define DIST_HH
@@ -11,6 +11,8 @@
#include <mpi.h>
+#include "cctk.h"
+
#include "defs.hh"
using namespace std;
@@ -21,9 +23,15 @@ namespace dist {
extern MPI_Comm comm;
+#if 0
extern MPI_Datatype mpi_complex_float;
extern MPI_Datatype mpi_complex_double;
extern MPI_Datatype mpi_complex_long_double;
+#else
+ extern MPI_Datatype mpi_complex8;
+ extern MPI_Datatype mpi_complex16;
+ extern MPI_Datatype mpi_complex32;
+#endif
void init (int& argc, char**& argv);
void pseudoinit ();
@@ -75,6 +83,8 @@ namespace dist {
inline MPI_Datatype datatype (const long double& dummy)
{ return MPI_LONG_DOUBLE; }
+#if 0
+
inline MPI_Datatype datatype (const complex<float>& dummy)
{ return mpi_complex_float; }
@@ -84,6 +94,25 @@ namespace dist {
inline MPI_Datatype datatype (const complex<long double>& dummy)
{ return mpi_complex_long_double; }
+#else
+
+# ifdef CCTK_REAL4
+ inline MPI_Datatype datatype (const CCTK_COMPLEX8& dummy)
+ { return mpi_complex8; }
+# endif
+
+# ifdef CCTK_REAL8
+ inline MPI_Datatype datatype (const CCTK_COMPLEX16& dummy)
+ { return mpi_complex16; }
+# endif
+
+# ifdef CCTK_REAL16
+ inline MPI_Datatype datatype (const CCTK_COMPLEX32& dummy)
+ { return mpi_complex32; }
+# endif
+
+#endif
+
} // namespace dist