From 81c567b85fa22eb167480a6a93c53fe9aa67922e Mon Sep 17 00:00:00 2001 From: tradke Date: Wed, 29 Nov 2000 01:20:17 +0000 Subject: Renamed local variable 'index' into 'vindex' to stop compiler warnings about hiding a global routine index(3). git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOStreamedHDF5/trunk@58 0888f3d4-9f52-45d2-93bc-d00801ff5e46 --- src/Output.c | 4 ++-- src/Startup.c | 5 ++--- src/Write.c | 2 +- src/ioStreamedHDF5GH.h | 8 +++++--- 4 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Output.c b/src/Output.c index 7f1bbd5..0ce5a4e 100644 --- a/src/Output.c +++ b/src/Output.c @@ -189,7 +189,7 @@ int IOStreamedHDF5_TimeFor (cGH *GH, } /* Check this variable should be output */ - if (! (myGH->do_output[vindex] && GH->cctk_iteration % myGH->out_every == 0)) + if (! (myGH->geo_output[vindex] && GH->cctk_iteration % myGH->out_every == 0)) { return (0); } @@ -297,7 +297,7 @@ static void CheckSteerableParameters (ioStreamedHDF5GH *myGH) times_set = CCTK_ParameterQueryTimesSet ("out_vars", CCTK_THORNSTRING); if (times_set != out_vars_lastset) { - IOHDF5Util_ParseVarsForOutput (out_vars, myGH->do_output, myGH->geo_output); + IOHDF5Util_ParseVarsForOutput (out_vars, myGH->geo_output); /* Save the last setting of 'out_vars' parameter */ out_vars_lastset = times_set; diff --git a/src/Startup.c b/src/Startup.c index b8b448c..2ba52ff 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -192,9 +192,8 @@ static void *IOStreamedHDF5_SetupGH (tFleshConfig *config, numvars = CCTK_NumVars (); myGH = (ioStreamedHDF5GH *) malloc (sizeof (ioStreamedHDF5GH)); - myGH->do_output = (char *) malloc (numvars * sizeof (char)); - myGH->geo_output = (ioHDF5Geo_t*) malloc (numvars * sizeof (ioHDF5Geo_t)); - myGH->out_last = (int *) malloc (numvars * sizeof (int)); + myGH->geo_output = (ioHDF5Geo_t **) calloc (numvars, sizeof (ioHDF5Geo_t *)); + myGH->out_last = (int *) malloc (numvars * sizeof (int)); for (i = 0; i < numvars; i++) { diff --git a/src/Write.c b/src/Write.c index a75b5e0..2311a46 100644 --- a/src/Write.c +++ b/src/Write.c @@ -132,7 +132,7 @@ void IOStreamedHDF5_Write (cGH *GH, } /* output the data */ - IOHDF5Util_DumpVar (GH, vindex, timelevel, &myGH->geo_output[vindex], file, 0); + IOHDF5Util_DumpVar (GH, vindex, timelevel, myGH->geo_output[vindex], file, 0); /* close the file */ if (file >= 0) diff --git a/src/ioStreamedHDF5GH.h b/src/ioStreamedHDF5GH.h index 852b847..2ec98f6 100644 --- a/src/ioStreamedHDF5GH.h +++ b/src/ioStreamedHDF5GH.h @@ -19,9 +19,11 @@ typedef struct /* how often to output */ int out_every; - /* flags indicating output for var [i] */ - char *do_output; - ioHDF5Geo_t *geo_output; + /* array of variable output requests */ + /* FIXME: make this a linked list of requests + to allow for multiple requests per variable + (eg. with different hyperslab parameters) */ + ioHDF5Geo_t **geo_output; /* the last iteration output */ int *out_last; -- cgit v1.2.3