diff options
author | tradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d> | 2002-03-14 13:10:44 +0000 |
---|---|---|
committer | tradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d> | 2002-03-14 13:10:44 +0000 |
commit | f087dd90c22fc674aa0c477785f456123c4d0661 (patch) | |
tree | 0ab65ce3166382b7ba3edd58a473f6c701112780 /src | |
parent | 5cb06b5bd1a18384113a72cf0762bd6dc6b43de8 (diff) |
Added new parameters 'IOHDF5::outdir' and 'IOHDF5::out_every' which just
depricate the old parameters 'IOHDF5::outdir_HDF5' and 'IOHDF5::outHDF5_every'.
This is to get a consistent set of I/O parameter names for all I/O thorns.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5/trunk@112 4825ed28-b72c-4eae-9704-e50c059e567d
Diffstat (limited to 'src')
-rw-r--r-- | src/Output.c | 35 | ||||
-rw-r--r-- | src/Startup.c | 23 |
2 files changed, 45 insertions, 13 deletions
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 */ |