From ad6eb67f8ab76a222cbee4af0cafe15d78804d46 Mon Sep 17 00:00:00 2001 From: allen Date: Fri, 25 Jun 1999 17:05:18 +0000 Subject: Implementing new naming convention for variables on the cGH. See cGH.h for details. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@4 ebee0441-1374-4afa-a3b5-247f3ba15b9a --- src/DumpGH.c | 8 ++++---- src/DumpVar.c | 54 +++++++++++++++++++++++++++--------------------------- src/Output2D.c | 8 ++++---- src/Output3D.c | 8 ++++---- src/RecoverGH.c | 2 +- src/RestoreFile.c | 4 ++-- src/Write2D.c | 28 ++++++++++++++-------------- src/Write3D.c | 2 +- 8 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/DumpGH.c b/src/DumpGH.c index fd366ba..4c4b306 100644 --- a/src/DumpGH.c +++ b/src/DumpGH.c @@ -69,11 +69,11 @@ void IOFlexIO_ConditionallyDumpGH (cGH *GH) DECLARE_PARAMETERS if (checkpoint_every > 0 && - GH->iteration % checkpoint_every == 0) { + GH->cctk_iteration % checkpoint_every == 0) { if (IO_verbose) { printf ("------------------------------------------------------------\n"); printf ("Dumping periodic checkpoint file at iteration %d\n", - GH->iteration); + GH->cctk_iteration); } IOFlexIO_DumpGH (GH, CP_EVOLUTION_DATA); } @@ -168,7 +168,7 @@ void IOFlexIO_IEEEIOStructDump (cGH *GH, IOFile iof) /* Get the handle for IOUtil extensions */ ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - i_temp = GH->iteration; + i_temp = GH->cctk_iteration; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "GH$iteration", FLEXIO_INT4, 1, &i_temp)); @@ -180,7 +180,7 @@ void IOFlexIO_IEEEIOStructDump (cGH *GH, IOFile iof) CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "GH$nprocs", FLEXIO_INT4, 1, &i_temp)); - d_temp = GH->time; + d_temp = GH->cctk_time; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "GH$time", FLEXIO_REAL, 1, &d_temp)); } diff --git a/src/DumpVar.c b/src/DumpVar.c index 77325b8..dd1359a 100644 --- a/src/DumpVar.c +++ b/src/DumpVar.c @@ -546,7 +546,7 @@ void IOFlexIO_AddCommonAttributes (cGH *GH, int index, int timelevel, CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "date", BYTE, strlen (char_time_date) + 1, char_time_date)); - CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "time", FLEXIO_REAL, 1,&GH->time)); + CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "time", FLEXIO_REAL, 1,&GH->cctk_time)); /* FIXME : Origin (d3_to_IO) */ d3_to_IO [0] = 0.0; @@ -555,25 +555,25 @@ void IOFlexIO_AddCommonAttributes (cGH *GH, int index, int timelevel, CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "origin", FLEXIO_REAL,3,d3_to_IO)); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "min_ext",FLEXIO_REAL,3,d3_to_IO)); - d3_to_IO [0] = GH->delta_space [0] * ioUtilGH->downsample_x; - d3_to_IO [1] = GH->delta_space [1] * ioUtilGH->downsample_y; - d3_to_IO [2] = GH->delta_space [2] * ioUtilGH->downsample_z; + d3_to_IO [0] = GH->cctk_delta_space [0] * ioUtilGH->downsample_x; + d3_to_IO [1] = GH->cctk_delta_space [1] * ioUtilGH->downsample_y; + d3_to_IO [2] = GH->cctk_delta_space [2] * ioUtilGH->downsample_z; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "delta", FLEXIO_REAL, 3,d3_to_IO)); if (ioUtilGH->downsample_x > 1 || ioUtilGH->downsample_y > 1 || ioUtilGH->downsample_z > 1) { - d3_to_IO [0] = GH->delta_space [0]; - d3_to_IO [1] = GH->delta_space [1]; - d3_to_IO [2] = GH->delta_space [2]; + d3_to_IO [0] = GH->cctk_delta_space [0]; + d3_to_IO [1] = GH->cctk_delta_space [1]; + d3_to_IO [2] = GH->cctk_delta_space [2]; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "evolution_delta", FLEXIO_REAL, 3, d3_to_IO)); } /* FIXME : Origin (d3_to_IO) */ - d3_to_IO [0] = 0.0 + gsz [0] * GH->delta_space [0] * ioUtilGH->downsample_x; - d3_to_IO [1] = 0.0 + gsz [1] * GH->delta_space [1] * ioUtilGH->downsample_y; - d3_to_IO [2] = 0.0 + gsz [2] * GH->delta_space [2] * ioUtilGH->downsample_z; + d3_to_IO [0] = 0.0 + gsz [0] * GH->cctk_delta_space [0] * ioUtilGH->downsample_x; + d3_to_IO [1] = 0.0 + gsz [1] * GH->cctk_delta_space [1] * ioUtilGH->downsample_y; + d3_to_IO [2] = 0.0 + gsz [2] * GH->cctk_delta_space [2] * ioUtilGH->downsample_z; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "max_ext",FLEXIO_REAL,3,d3_to_IO)); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "global_size", FLEXIO_INT4, @@ -591,7 +591,7 @@ void IOFlexIO_AddCommonAttributes (cGH *GH, int index, int timelevel, CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "unchunked", FLEXIO_INT4, 1, &i_to_IO)); - i_to_IO = GH->iteration; + i_to_IO = GH->cctk_iteration; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "iteration", FLEXIO_INT4, 1, &i_to_IO)); } @@ -627,7 +627,7 @@ void IOFlexIO_AddChunkAttributes (cGH *GH, int index, CCTK_INT4 chunk_origin [3] CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "chunk_origin", FLEXIO_INT4, 3, chunk_origin)); - i_to_IO = GH->iteration; + i_to_IO = GH->cctk_iteration; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "chunk_dataset", FLEXIO_INT4, 1, &i_to_IO)); @@ -724,9 +724,9 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, } for (i = 0; i < 3; i++) { - bnd [i] = GH->lower_bound[i]; /* the bounds */ - bnd [i+3] = GH->local_shape[i]; /* the sizes */ - bnd [i+6] = GH->global_shape[i]; /* the global space */ + bnd [i] = GH->cctk_lbnd[i]; /* the bounds */ + bnd [i+3] = GH->cctk_lsh[i]; /* the sizes */ + bnd [i+6] = GH->cctk_gsh[i]; /* the global space */ } } else { @@ -735,19 +735,19 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, int i, j, k, l; /* Downsampling code ... */ - bnd [6] = GH->global_shape[0] / ioUtilGH->downsample_x; - if (GH->global_shape[0] % ioUtilGH->downsample_x) + bnd [6] = GH->cctk_gsh[0] / ioUtilGH->downsample_x; + if (GH->cctk_gsh[0] % ioUtilGH->downsample_x) bnd [6]++; - bnd [7] = GH->global_shape[1] / ioUtilGH->downsample_y; - if (GH->global_shape[1] % ioUtilGH->downsample_y) + bnd [7] = GH->cctk_gsh[1] / ioUtilGH->downsample_y; + if (GH->cctk_gsh[1] % ioUtilGH->downsample_y) bnd [7]++; - bnd [8] = GH->global_shape[2] / ioUtilGH->downsample_z; - if (GH->global_shape[2] % ioUtilGH->downsample_z) + bnd [8] = GH->cctk_gsh[2] / ioUtilGH->downsample_z; + if (GH->cctk_gsh[2] % ioUtilGH->downsample_z) bnd [8]++; if (IO_verbose) printf ("Downsampled sizes (%d, %d, %d) -> (%d, %d, %d)\n", - GH->global_shape[0], GH->global_shape[1], GH->global_shape[2], + GH->cctk_gsh[0], GH->cctk_gsh[1], GH->cctk_gsh[2], (int) bnd [6], (int) bnd [7], (int) bnd [8]); /* Now figure out the local downsampling */ @@ -762,14 +762,14 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, else downsample = ioUtilGH->downsample_z; - bnd [i] = GH->lower_bound[i] / downsample; + bnd [i] = GH->cctk_lbnd[i] / downsample; start [i] = bnd [i] * downsample; if (start [i] < - GH->lower_bound[i] + pughGH->ownership [PUGH_VERTEXCTR][i][0]) { + GH->cctk_lbnd[i] + pughGH->ownership [PUGH_VERTEXCTR][i][0]) { start [i] += downsample; bnd [i] ++; } - end [i] = ((GH->lower_bound [i] + + end [i] = ((GH->cctk_lbnd [i] + pughGH->ownership [PUGH_VERTEXCTR][i][1] - 1) / downsample) * downsample; bnd [i+3] = (end [i] - start [i]) / downsample + 1; @@ -786,8 +786,8 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, /* compute local ranges */ for (i = 0; i < 3; i++) { - start [i] -= GH->lower_bound [i]; - end [i] -= GH->lower_bound [i]; + start [i] -= GH->cctk_lbnd [i]; + end [i] -= GH->cctk_lbnd [i]; } *outme = malloc (bnd [3] * bnd [4] * bnd [5] * element_size); diff --git a/src/Output2D.c b/src/Output2D.c index 23b1298..f863970 100644 --- a/src/Output2D.c +++ b/src/Output2D.c @@ -80,7 +80,7 @@ int IOFlexIO_Output2DGH (cGH *GH) myGH->IO_2Dnum[i]++; /* Register GF as having 2D output this iteration */ - myGH->IO_2Dlast[i] = GH->iteration; + myGH->IO_2Dlast[i] = GH->cctk_iteration; } } @@ -194,11 +194,11 @@ int IOFlexIO_TimeFor2D (cGH *GH, int index) /* Check this GF should be output */ if (! (CCTK_GetVarGType (index) == GROUP_GF && myGH->IO_2Dnum [index] != 0 - && GH->iteration % ioUtilGH->IO_2Devery == 0)) + && GH->cctk_iteration % ioUtilGH->IO_2Devery == 0)) return (0); /* Check GF not already output this iteration */ - if (myGH->IO_2Dlast [index] == GH->iteration) { + if (myGH->IO_2Dlast [index] == GH->cctk_iteration) { CCTK_WARN (2, "Already done 2D output in IOFlexIO"); return (0); } @@ -277,7 +277,7 @@ int IOFlexIO_TriggerOutput2D (cGH *GH, int index) myGH->IO_2Dnum [index]++; /* Register GF as having 2D output this iteration */ - myGH->IO_2Dlast [index] = GH->iteration; + myGH->IO_2Dlast [index] = GH->cctk_iteration; return (0); } diff --git a/src/Output3D.c b/src/Output3D.c index 64f0b1a..404f0e6 100644 --- a/src/Output3D.c +++ b/src/Output3D.c @@ -83,7 +83,7 @@ int IOFlexIO_Output3DGH (cGH *GH) myGH->IO_3Dnum [i]++; /* Register GF as having 3D output this iteration */ - myGH->IO_3Dlast [i] = GH->iteration; + myGH->IO_3Dlast [i] = GH->cctk_iteration; } } @@ -196,11 +196,11 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index) /* Check this GF should be output */ if (! (myGH->IO_3Dnum [index] != 0 && - GH->iteration % ioUtilGH->IO_3Devery == 0)) + GH->cctk_iteration % ioUtilGH->IO_3Devery == 0)) return (0); /* Check GF not already output this iteration */ - if (myGH->IO_3Dlast [index] == GH->iteration) { + if (myGH->IO_3Dlast [index] == GH->cctk_iteration) { CCTK_WARN (2, "Already done 3D output in IOFlexIO"); return (0); } @@ -279,7 +279,7 @@ int IOFlexIO_TriggerOutput3D (cGH *GH, int index) myGH->IO_3Dnum [index]++; /* Register GF as having 3D output this iteration */ - myGH->IO_3Dlast [index] = GH->iteration; + myGH->IO_3Dlast [index] = GH->cctk_iteration; return (0); } diff --git a/src/RecoverGH.c b/src/RecoverGH.c index 0391b30..3606da3 100644 --- a/src/RecoverGH.c +++ b/src/RecoverGH.c @@ -309,7 +309,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) IOreadAttribute (ifp, index, &iteration_stored); if (IO_verbose) printf ("Iteration number is %d\n", (int) iteration_stored); - GH->iteration = iteration_stored; + GH->cctk_iteration = iteration_stored; } else printf ("*Warning* Unable to restore iteration number\n"); diff --git a/src/RestoreFile.c b/src/RestoreFile.c index 60fb56a..19158b4 100644 --- a/src/RestoreFile.c +++ b/src/RestoreFile.c @@ -186,11 +186,11 @@ int GetCommonAttributes (cGH *GH, IOFile ifp, int unchunked, int *index, case GROUP_GF: if (unchunked) { for (i = 0; i < rank; i++) - if (GH->global_shape [i] != dims_stored [i]) + if (GH->cctk_gsh [i] != dims_stored [i]) flag = 1; } else { for (i = 0; i < rank; i++) - if (GH->local_shape [i] != dims_stored [i]) + if (GH->cctk_lsh [i] != dims_stored [i]) flag = 1; } break; diff --git a/src/Write2D.c b/src/Write2D.c index c708440..4153d4c 100644 --- a/src/Write2D.c +++ b/src/Write2D.c @@ -219,20 +219,20 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias, int first) /* Set up the number of global points and the points in the "i" and "j" directions */ if (dir == 0) { - ngpoints = GH->global_shape[1] * GH->global_shape[2]; + ngpoints = GH->cctk_gsh[1] * GH->cctk_gsh[2]; /* FIXME : origin */ - ni = GH->global_shape[1]; origin[0] = 0.0; delta[0] = pughGH->dy0; - nj = GH->global_shape[2]; origin[1] = 0.0; delta[1] = pughGH->dz0; + ni = GH->cctk_gsh[1]; origin[0] = 0.0; delta[0] = pughGH->dy0; + nj = GH->cctk_gsh[2]; origin[1] = 0.0; delta[1] = pughGH->dz0; } else if (dir == 1) { - ngpoints = GH->global_shape[0] * GH->global_shape[2]; + ngpoints = GH->cctk_gsh[0] * GH->cctk_gsh[2]; /* FIXME : Origin */ - ni = GH->global_shape[0]; origin[0] = 0.0; delta[0] = pughGH->dx0; - nj = GH->global_shape[2]; origin[1] = 0.0; delta[1] = pughGH->dz0; + ni = GH->cctk_gsh[0]; origin[0] = 0.0; delta[0] = pughGH->dx0; + nj = GH->cctk_gsh[2]; origin[1] = 0.0; delta[1] = pughGH->dz0; } else { - ngpoints = GH->global_shape[0] * GH->global_shape[1]; + ngpoints = GH->cctk_gsh[0] * GH->cctk_gsh[1]; /* FIXME : Origin */ - ni = GH->global_shape[0]; origin[0] = 0.0; delta[0] = pughGH->dx0; - nj = GH->global_shape[1]; origin[1] = 0.0; delta[1] = pughGH->dy0; + ni = GH->cctk_gsh[0]; origin[0] = 0.0; delta[0] = pughGH->dx0; + nj = GH->cctk_gsh[1]; origin[1] = 0.0; delta[1] = pughGH->dy0; } if (IO_verbose) { @@ -270,14 +270,14 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias, int first) if (dir == 2) {lo = 0; hi = 2;} if (npoints > 0) { /* See above comment ... */ - bnd [lo] = GH->lower_bound[(dir+1)%3] + + bnd [lo] = GH->cctk_lbnd[(dir+1)%3] + pughGH->ownership[pughGH->stagger][(dir+1)%3][0]; - bnd [lo+1] = GH->lower_bound[(dir+1)%3] + + bnd [lo+1] = GH->cctk_lbnd[(dir+1)%3] + pughGH->ownership[pughGH->stagger][(dir+1)%3][1]; - bnd [hi] = GH->lower_bound[(dir+2)%3] + + bnd [hi] = GH->cctk_lbnd[(dir+2)%3] + pughGH->ownership[pughGH->stagger][(dir+2)%3][0]; - bnd [hi+1] = GH->lower_bound[(dir+2)%3] + + bnd [hi+1] = GH->cctk_lbnd[(dir+2)%3] + pughGH->ownership[pughGH->stagger][(dir+2)%3][1]; locbnd [lo] = pughGH->ownership[pughGH->stagger][(dir+1)%3][0]; @@ -436,7 +436,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias, int first) /* Time and space attributes */ CACTUS_IEEEIO_ERROR (IOwriteAttribute (myGH->IEEEfile_2D [index][dir], - "time", FLEXIO_REAL, 1, &GH->time)); + "time", FLEXIO_REAL, 1, &GH->cctk_time)); CACTUS_IEEEIO_ERROR (IOwriteAttribute (myGH->IEEEfile_2D [index][dir], "origin", FLEXIO_REAL, 2, origin)); CACTUS_IEEEIO_ERROR (IOwriteAttribute (myGH->IEEEfile_2D [index][dir], diff --git a/src/Write3D.c b/src/Write3D.c index 6d72a93..c12747a 100644 --- a/src/Write3D.c +++ b/src/Write3D.c @@ -389,7 +389,7 @@ void IOFlexIO_Write3D_filename (cGH *GH, char *filename, const char *name) #endif if (onefileperslice) - sprintf (extra, "%s.time_%7.3f", extra, GH->time); + sprintf (extra, "%s.time_%7.3f", extra, GH->cctk_time); /* OUTPUT ONE FILE FOR EACH N PROCESSORS -- cgit v1.2.3