aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--param.ccl4
-rw-r--r--src/Comm.c4
-rw-r--r--src/Reduction.c119
-rw-r--r--src/SetupGroup.c16
-rw-r--r--src/SetupPGF.c40
-rw-r--r--src/SetupPGH.c4
-rw-r--r--src/include/pGArray.h2
-rw-r--r--src/include/pGF.h6
-rw-r--r--src/include/pGH.h10
-rw-r--r--src/include/pughDriver.h4
-rw-r--r--src/pGF_FinishRecv.c4
-rw-r--r--src/pGF_PostSend.c6
-rw-r--r--src/pugh/SetupPGArray.c4
-rw-r--r--src/pugh/SetupPGF.c22
-rw-r--r--src/pugh/pGF_PostSend.c2
-rw-r--r--src/pugh/pGF_Reduction.c20
16 files changed, 135 insertions, 132 deletions
diff --git a/param.ccl b/param.ccl
index 90d7b0b..96de1f5 100644
--- a/param.ccl
+++ b/param.ccl
@@ -70,12 +70,12 @@ INTEGER padding_cacheline_bits "Number of bits which have to be unique to padd p
1:* :: "Any positive number"
} 12
-INTEGER padding_size "How many Doubles to pad by; we have to noodle around with the starting address, so if there isn't enough space we may not be able to pad"
+INTEGER padding_size "How many CCTK_REALs to pad by; we have to noodle around with the starting address, so if there isn't enough space we may not be able to pad"
{
0:* :: "Any positive number"
} 4112
-INTEGER padding_address_spacing "Number of Doubles to space starting addresses in lowest padding_cacheline_bits bits"
+INTEGER padding_address_spacing "Number of CCTK_REALs to space starting addresses in lowest padding_cacheline_bits bits"
{
0:* :: "Any positive number"
} 24
diff --git a/src/Comm.c b/src/Comm.c
index 422d13c..0233104 100644
--- a/src/Comm.c
+++ b/src/Comm.c
@@ -773,8 +773,8 @@ int pugh_SyncGroupGF (cGH *GH, int group, int vtype, int n_vars, int timelevel)
int first_var;
pGF *GF;
- if (vtype != VARIABLE_REAL) {
- CCTK_WARN (1, "Syncing of variable types other than VARIABLE_REAL not yet supported");
+ if (vtype != CCTK_VARIABLE_REAL) {
+ CCTK_WARN (1, "Syncing of variable types other than CCTK_VARIABLE_REAL not yet supported");
return (0);
}
diff --git a/src/Reduction.c b/src/Reduction.c
index f1b5ac3..10ab2ce 100644
--- a/src/Reduction.c
+++ b/src/Reduction.c
@@ -80,12 +80,12 @@ int pugh_ReduceMinVal (cGH *GH, int proc, int rettype, int numretvars,
void *retval_ptr;
switch (rettype) {
- case VARIABLE_REAL:
- extent = sizeof (Double); break;
- case VARIABLE_INTEGER:
+ case CCTK_VARIABLE_REAL:
+ extent = sizeof (CCTK_REAL); break;
+ case CCTK_VARIABLE_INTEGER:
extent = sizeof (Int); break;
- case VARIABLE_CHAR:
- case VARIABLE_COMPLEX:
+ case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_COMPLEX:
default:
CCTK_WARN (1, "pugh_ReduceMinVal: Unsupported return type");
return (1);
@@ -165,12 +165,12 @@ int pugh_ReduceMaxVal (cGH *GH, int proc, int rettype, int numretvars,
void *retval_ptr;
switch (rettype) {
- case VARIABLE_REAL:
- extent = sizeof (Double); break;
- case VARIABLE_INTEGER:
+ case CCTK_VARIABLE_REAL:
+ extent = sizeof (CCTK_REAL); break;
+ case CCTK_VARIABLE_INTEGER:
extent = sizeof (Int); break;
- case VARIABLE_CHAR:
- case VARIABLE_COMPLEX:
+ case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_COMPLEX:
default:
CCTK_WARN (1, "pugh_ReduceMaxVal: Unsupported return type");
return (1);
@@ -250,12 +250,12 @@ int pugh_ReduceNorm1 (cGH *GH, int proc, int rettype, int numretvars,
void *retval_ptr;
switch (rettype) {
- case VARIABLE_REAL:
- extent = sizeof (Double); break;
- case VARIABLE_INTEGER:
+ case CCTK_VARIABLE_REAL:
+ extent = sizeof (CCTK_REAL); break;
+ case CCTK_VARIABLE_INTEGER:
extent = sizeof (Int); break;
- case VARIABLE_CHAR:
- case VARIABLE_COMPLEX:
+ case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_COMPLEX:
default:
CCTK_WARN (1, "pugh_ReduceNorm1: Unsupported return type");
return (1);
@@ -335,12 +335,12 @@ int pugh_ReduceNorm2 (cGH *GH, int proc, int rettype, int numretvars,
void *retval_ptr;
switch (rettype) {
- case VARIABLE_REAL:
- extent = sizeof (Double); break;
- case VARIABLE_INTEGER:
+ case CCTK_VARIABLE_REAL:
+ extent = sizeof (CCTK_REAL); break;
+ case CCTK_VARIABLE_INTEGER:
extent = sizeof (Int); break;
- case VARIABLE_CHAR:
- case VARIABLE_COMPLEX:
+ case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_COMPLEX:
default:
CCTK_WARN (1, "pugh_ReduceNorm2: Unsupported return type");
return (1);
@@ -382,14 +382,17 @@ int pugh_ReduceNorm2 (cGH *GH, int proc, int rettype, int numretvars,
Returns the maximum value of a distributed grid function.
@enddesc
@@*/
-Double pugh_MaxVal_GF_real (pGH *pughGH, int proc, Double *data, int nelems)
+CCTK_REAL pugh_MaxVal_GF_real (pGH *pughGH, int proc, CCTK_REAL *data, int nelems)
{
int i;
- Double res;
+ CCTK_REAL res;
#ifdef MPI
- Double lres;
+ CCTK_REAL lres;
#endif
+ printf("res = %f\n",res);
+ printf("data[0] = %f %f\n",res,data[0]);
+
res = data [0];
for (i = 1; i < nelems; i++)
res = (data [i] > res ? data [i] : res);
@@ -415,7 +418,7 @@ int pugh_MaxVal_GF (cGH *GH, int index, int proc, int rettype, void *retval)
int timelevel;
pGH *pughGH;
pGF *GF;
- Double *retval_ptr = (Double *) retval;
+ CCTK_REAL *retval_ptr = (CCTK_REAL *) retval;
timelevel = CCTK_GetNumTimeLevels (index) - 1;
if (timelevel > 0)
@@ -425,14 +428,14 @@ int pugh_MaxVal_GF (cGH *GH, int index, int proc, int rettype, void *retval)
GF = ((pGF ***) pughGH->variables) [index][timelevel];
switch (GF->vtype) {
- case VARIABLE_REAL:
+ case CCTK_VARIABLE_REAL:
*retval_ptr = pugh_MaxVal_GF_real (pughGH, proc, GH->data [index][timelevel], pughGH->npoints);
break;
- case VARIABLE_CHAR:
- case VARIABLE_INTEGER:
- case VARIABLE_COMPLEX:
+ case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_INTEGER:
+ case CCTK_VARIABLE_COMPLEX:
default:
- CCTK_WARN (1, "Reduction of type other than REAL not yet supported");
+ CCTK_WARN (1, "Reduction of type other than CCTK_REAL not yet supported");
return (1);
}
@@ -448,12 +451,12 @@ int pugh_MaxVal_GF (cGH *GH, int index, int proc, int rettype, void *retval)
Returns the minimum value of a distributed grid function.
@enddesc
@@*/
-Double pugh_MinVal_GF_real (pGH *pughGH, int proc, Double *data, int nelems)
+CCTK_REAL pugh_MinVal_GF_real (pGH *pughGH, int proc, CCTK_REAL *data, int nelems)
{
int i;
- Double res;
+ CCTK_REAL res;
#ifdef MPI
- Double lres;
+ CCTK_REAL lres;
#endif
res = data [0];
@@ -480,7 +483,7 @@ int pugh_MinVal_GF (cGH *GH, int index, int proc, int rettype, void *retval)
int timelevel;
pGH *pughGH;
pGF *GF;
- Double *retval_ptr = (Double *) retval;
+ CCTK_REAL *retval_ptr = (CCTK_REAL *) retval;
timelevel = CCTK_GetNumTimeLevels (index) - 1;
if (timelevel > 0)
@@ -490,14 +493,14 @@ int pugh_MinVal_GF (cGH *GH, int index, int proc, int rettype, void *retval)
GF = ((pGF ***) pughGH->variables) [index][timelevel];
switch (GF->vtype) {
- case VARIABLE_REAL:
+ case CCTK_VARIABLE_REAL:
*retval_ptr = pugh_MinVal_GF_real (pughGH, proc, GH->data [index][timelevel], pughGH->npoints);
break;
- case VARIABLE_CHAR:
- case VARIABLE_INTEGER:
- case VARIABLE_COMPLEX:
+ case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_INTEGER:
+ case CCTK_VARIABLE_COMPLEX:
default:
- CCTK_WARN (1, "Reduction of type other than REAL not yet supported");
+ CCTK_WARN (1, "Reduction of type other than CCTK_REAL not yet supported");
return (1);
}
@@ -513,13 +516,13 @@ int pugh_MinVal_GF (cGH *GH, int index, int proc, int rettype, void *retval)
Returns the average of a distributed grid function.
@enddesc
@@*/
-Double pugh_Norm1_GF_real (pGH *pughGH, pGF *GF, int proc, Double *data)
+CCTK_REAL pugh_Norm1_GF_real (pGH *pughGH, pGF *GF, int proc, CCTK_REAL *data)
{
int ii, tnp;
- Double res;
+ CCTK_REAL res;
#ifdef MPI
int jj, kk, np;
- Double lres;
+ CCTK_REAL lres;
#endif
#define ABS(x) ((x)<0?-(x):(x))
@@ -568,7 +571,7 @@ int pugh_Norm1_GF (cGH *GH, int index, int proc, int rettype, void *retval)
int timelevel;
pGH *pughGH;
pGF *GF;
- Double *retval_ptr = (Double *) retval;
+ CCTK_REAL *retval_ptr = (CCTK_REAL *) retval;
timelevel = CCTK_GetNumTimeLevels (index) - 1;
if (timelevel > 0)
@@ -578,14 +581,14 @@ int pugh_Norm1_GF (cGH *GH, int index, int proc, int rettype, void *retval)
GF = ((pGF ***) pughGH->variables) [index][timelevel];
switch (GF->vtype) {
- case VARIABLE_REAL:
+ case CCTK_VARIABLE_REAL:
*retval_ptr = pugh_Norm1_GF_real (pughGH, GF, proc, GH->data [index][timelevel]);
break;
- case VARIABLE_CHAR:
- case VARIABLE_INTEGER:
- case VARIABLE_COMPLEX:
+ case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_INTEGER:
+ case CCTK_VARIABLE_COMPLEX:
default:
- CCTK_WARN (1, "Reduction of type other than REAL not yet supported");
+ CCTK_WARN (1, "Reduction of type other than CCTK_REAL not yet supported");
return (1);
}
@@ -602,13 +605,13 @@ int pugh_Norm1_GF (cGH *GH, int index, int proc, int rettype, void *retval)
is, returns $\sqrt{\Sigma (a_i * a_i) / np}$.
@enddesc
@@*/
-Double pugh_Norm2_GF_real (pGH *pughGH, pGF *GF, int proc, Double *data)
+CCTK_REAL pugh_Norm2_GF_real (pGH *pughGH, pGF *GF, int proc, CCTK_REAL *data)
{
int ii, tnp;
- Double res;
+ CCTK_REAL res;
#ifdef MPI
int jj, kk, np;
- Double lres;
+ CCTK_REAL lres;
#endif
res = 0.0;
@@ -657,7 +660,7 @@ int pugh_Norm2_GF (cGH *GH, int index, int proc, int rettype, void *retval)
int timelevel;
pGH *pughGH;
pGF *GF;
- Double *retval_ptr = (Double *) retval;
+ CCTK_REAL *retval_ptr = (CCTK_REAL *) retval;
timelevel = CCTK_GetNumTimeLevels (index) - 1;
if (timelevel > 0)
@@ -667,14 +670,14 @@ int pugh_Norm2_GF (cGH *GH, int index, int proc, int rettype, void *retval)
GF = ((pGF ***) pughGH->variables) [index][timelevel];
switch (GF->vtype) {
- case VARIABLE_REAL:
+ case CCTK_VARIABLE_REAL:
*retval_ptr = pugh_Norm2_GF_real (pughGH, GF, proc, GH->data [index][timelevel]);
break;
- case VARIABLE_CHAR:
- case VARIABLE_INTEGER:
- case VARIABLE_COMPLEX:
+ case CCTK_VARIABLE_CHAR:
+ case CCTK_VARIABLE_INTEGER:
+ case CCTK_VARIABLE_COMPLEX:
default:
- CCTK_WARN (1, "Reduction of type other than REAL not yet supported");
+ CCTK_WARN (1, "Reduction of type other than CCTK_REAL not yet supported");
return (1);
}
@@ -688,7 +691,7 @@ int pugh_Norm2_GF (cGH *GH, int index, int proc, int rettype, void *retval)
@date Mon Jun 30 10:44:57 1997
@author Paul Walker
@desc
- Returns all 4 norms into a Double pointer in the order
+ Returns all 4 norms into a CCTK_REAL pointer in the order
max min norm1 norm2
<p>
This is purely a convenience function.
@@ -696,7 +699,7 @@ int pugh_Norm2_GF (cGH *GH, int index, int proc, int rettype, void *retval)
@calls pGF_MaxVal, pGF_MinVal, pGF_Norm1, pGF_Norm2
@@*/
-void pGF_AllNorms(pGH *GH, pGF *GF, Double *res) {
+void pGF_AllNorms(pGH *GH, pGF *GF, CCTK_REAL *res) {
res[0] = pGF_MaxVal(GH,GF);
res[1] = pGF_MinVal(GH,GF);
res[2] = pGF_Norm1(GH,GF);
diff --git a/src/SetupGroup.c b/src/SetupGroup.c
index 05fd30f..d986f97 100644
--- a/src/SetupGroup.c
+++ b/src/SetupGroup.c
@@ -95,10 +95,10 @@ int pugh_SetupScalarGroup(pGH *newGH, int vtype, int n_variables, int n_timeleve
switch(vtype)
{
- case VARIABLE_CHAR : var_size = sizeof(char); break;
- case VARIABLE_INTEGER : var_size = sizeof(int) ; break;
- case VARIABLE_REAL : var_size = sizeof(Double); break;
- case VARIABLE_COMPLEX : var_size = sizeof(Complex); break;
+ case CCTK_VARIABLE_CHAR : var_size = sizeof(char); break;
+ case CCTK_VARIABLE_INTEGER : var_size = sizeof(int) ; break;
+ case CCTK_VARIABLE_REAL : var_size = sizeof(CCTK_REAL); break;
+ case CCTK_VARIABLE_COMPLEX : var_size = sizeof(Complex); break;
default : fprintf(stderr,
"Unknown variable type in pugh_SetupScalarGroup\n");
var_size = 1;
@@ -173,10 +173,10 @@ int pugh_SetupGFGroup(pGH *newGH, int vtype, int dim, int n_variables, int n_tim
switch(vtype)
{
- case VARIABLE_CHAR : var_size = sizeof(char); break;
- case VARIABLE_INTEGER : var_size = sizeof(int) ; break;
- case VARIABLE_REAL : var_size = sizeof(Double); break;
- case VARIABLE_COMPLEX : var_size = sizeof(Complex); break;
+ case CCTK_VARIABLE_CHAR : var_size = sizeof(char); break;
+ case CCTK_VARIABLE_INTEGER : var_size = sizeof(int) ; break;
+ case CCTK_VARIABLE_REAL : var_size = sizeof(CCTK_REAL); break;
+ case CCTK_VARIABLE_COMPLEX : var_size = sizeof(Complex); break;
default : fprintf(stderr,
"Unknown variable type in pugh_SetupScalarGroup\n");
var_size = 1;
diff --git a/src/SetupPGF.c b/src/SetupPGF.c
index 95f15f0..afe7489 100644
--- a/src/SetupPGF.c
+++ b/src/SetupPGF.c
@@ -60,7 +60,7 @@ pGF *SetupPGF(pGH *GH, const char *name, int dim, int varsize, int vtype)
int i, dir, dirp1, dirp2, sz; /* Counter thingies */
/* Fudge for CCTK. */
- int stagger = PUGH_VERTEXCTR;
+ int staggerme = PUGH_VERTEXCTR;
int storage = PUGH_NOSTORAGE;
int docomm = PUGH_NOCOMM;
@@ -74,7 +74,7 @@ pGF *SetupPGF(pGH *GH, const char *name, int dim, int varsize, int vtype)
res->name = (char *)malloc((1+strlen(name))*sizeof(char));
strcpy(res->name,name);
- res->stagger = stagger;
+ res->stagger = staggerme;
if( (GH->stagger == PUGH_NO_STAGGER) &&
(res->stagger != PUGH_VERTEXCTR) )
{ printf ("FATAL ERROR! Cannot have staggered grids inside a GH with \n");
@@ -176,7 +176,7 @@ void DestroyPGF(pGH *GH, pGF **GFin) {
@desc
This routine toggles the data storage to the "on"
position. That means that data points to a 3D
- array, rather than a single Double, and the
+ array, rather than a single CCTK_REAL, and the
storage flag is set to one. This is used quite
a lot by thorns which need to toggle memory. for
instance, see the trK Driver in the util thron.
@@ -188,7 +188,7 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) {
int special_pad, cache_size, start;
char *char_temp;
- Double *Double_temp;
+ CCTK_REAL *CCTK_REAL_temp;
int *int_temp;
Complex *Complex_temp;
Complex Czero = {0.0,0.0};
@@ -223,10 +223,10 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) {
we are not using the derived types comm style.
*/
assert(!GF->send_buffer);
- GF->send_buffer = (Double **)malloc(6*sizeof(Double *));
+ GF->send_buffer = (CCTK_REAL **)malloc(6*sizeof(CCTK_REAL *));
assert(!GF->recv_buffer);
- GF->recv_buffer = (Double **)malloc(6*sizeof(Double *));
+ GF->recv_buffer = (CCTK_REAL **)malloc(6*sizeof(CCTK_REAL *));
for (i=0;i<6;i++) {
dir = i/2;
@@ -243,8 +243,8 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) {
if (GH->neighbors[GH->myproc][i] >= 0) {
GF->buffer_sz[i] = sz;
- GF->send_buffer[i] = (Double *)malloc(sz*sizeof(Double));
- GF->recv_buffer[i] = (Double *)malloc(sz*sizeof(Double));
+ GF->send_buffer[i] = (CCTK_REAL *)malloc(sz*sizeof(CCTK_REAL));
+ GF->recv_buffer[i] = (CCTK_REAL *)malloc(sz*sizeof(CCTK_REAL));
assert(GF->recv_buffer[i]);
assert(GF->send_buffer[i]);
} else {
@@ -263,16 +263,16 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) {
if (zero_memory) {
switch(GF->vtype)
{
- case VARIABLE_CHAR: char_temp = GF->padddata;
+ case CCTK_VARIABLE_CHAR: char_temp = GF->padddata;
for (i=0;i<GH->npoints;i++) char_temp[i] = 0;
break;
- case VARIABLE_INTEGER: int_temp = GF->padddata;
+ case CCTK_VARIABLE_INTEGER: int_temp = GF->padddata;
for (i=0;i<GH->npoints;i++) int_temp[i] = 0;
break;
- case VARIABLE_REAL: Double_temp = GF->padddata;
- for (i=0;i<GH->npoints;i++) Double_temp[i] = 0.0;
+ case CCTK_VARIABLE_REAL: CCTK_REAL_temp = GF->padddata;
+ for (i=0;i<GH->npoints;i++) CCTK_REAL_temp[i] = 0.0;
break;
- case VARIABLE_COMPLEX: Complex_temp = GF->padddata;
+ case CCTK_VARIABLE_COMPLEX: Complex_temp = GF->padddata;
for (i=0;i<GH->npoints;i++) Complex_temp[i] = Czero;
break;
default:
@@ -305,16 +305,16 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) {
if (zero_memory) {
switch(GF->vtype)
{
- case VARIABLE_CHAR: char_temp = GF->padddata;
+ case CCTK_VARIABLE_CHAR: char_temp = GF->padddata;
for (i=0;i<GH->npoints+padding_size;i++) char_temp[i] = 0;
break;
- case VARIABLE_INTEGER: int_temp = GF->padddata;
+ case CCTK_VARIABLE_INTEGER: int_temp = GF->padddata;
for (i=0;i<GH->npoints+padding_size;i++) int_temp[i] = 0;
break;
- case VARIABLE_REAL: Double_temp = GF->padddata;
- for (i=0;i<GH->npoints+padding_size;i++) Double_temp[i] = 0.0;
+ case CCTK_VARIABLE_REAL: CCTK_REAL_temp = GF->padddata;
+ for (i=0;i<GH->npoints+padding_size;i++) CCTK_REAL_temp[i] = 0.0;
break;
- case VARIABLE_COMPLEX: Complex_temp = GF->padddata;
+ case CCTK_VARIABLE_COMPLEX: Complex_temp = GF->padddata;
for (i=0;i<GH->npoints+padding_size;i++) Complex_temp[i] = Czero;
break;
default:
@@ -341,7 +341,7 @@ int EnableGFDataStorage(pGH *GH, pGF *GF) {
@desc
This routine disables the grid function storage.
That is, it un-allocates the 3D array and in its
- place allocates a single Double with the value
+ place allocates a single CCTK_REAL with the value
0.0. This allows us to still have something to
pass around (an array of size (1,1,1) in fortran
speak) but also to not need all our 3D arrays
@@ -391,7 +391,7 @@ int DisableGFDataStorage(pGH *GH, pGF *GF) {
GF->recv_buffer = NULL;
}
- GF->padddata = (Double *)malloc(sizeof(Double));
+ GF->padddata = (CCTK_REAL *)malloc(sizeof(CCTK_REAL));
GF->data = GF->padddata;
#if 0
GF->data[0] = 0.0; /* Very important! */
diff --git a/src/SetupPGH.c b/src/SetupPGH.c
index 321f4ee..99b7501 100644
--- a/src/SetupPGH.c
+++ b/src/SetupPGH.c
@@ -224,7 +224,7 @@ void pGH_SetupBounds(pGH *GH,int nx,int ny,int nz) {
int lnx, lny, lnz;
int *dtindexes, *one, maxs, dirs[3];
int maxpoints, minpoints;
- Double avgpoints;
+ CCTK_REAL avgpoints;
int istart,jstart,kstart,iend,jend,kend;
int nprocx,nprocy,nprocz;
int staggertype;
@@ -365,7 +365,7 @@ void pGH_SetupOwnership(pGH *GH) {
int lnx, lny, lnz;
int *dtindexes, *one, maxs, dirs[3];
int maxpoints, minpoints;
- Double avgpoints;
+ CCTK_REAL avgpoints;
int istart,jstart,kstart,iend,jend,kend;
int nprocx,nprocy,nprocz;
diff --git a/src/include/pGArray.h b/src/include/pGArray.h
index 7a81679..b5338b6 100644
--- a/src/include/pGArray.h
+++ b/src/include/pGArray.h
@@ -10,7 +10,7 @@
typedef struct PGARRAY {
char *name;
int pgano;
- Double *data;
+ CCTK_REAL *data;
int npoints;
struct PGH *parentGH;
diff --git a/src/include/pGF.h b/src/include/pGF.h
index 467057f..cc0ac5f 100644
--- a/src/include/pGF.h
+++ b/src/include/pGF.h
@@ -9,7 +9,7 @@
also.
<p>
One wonderfully new feature that a pGF has is that it contains
- both a Double* padddata and a Double* data. What is the difference?
+ both a CCTK_REAL* padddata and a CCTK_REAL* data. What is the difference?
Well data is the base address of the fortran data set. It points
into padddata. This allows us, if we want to, to explicitly move
the starting point of the array to align with cache lines.
@@ -47,8 +47,8 @@ typedef struct PGF {
void *padddata; /* Storage for the data. */
void *data; /* See the note above. */
int buffer_sz[6]; /* Size of the face ghost zones */
- Double **send_buffer; /* Storage for buffered Comm if */
- Double **recv_buffer; /* we don't use derived types */
+ CCTK_REAL **send_buffer; /* Storage for buffered Comm if */
+ CCTK_REAL **recv_buffer; /* we don't use derived types */
int commflag; /* What is the comm flag set to? */
int docomm[6]; /* Do we do comm or not? */
int storage; /* Do we have storage or not? */
diff --git a/src/include/pGH.h b/src/include/pGH.h
index ad03598..7665698 100644
--- a/src/include/pGH.h
+++ b/src/include/pGH.h
@@ -54,7 +54,7 @@ typedef struct PGH {
int timelevel;
/* Processor group layouts */
- Double maxskew; /* Maximum point skew */
+ CCTK_REAL maxskew; /* Maximum point skew */
int periodic; /* Is the system periodic? */
int **lb; /* Lower bound (nprocs X 3) for each proc */
int **ub; /* Upper bound (same sizes) */
@@ -89,10 +89,10 @@ typedef struct PGH {
/* Coordinate information */
- /*Double cx0, cy0, cz0;*/ /* Origin of our system */
- Double dx0, dy0, dz0, dt0; /* Delta of our system */
- Double lx0, ly0, lz0; /* Processor-Local coordinate origins */
- Double phys_time; /* physical time */
+ /*CCTK_REAL cx0, cy0, cz0;*/ /* Origin of our system */
+ CCTK_REAL dx0, dy0, dz0, dt0; /* Delta of our system */
+ CCTK_REAL lx0, ly0, lz0; /* Processor-Local coordinate origins */
+ CCTK_REAL phys_time; /* physical time */
int GHiteration; /* iteration number on processor */
diff --git a/src/include/pughDriver.h b/src/include/pughDriver.h
index 73415ea..6615302 100644
--- a/src/include/pughDriver.h
+++ b/src/include/pughDriver.h
@@ -57,8 +57,8 @@ extern int cactus_terminate;
int *, int *, int *, \
int *, int *, int *, int *, \
int *, int *, int *, \
- Double *, Double *, Double *, \
- Double *, Double *, Double *, Double *, Double *, \
+ CCTK_REAL *, CCTK_REAL *, CCTK_REAL *, \
+ CCTK_REAL *, CCTK_REAL *, CCTK_REAL *, CCTK_REAL *, CCTK_REAL *, \
int *, int *, int *, \
int *, int *, int *
diff --git a/src/pGF_FinishRecv.c b/src/pGF_FinishRecv.c
index d7fb93a..9a80c74 100644
--- a/src/pGF_FinishRecv.c
+++ b/src/pGF_FinishRecv.c
@@ -46,7 +46,7 @@ void pGF_FinishRecv(pGH *GH, pGF *GF, int dir) {
int istart, iend, jstart, jend, kstart, kend;
int ii,jj,kk,xx;
int tmp;
- Double *data;
+ CCTK_REAL *data;
/* Return if GF has no storage */
if (!(GF->storage)) return;
@@ -73,7 +73,7 @@ void pGF_FinishRecv(pGH *GH, pGF *GF, int dir) {
/* Great now copy. Note ordering is just link in PostSend */
xx=0;
- data = (Double *) GF->data;
+ data = (CCTK_REAL *) GF->data;
for (kk=kstart; kk<kend; kk++)
for (jj=jstart; jj<jend; jj++)
for (ii=istart; ii<iend; ii++)
diff --git a/src/pGF_PostSend.c b/src/pGF_PostSend.c
index 1f3ee74..f8fc7d2 100644
--- a/src/pGF_PostSend.c
+++ b/src/pGF_PostSend.c
@@ -54,8 +54,8 @@ void pGF_PostSend(pGH *GH, pGF *GF, int dir) {
int kstart, kend;
#ifdef MPI
- Double ts, tw, tp;
- Double *data;
+ CCTK_REAL ts, tw, tp;
+ CCTK_REAL *data;
MPI_Status ms;
/* Return if GF has no storage */
@@ -97,7 +97,7 @@ void pGF_PostSend(pGH *GH, pGF *GF, int dir) {
/* Great now copy */
xx = 0;
- data = (Double *) GF->data;
+ data = (CCTK_REAL *) GF->data;
for (kk=kstart; kk<kend; kk++)
for (jj=jstart; jj<jend; jj++)
for (ii=istart; ii<iend; ii++)
diff --git a/src/pugh/SetupPGArray.c b/src/pugh/SetupPGArray.c
index 9a5cf71..1c6d1c8 100644
--- a/src/pugh/SetupPGArray.c
+++ b/src/pugh/SetupPGArray.c
@@ -45,10 +45,10 @@ pGArray *SetupPGArray(pGH *GH, char *name, int npoints) {
lnpoints = npoints - lnpoints * (GH->nprocs-1);
}
res->npoints = lnpoints;
- res->data = (Double *)malloc(lnpoints*sizeof(Double));
+ res->data = (CCTK_REAL *)malloc(lnpoints*sizeof(CCTK_REAL));
} else {
res->npoints = 1;
- res->data = (Double *)malloc(sizeof(Double));
+ res->data = (CCTK_REAL *)malloc(sizeof(CCTK_REAL));
}
/* Setup IO stuff to default no IO with space for xgraph files.*/
diff --git a/src/pugh/SetupPGF.c b/src/pugh/SetupPGF.c
index acec587..16d4029 100644
--- a/src/pugh/SetupPGF.c
+++ b/src/pugh/SetupPGF.c
@@ -171,7 +171,7 @@ void DestroyPGF(pGH *GH, pGF **GFin) {
@desc
This routine toggles the data storage to the "on"
position. That means that data points to a 3D
- array, rather than a single Double, and the
+ array, rather than a single CCTK_REAL, and the
storage flag is set to one. This is used quite
a lot by thorns which need to toggle memory. for
instance, see the trK Driver in the util thron.
@@ -222,10 +222,10 @@ void EnableGFDataStorage(pGH *GH, pGF *GF) {
we are not using the derived types comm style.
*/
assert(!GF->send_buffer);
- GF->send_buffer = (Double **)malloc(6*sizeof(Double *));
+ GF->send_buffer = (CCTK_REAL **)malloc(6*sizeof(CCTK_REAL *));
assert(!GF->recv_buffer);
- GF->recv_buffer = (Double **)malloc(6*sizeof(Double *));
+ GF->recv_buffer = (CCTK_REAL **)malloc(6*sizeof(CCTK_REAL *));
for (i=0;i<6;i++) {
dir = i/2;
@@ -242,8 +242,8 @@ void EnableGFDataStorage(pGH *GH, pGF *GF) {
if (GH->neighbors[GH->myproc][i] >= 0) {
GF->buffer_sz[i] = sz;
- GF->send_buffer[i] = (Double *)malloc(sz*sizeof(Double));
- GF->recv_buffer[i] = (Double *)malloc(sz*sizeof(Double));
+ GF->send_buffer[i] = (CCTK_REAL *)malloc(sz*sizeof(CCTK_REAL));
+ GF->recv_buffer[i] = (CCTK_REAL *)malloc(sz*sizeof(CCTK_REAL));
assert(GF->recv_buffer[i]);
assert(GF->send_buffer[i]);
} else {
@@ -256,22 +256,22 @@ void EnableGFDataStorage(pGH *GH, pGF *GF) {
/* Set up the storage */
if (GF->padddata) free (GF->padddata);
if (!padding_active) {
- GF->padddata = (Double *)malloc((GH->npoints)*sizeof(Double));
+ GF->padddata = (CCTK_REAL *)malloc((GH->npoints)*sizeof(CCTK_REAL));
GF->data = GF->padddata; /* No padding case */
if (zero_memory) {
for (i=0;i<GH->npoints;i++)
GF->padddata[i] = 0.0;
}
} else {
- GF->padddata = (Double *)malloc((GH->npoints + padding_size)
- *sizeof(Double));
+ GF->padddata = (CCTK_REAL *)malloc((GH->npoints + padding_size)
+ *sizeof(CCTK_REAL));
/* Align the actual starting address on a cache line.
More specifically align on a unique cache line for
each field.
*/
cache_size = 2 << (padding_cacheline_bits - 1);
- start = ((long) (GF->padddata) / sizeof(Double))%cache_size;
+ start = ((long) (GF->padddata) / sizeof(CCTK_REAL))%cache_size;
special_pad = ((GF->gfno) * padding_address_spacing + cache_size - start)%cache_size;
GF->data = (GF->padddata) + special_pad;
@@ -303,7 +303,7 @@ void EnableGFDataStorage(pGH *GH, pGF *GF) {
@desc
This routine disables the grid function storage.
That is, it un-allocates the 3D array and in its
- place allocates a single Double with the value
+ place allocates a single CCTK_REAL with the value
0.0. This allows us to still ahve something to
pass around (an array of size (1,1,1) in fortran
speak) but also to not need all our 3D arrays
@@ -353,7 +353,7 @@ void DisableGFDataStorage(pGH *GH, pGF *GF) {
GF->recv_buffer = NULL;
}
- GF->padddata = (Double *)malloc(sizeof(Double));
+ GF->padddata = (CCTK_REAL *)malloc(sizeof(CCTK_REAL));
GF->data = GF->padddata;
GF->data[0] = 0.0; /* Very important! */
GF->storage = 0;
diff --git a/src/pugh/pGF_PostSend.c b/src/pugh/pGF_PostSend.c
index d8ec630..4f797d2 100644
--- a/src/pugh/pGF_PostSend.c
+++ b/src/pugh/pGF_PostSend.c
@@ -50,7 +50,7 @@ void pGF_PostSend(pGH *GH, pGF *GF, int dir) {
int kstart, kend;
#ifdef MPI
- Double ts, tw, tp;
+ CCTK_REAL ts, tw, tp;
MPI_Status ms;
diff --git a/src/pugh/pGF_Reduction.c b/src/pugh/pGF_Reduction.c
index bc8e211..6d6c734 100644
--- a/src/pugh/pGF_Reduction.c
+++ b/src/pugh/pGF_Reduction.c
@@ -24,8 +24,8 @@ static char *rcsid = "$Id$";
@@*/
-Double pGF_MaxVal(pGH *GH, pGF *GF) {
- Double res, lres;
+CCTK_REAL pGF_MaxVal(pGH *GH, pGF *GF) {
+ CCTK_REAL res, lres;
int i;
if (!GF->storage) return GF->maxval;
@@ -54,8 +54,8 @@ Double pGF_MaxVal(pGH *GH, pGF *GF) {
@enddesc
@@*/
-Double pGF_MinVal(pGH *GH, pGF *GF) {
- Double res, lres;
+CCTK_REAL pGF_MinVal(pGH *GH, pGF *GF) {
+ CCTK_REAL res, lres;
int i;
if (!GF->storage) return GF->minval;
@@ -84,8 +84,8 @@ Double pGF_MinVal(pGH *GH, pGF *GF) {
@enddesc
@@*/
-Double pGF_Norm1(pGH *GH, pGF *GF) {
- Double res, lres;
+CCTK_REAL pGF_Norm1(pGH *GH, pGF *GF) {
+ CCTK_REAL res, lres;
int i, ii, jj, kk;
int is,ie,js,je,ks,ke;
int np,tnp;
@@ -136,8 +136,8 @@ Double pGF_Norm1(pGH *GH, pGF *GF) {
@@*/
-Double pGF_Norm2(pGH *GH, pGF *GF) {
- Double res, lres;
+CCTK_REAL pGF_Norm2(pGH *GH, pGF *GF) {
+ CCTK_REAL res, lres;
int i, ii, jj, kk;
int is,ie,js,je,ks,ke;
int np, tnp;
@@ -181,7 +181,7 @@ Double pGF_Norm2(pGH *GH, pGF *GF) {
@date Mon Jun 30 10:44:57 1997
@author Paul Walker
@desc
- Returns all 4 norms into a Double pointer in the order
+ Returns all 4 norms into a CCTK_REAL pointer in the order
max min norm1 norm2
<p>
This is purely a convenience function.
@@ -189,7 +189,7 @@ Double pGF_Norm2(pGH *GH, pGF *GF) {
@calls pGF_MaxVal, pGF_MinVal, pGF_Norm1, pGF_Norm2
@@*/
-void pGF_AllNorms(pGH *GH, pGF *GF, Double *res) {
+void pGF_AllNorms(pGH *GH, pGF *GF, CCTK_REAL *res) {
res[0] = pGF_MaxVal(GH,GF);
res[1] = pGF_MinVal(GH,GF);
res[2] = pGF_Norm1(GH,GF);