diff options
-rw-r--r-- | doc/documentation.tex | 4 | ||||
-rw-r--r-- | par/hdf5.par | 6 | ||||
-rw-r--r-- | param.ccl | 20 | ||||
-rw-r--r-- | src/Output.c | 35 | ||||
-rw-r--r-- | src/Startup.c | 23 |
5 files changed, 65 insertions, 23 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex index 194c1ab..9aeb647 100644 --- a/doc/documentation.tex +++ b/doc/documentation.tex @@ -26,8 +26,8 @@ You obtain output by either \begin{itemize} \item setting the appropriate I/O parameters in your parameter files, eg. \begin{verbatim} - IOHDF5::outHDF5_every = 10 - IOHDF5::out_vars = "wavetoy::phi" + IOHDF5::out_every = 10 + IOHDF5::out_vars = "wavetoy::phi" \end{verbatim} \item calling one the flesh's I/O interface routines in your thorn's code, eg. diff --git a/par/hdf5.par b/par/hdf5.par index c612a1a..83fb835 100644 --- a/par/hdf5.par +++ b/par/hdf5.par @@ -26,6 +26,6 @@ IO::out3D_mode = "onefile" IO::out3D_unchunked = "yes" # say when, where, and what GF to output -IOHDF5::outHDF5_every = 1 -IOHDF5::out_vars = "wavetoy::phi" -IOHDF5::outdir_HDF5 = "./hdf5" +IOHDF5::out_every = 1 +IOHDF5::out_vars = "wavetoy::phi" +IOHDF5::outdir = "./hdf5" @@ -8,15 +8,23 @@ private: ######################## # How often to do output ######################## -INT outHDF5_every "How often to do HDF5 output, overrides IO::out_every" STEERABLE = ALWAYS +INT out_every "How often to do IOHDF5 output, overrides IO::out_every" STEERABLE = ALWAYS { - -1:* :: "Values <= 0 disable HDF5 output" + -1:* :: "Values <= 0 disable IOHDF5 output" +} -1 +INT outHDF5_every "How often to do IOHDF5 output, overrides IO::out_every" STEERABLE = ALWAYS +{ + -1:* :: "Values <= 0 disable IOHDF5 output" } -1 #################### # Output directories #################### -STRING outdir_HDF5 "Name of IO output directory, overrides IO::outdir" +STRING outdir "Name of IOHDF5 output directory, overrides IO::outdir" +{ + .* :: A regex which matches everything +} "." +STRING outdir_HDF5 "DEPRICATED: Name of IOHDF5 output directory, overrides IO::outdir" { .* :: A regex which matches everything } "." @@ -50,13 +58,15 @@ shares: IO #################### # Output directories #################### -USES STRING outdir +# FIXME: need USES AS +#USES STRING outdir ######################## # How often to do output ######################## -USES INT out_every +# FIXME: need USES AS +#USES INT out_every ################ diff --git a/src/Output.c b/src/Output.c index fd3e721..f9186d3 100644 --- a/src/Output.c +++ b/src/Output.c @@ -51,11 +51,11 @@ static void CheckSteerableParameters (ioHDF5GH *myGH); @@*/ int IOHDF5_OutputGH (const cGH *GH) { - DECLARE_CCTK_PARAMETERS int vindex, retval; ioHDF5GH *myGH; const char *name; char *fullname; + DECLARE_CCTK_PARAMETERS /* Get the GH extension for IOHDF5 */ @@ -314,16 +314,39 @@ int IOHDF5_TriggerOutput (const cGH *GH, int vindex) @@*/ static void CheckSteerableParameters (ioHDF5GH *myGH) { + int type, times_set; + static int out_vars_lastset = -1, user_was_warned = 0; DECLARE_CCTK_PARAMETERS - int times_set; - static int out_vars_lastset = -1; /* How often to output */ - myGH->out_every = out_every > 0 ? out_every : -1; - if (outHDF5_every > 0) + if (out_every > 0 || outHDF5_every > 0) + { + if (out_every <= 0) + { + if (! user_was_warned) + { + CCTK_WARN (1, "Parameter 'IOHDF5::outHDF5_every is depricated in " + "BETA12, please use 'IOHDF5::out_every' instead"); + user_was_warned = 1; + } + myGH->out_every = outHDF5_every; + } + else + { + myGH->out_every = out_every; + } + } + else { - myGH->out_every = outHDF5_every; + myGH->out_every = *(const CCTK_INT *) + CCTK_ParameterGet ("out_every", + CCTK_ImplementationThorn ("IO"), + &type); + if (myGH->out_every == 0) + { + myGH->out_every = -1; + } } /* re-parse the 'IOHDF5::out_vars' parameter if it was changed */ diff --git a/src/Startup.c b/src/Startup.c index 405a110..d455468 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -140,23 +140,32 @@ static void *IOHDF5_SetupGH (tFleshConfig *config, myGH->cp_filename_list = (char **) calloc (checkpoint_keep, sizeof (char *)); myGH->cp_filename_index = 0; - /* Check whether "IOHDF5::outdir_HDF5" was set. + /* Check whether "IOHDF5::outdir" was set. If so take this directory otherwise default to "IO::outdir" */ - if (CCTK_ParameterQueryTimesSet ("outdir_HDF5", CCTK_THORNSTRING) > 0) + if (CCTK_ParameterQueryTimesSet ("outdir", CCTK_THORNSTRING) > 0 || + CCTK_ParameterQueryTimesSet ("outdir_HDF5", CCTK_THORNSTRING) > 0) { - if (CCTK_Equals (out3D_mode, "onefile") || ! strstr (outdir_HDF5, "%u")) + if (CCTK_ParameterQueryTimesSet ("outdir", CCTK_THORNSTRING) <= 0) { - myGH->outdir = strdup (outdir_HDF5); + CCTK_WARN (1, "Parameter 'IOHDF5::outdir_HDF5 is depricated in BETA12, " + "please use 'IOHDF5::outdir' instead"); + outdir = outdir_HDF5; + } + + if (CCTK_Equals (out3D_mode, "onefile") || ! strstr (outdir, "%u")) + { + myGH->outdir = strdup (outdir); } else { - myGH->outdir = (char *) malloc (strlen (outdir_HDF5) + 20); - sprintf (myGH->outdir, outdir_HDF5, CCTK_MyProc (GH)); + myGH->outdir = (char *) malloc (strlen (outdir) + 20); + sprintf (myGH->outdir, outdir, CCTK_MyProc (GH)); } } else { - myGH->outdir = strdup (outdir); + myGH->outdir = CCTK_ParameterValString ("outdir", + CCTK_ImplementationThorn ("IO")); } /* Create the output directory */ |