diff options
author | tradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d> | 2002-04-26 16:01:22 +0000 |
---|---|---|
committer | tradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d> | 2002-04-26 16:01:22 +0000 |
commit | cfd0aa21d5237ba08b06f687c21f5d1d56a41003 (patch) | |
tree | 31ab000990aa9be74b27a43a43ef10a75d696315 | |
parent | 6380d01f896e96eb4d536e7c4fc88fed858b6b2e (diff) |
Changes to use the I/O request description and parsing routines which moved
from IOHDF5Util to IOUtil.
You must update both BetaThorns/IOHDF5Util and CactusBase/IOUtil now.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5/trunk@126 4825ed28-b72c-4eae-9704-e50c059e567d
-rw-r--r-- | src/Output.c | 20 | ||||
-rw-r--r-- | src/Startup.c | 3 | ||||
-rw-r--r-- | src/Write.c | 3 | ||||
-rw-r--r-- | src/ioHDF5GH.h | 4 |
4 files changed, 14 insertions, 16 deletions
diff --git a/src/Output.c b/src/Output.c index d66dc55..b06e979 100644 --- a/src/Output.c +++ b/src/Output.c @@ -131,7 +131,7 @@ int IOHDF5_OutputGH (const cGH *GH) int IOHDF5_OutputVarAs (const cGH *GH, const char *fullname, const char *alias) { int vindex, oneshot, retval; - ioHDF5GH *myGH; + const ioHDF5GH *myGH; DECLARE_CCTK_PARAMETERS @@ -145,20 +145,20 @@ int IOHDF5_OutputVarAs (const cGH *GH, const char *fullname, const char *alias) /* check whether the variable already has an I/O request entry */ myGH = (ioHDF5GH *) CCTK_GHExtension (GH, "IOHDF5"); - oneshot = myGH->slablist[vindex] == NULL; + oneshot = myGH->requests[vindex] == NULL; if (oneshot) { - IOHDF5Util_ParseVarsForOutput (GH, fullname, myGH->slablist); + IOUtil_ParseVarsForOutput (GH, fullname, myGH->requests); } /* do the output */ retval = IOHDF5_Write (GH, vindex, alias); - if (oneshot && myGH->slablist[vindex]) + if (oneshot && myGH->requests[vindex]) { - free (myGH->slablist[vindex]); - myGH->slablist[vindex] = NULL; + IOUtil_FreeIORequest (&myGH->requests[vindex]); } + return (retval); } @@ -194,15 +194,15 @@ int IOHDF5_OutputVarAs (const cGH *GH, const char *fullname, const char *alias) int IOHDF5_TimeFor (const cGH *GH, int vindex) { int retval; - ioHDF5GH *myGH; char *fullname; + const ioHDF5GH *myGH; CheckSteerableParameters (GH); /* check if this variable should be output */ myGH = (ioHDF5GH *) CCTK_GHExtension (GH, "IOHDF5"); - retval = myGH->out_every > 0 && myGH->slablist[vindex] && + retval = myGH->out_every > 0 && myGH->requests[vindex] && GH->cctk_iteration % myGH->out_every == 0; if (retval) { @@ -342,9 +342,9 @@ static void CheckSteerableParameters (const cGH *GH) times_set = CCTK_ParameterQueryTimesSet ("out_vars", CCTK_THORNSTRING); if (times_set != out_vars_lastset) { - IOHDF5Util_ParseVarsForOutput (GH, out_vars, myGH->slablist); + IOUtil_ParseVarsForOutput (GH, out_vars, myGH->requests); - /* Save the last setting of 'out_vars' parameter */ + /* save the last setting of 'out_vars' parameter */ out_vars_lastset = times_set; } } diff --git a/src/Startup.c b/src/Startup.c index 15dc785..28efa08 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -15,7 +15,6 @@ #include "cctk.h" #include "cctk_Parameters.h" #include "CactusBase/IOUtil/src/ioGH.h" -#include "CactusBase/IOUtil/src/ioutil_Utils.h" #include "CactusBase/IOUtil/src/ioutil_CheckpointRecovery.h" #include "ioHDF5GH.h" @@ -130,7 +129,7 @@ static void *SetupGH (tFleshConfig *config, int conv_level, cGH *GH) numvars = CCTK_NumVars (); myGH = (ioHDF5GH *) malloc (sizeof (ioHDF5GH)); myGH->out_last = (int *) malloc (numvars * sizeof (int)); - myGH->slablist = (ioSlab **) calloc (numvars, sizeof (ioSlab *)); + myGH->requests = (ioRequest **) calloc (numvars, sizeof (ioRequest *)); myGH->cp_filename_list = (char **) calloc (checkpoint_keep, sizeof (char *)); myGH->cp_filename_index = 0; diff --git a/src/Write.c b/src/Write.c index b1e8f20..b21c2d2 100644 --- a/src/Write.c +++ b/src/Write.c @@ -15,7 +15,6 @@ #include "cctk_Parameters.h" #include "StoreNamedData.h" #include "CactusBase/IOUtil/src/ioGH.h" -#include "CactusBase/IOUtil/src/ioutil_Utils.h" #include "CactusBase/IOUtil/src/ioutil_AdvertisedFiles.h" #include "ioHDF5GH.h" @@ -164,7 +163,7 @@ int IOHDF5_Write (const cGH *GH, int vindex, const char *alias) } /* output the data */ - retval = IOHDF5Util_DumpVar (GH, myGH->slablist[vindex], file); + retval = IOHDF5Util_DumpVar (GH, myGH->requests[vindex], file); /* close the file */ if (file >= 0) diff --git a/src/ioHDF5GH.h b/src/ioHDF5GH.h index 4af80f4..1c2fc5a 100644 --- a/src/ioHDF5GH.h +++ b/src/ioHDF5GH.h @@ -35,8 +35,8 @@ typedef struct /* flag to indicate request for timer output */ int print_timing_info; - /* hyperslab description list (for all variables) */ - ioSlab **slablist; + /* I/O request description list (for all variables) */ + ioRequest **requests; /* ring buffer for list of successfully created cp files */ int cp_filename_index; |