diff options
author | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2001-06-12 22:37:51 +0000 |
---|---|---|
committer | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2001-06-12 22:37:51 +0000 |
commit | d7ef9dc3eb2dec7f338d77bcd435a4e86d386529 (patch) | |
tree | 4b132737e59473bb5808cd4c82012c580b0d93d9 /src/include | |
parent | dac533161647369d074064828e5589f591a57594 (diff) |
Now PUGH also supports all the fixed-precision CCTK datatypes.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@334 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/pGH.h | 29 | ||||
-rw-r--r-- | src/include/pugh.h | 84 |
2 files changed, 61 insertions, 52 deletions
diff --git a/src/include/pGH.h b/src/include/pGH.h index f6e6999..2648c46 100644 --- a/src/include/pGH.h +++ b/src/include/pGH.h @@ -2,10 +2,10 @@ @header pGH.h @date Fri Feb 21 10:12:58 1997 @author Tom Goodale, Paul Walker - @desc - The Pugh Grid Hierarchy structure. - @enddesc - @version $Header$ + @desc + The Pugh Grid Hierarchy structure. + @enddesc + @version $Header$ @@*/ #include "pugh_constants.h" @@ -36,13 +36,7 @@ typedef struct PGH int forceSync; /* force synchronisation of GFs with storage */ - - /* Coordinate information */ - CCTK_REAL dx0, dy0, dz0, dt0; /* Delta of our system */ - CCTK_REAL lx0, ly0, lz0; /* Processor-Local coordinate origins */ - int GHiteration; /* iteration number on processor */ - - /* Indentification for a pGH */ + /* Identification for a pGH */ int level; /* level in Berger-Oliger stack */ int mglevel; /* level in multigrid stack */ int convlevel; /* level in convergence stack */ @@ -55,8 +49,10 @@ typedef struct PGH int comm_time; /* time spent in communication */ #ifdef CCTK_MPI - MPI_Datatype PUGH_mpi_complex;/* the MPI datatype for COMPLEX types */ - MPI_Datatype PUGH_mpi_complex8;/* same for single precision COMPLEX types */ + MPI_Datatype PUGH_mpi_complex;/* MPI datatype for generic CCTK_COMPLEX type */ + MPI_Datatype PUGH_mpi_complex8;/* same for fixed-precision CCTK_COMPLEX */ + MPI_Datatype PUGH_mpi_complex16; + MPI_Datatype PUGH_mpi_complex32; MPI_Comm PUGH_COMM_WORLD; /* the MPI communicator */ #ifdef PUGH_WITH_DERIVED_DATATYPES @@ -79,10 +75,3 @@ typedef struct PGH char *identity_string; /* identifier for this pGH */ } pGH; - -#define XDP 1 -#define XDM 0 -#define YDP 3 -#define YDM 2 -#define ZDP 5 -#define ZDM 4 diff --git a/src/include/pugh.h b/src/include/pugh.h index 17be0da..4f537e0 100644 --- a/src/include/pugh.h +++ b/src/include/pugh.h @@ -16,52 +16,72 @@ #include "cctk.h" -/* FIXME */ -/* 3 ways up shutting down: */ -/* -#define STOP cshutdown(0); -#define ABORT cabort(0); -#define CORE ccore(); -*/ -#define STOP exit(0); -#define ABORT exit(1); -#define CORE exit(2); - -/* Two ways to shut down with a non-zero exit code. */ -#define ERROR_STOP(xerrcode) cshutdown(xerrcode); -#define ERROR_ABORT(xerrcode) cabort(xerrcode); - #ifdef CCTK_MPI #include "mpi.h" #endif /*** Define the different datatypes used for MPI communication - NOTE: the complex datatype is defined in SetupPGH.c + NOTE: the complex datatype is defined dynamically at runtime in SetupPGH.c ***/ /* char type is easy */ #define PUGH_MPI_CHAR MPI_CHAR -/* floating points are precision-dependent */ -#define PUGH_MPI_REAL4 MPI_FLOAT -#ifdef SINGLE_PRECISION -#define PUGH_MPI_REAL MPI_FLOAT -#else -#define PUGH_MPI_REAL MPI_DOUBLE +/* floating point types are architecture-independent, + ie. a float has always 4 bytes, and a double has 8 bytes + + PUGH_MPI_REAL is used for communicating reals of the generic CCTK_REAL type + PUGH_MPI_REALn is used to explicitely communicate n-byte reals */ +#ifdef CCTK_REAL4 +#define PUGH_MPI_REAL4 MPI_FLOAT +#endif +#ifdef CCTK_REAL8 +#define PUGH_MPI_REAL8 MPI_DOUBLE +#endif +#ifdef CCTK_REAL16 +#define PUGH_MPI_REAL16 (sizeof (CCTK_REAL16) == sizeof (long double) ? \ + MPI_LONG_DOUBLE : MPI_DATATYPE_NULL) +#endif + + +#ifdef CCTK_REAL_PRECISION_16 +#define PUGH_MPI_REAL PUGH_MPI_REAL16 +#elif CCTK_REAL_PRECISION_8 +#define PUGH_MPI_REAL PUGH_MPI_REAL8 +#elif CCTK_REAL_PRECISION_4 +#define PUGH_MPI_REAL PUGH_MPI_REAL4 +#endif + + +/* integer types are architecture-dependent: + PUGH_MPI_INT is used for communicating integers of the generic CCTK_INT type + PUGH_MPI_INTn is used to explicitely communicate n-byte integers */ +#ifdef CCTK_INT8 +#define PUGH_MPI_INT8 (sizeof (CCTK_INT8) == sizeof (int) ? MPI_INT : \ + sizeof (CCTK_INT8) == sizeof (long) ? MPI_LONG : \ + sizeof (CCTK_INT8) == sizeof (long long) ? \ + MPI_LONG_LONG_INT : MPI_DATATYPE_NULL) +#endif + +#ifdef CCTK_INT4 +#define PUGH_MPI_INT4 (sizeof (CCTK_INT4) == sizeof (int) ? MPI_INT : \ + sizeof (CCTK_INT4) == sizeof (short) ? MPI_SHORT : \ + MPI_DATATYPE_NULL) +#endif + +#ifdef CCTK_INT2 +#define PUGH_MPI_INT2 (sizeof (CCTK_INT2) == sizeof (short) ? MPI_SHORT : \ + MPI_DATATYPE_NULL) #endif -/* integers are architecture specific: - PUGH_MPI_INT is used for communicating CCTK_INTs - PUGH_MPI_INT4 is used to explicitely communicate 4 byte integers */ -#ifdef CCTK_INTEGER_PRECISION_8 -#define PUGH_MPI_INT (sizeof (int) == 8 ? MPI_INT : MPI_LONG) -#elif CCTK_INTEGER_PRECISION_4 -#define PUGH_MPI_INT (sizeof (int) == 8 ? MPI_SHORT : MPI_INT) -#elif CCTK_INTEGER_PRECISION_2 -#define PUGH_MPI_INT MPI_SHORT +#ifdef CCTK_INTEGER_PRECISION_8 +#define PUGH_MPI_INT PUGH_MPI_INT8 +#elif CCTK_INTEGER_PRECISION_4 +#define PUGH_MPI_INT PUGH_MPI_INT4 +#elif CCTK_INTEGER_PRECISION_2 +#define PUGH_MPI_INT PUGH_MPI_INT2 #endif -#define PUGH_MPI_INT4 (sizeof (int) == 8 ? MPI_SHORT : MPI_INT) #define HEREINPUGH printf("I'm in %s at line %d\n",__FILE__,__LINE__); |