diff options
Diffstat (limited to 'src/Output.c')
-rw-r--r-- | src/Output.c | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/src/Output.c b/src/Output.c index 144a74f..7241277 100644 --- a/src/Output.c +++ b/src/Output.c @@ -29,7 +29,6 @@ CCTK_FILEVERSION(CactusIO_IOJpeg_Output_c) ******************** Internal Routines ************************ ********************************************************************/ static int CheckOutputVar (int vindex); -static void CheckSteerableParameters (ioJpegGH *myGH); static void SetOutputFlag (int vindex, const char *optstring, void *arg); @@ -62,7 +61,7 @@ int IOJpeg_OutputGH (const cGH *GH) retval = 0; - myGH = (const ioJpegGH *) CCTK_GHExtension (GH, "IOJpeg"); + myGH = CCTK_GHExtension (GH, "IOJpeg"); /* loop over all variables */ for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--) @@ -162,8 +161,8 @@ int IOJpeg_TimeFor (const cGH *GH, int vindex) ioJpegGH *myGH; - myGH = (ioJpegGH *) CCTK_GHExtension (GH, "IOJpeg"); - CheckSteerableParameters (myGH); + myGH = CCTK_GHExtension (GH, "IOJpeg"); + IOJpeg_CheckSteerableParameters (myGH); /* check if this variable should be output */ result = myGH->out_every[vindex] > 0 && @@ -222,7 +221,7 @@ int IOJpeg_TriggerOutput (const cGH *GH, int vindex) if (retval == 0) { /* register variable as having output this iteration */ - myGH = (const ioJpegGH *) CCTK_GHExtension (GH, "IOJpeg"); + myGH = CCTK_GHExtension (GH, "IOJpeg"); myGH->out_last[vindex] = GH->cctk_iteration; } @@ -230,11 +229,24 @@ int IOJpeg_TriggerOutput (const cGH *GH, int vindex) } -/******************************************************************** - ******************** Internal Routines ************************ - ********************************************************************/ -/* check if steerable parameters have changed */ -static void CheckSteerableParameters (ioJpegGH *myGH) +/*@@ + @routine IOJpeg_CheckSteerableParameters + @date Mon Oct 10 2000 + @author Thomas Radke + @desc + Checks if IOJpeg steerable parameters were changed + and does appropriate re-evaluation. + @enddesc + + @calls CCTK_TraverseString + + @var myGH + @vdesc pointer to IOJpeg grid hierarchy + @vtype ioJpegG * + @vio inout + @endvar +@@*/ +void IOJpeg_CheckSteerableParameters (ioJpegGH *myGH) { int i, num_vars; char *fullname, *msg; @@ -250,12 +262,12 @@ static void CheckSteerableParameters (ioJpegGH *myGH) { if (myGH->out_every_default > 0) { - CCTK_VInfo (CCTK_THORNSTRING, "IOJpeg: Periodic output every %d " + CCTK_VInfo (CCTK_THORNSTRING, "Periodic IOJpeg output every %d " "iterations", myGH->out_every_default); } else { - CCTK_INFO ("IOJpeg: Periodic output turned off"); + CCTK_INFO ("Periodic IOJpeg output turned off"); } } @@ -264,7 +276,12 @@ static void CheckSteerableParameters (ioJpegGH *myGH) { num_vars = CCTK_NumVars (); memset (myGH->out_every, 0, num_vars * sizeof (CCTK_INT)); - CCTK_TraverseString (out_vars, SetOutputFlag, myGH, CCTK_GROUP_OR_VAR); + if (CCTK_TraverseString (out_vars, SetOutputFlag, myGH, + CCTK_GROUP_OR_VAR) < 0) + { + CCTK_WARN (myGH->stop_on_parse_errors ? 0 : 1, + "error while parsing parameter 'IOJpeg::out_vars'"); + } if (myGH->out_every_default == i || ! CCTK_Equals (verbose, "none")) { @@ -276,7 +293,7 @@ static void CheckSteerableParameters (ioJpegGH *myGH) fullname = CCTK_FullName (i); if (! msg) { - Util_asprintf (&msg, "IOJpeg: Periodic output requested for '%s'", + Util_asprintf (&msg, "Periodic IOJpeg output requested for '%s'", fullname); } else @@ -300,6 +317,9 @@ static void CheckSteerableParameters (ioJpegGH *myGH) } +/******************************************************************** + ******************** Internal Routines ************************ + ********************************************************************/ /* check if this variable can be output (static conditions) */ static int CheckOutputVar (int vindex) { @@ -353,6 +373,7 @@ static void SetOutputFlag (int vindex, const char *optstring, void *arg) if (optstring) { IOUtil_ParseOutputFrequency (CCTK_THORNSTRING, "IOJpeg::out_vars", + myGH->stop_on_parse_errors, vindex, optstring, &myGH->out_every[vindex]); } |