aboutsummaryrefslogtreecommitdiff
path: root/src/Output.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2004-06-09 10:42:17 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2004-06-09 10:42:17 +0000
commit50c54f5cd9648dc48090748e2859d6d76db19872 (patch)
tree728be75ed78e25a1e6ec53526f61b34d2c8393a0 /src/Output.c
parent2441627f997a6f069e85d83afad0f51d35695122 (diff)
After setup, do an initial I/O parameter parsing and warn/stop on parsing errors
(depending on IO::strict_io_parameter_check). You will also need to update CactusBase/IOUtil. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@326 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Output.c')
-rw-r--r--src/Output.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/src/Output.c b/src/Output.c
index 4a6178d..f8698d0 100644
--- a/src/Output.c
+++ b/src/Output.c
@@ -22,12 +22,6 @@ static const char *rcsid = "$Header$";
CCTK_FILEVERSION(CactusPUGHIO_IOFlexIO_Output_c)
-/********************************************************************
- ******************** Internal Routines ************************
- ********************************************************************/
-static void CheckSteerableParameters (const cGH *GH);
-
-
/*@@
@routine IOFlexIO_OutputGH
@date Sat March 6 1999
@@ -58,7 +52,7 @@ int IOFlexIO_OutputGH (const cGH *GH)
retval = 0;
- myGH = (const flexioGH *) CCTK_GHExtension (GH, "IOFlexIO");
+ myGH = CCTK_GHExtension (GH, "IOFlexIO");
/* loop over all variables */
for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--)
@@ -126,12 +120,12 @@ int IOFlexIO_OutputVarAs (const cGH *GH, const char *fullname, const char*alias)
}
/* check whether the variable already has an I/O request entry */
- myGH = (const flexioGH *) CCTK_GHExtension (GH, "IOFlexIO");
+ myGH = CCTK_GHExtension (GH, "IOFlexIO");
oneshot = myGH->requests[vindex] == NULL;
if (oneshot)
{
IOUtil_ParseVarsForOutput (GH, CCTK_THORNSTRING, "IOFlexIO::out_vars",
- fullname, 1, myGH->requests);
+ 0, fullname, 1, myGH->requests);
}
/* do the output */
@@ -155,7 +149,7 @@ int IOFlexIO_OutputVarAs (const cGH *GH, const char *fullname, const char*alias)
using the IOFlexIO I/O method.
@enddesc
- @calls CheckSteerableParameters
+ @calls IOFlexIO_CheckSteerableParameters
@var GH
@vdesc pointer to CCTK GH
@@ -178,13 +172,13 @@ int IOFlexIO_TimeFor (const cGH *GH, int vindex)
{
int retval;
char *fullname;
- const flexioGH *myGH;
+ flexioGH *myGH;
- CheckSteerableParameters (GH);
+ myGH = CCTK_GHExtension (GH, "IOFlexIO");
+ IOFlexIO_CheckSteerableParameters (GH, myGH);
/* check if this variable should be output */
- myGH = (const flexioGH *) CCTK_GHExtension (GH, "IOFlexIO");
retval = myGH->requests[vindex] && myGH->requests[vindex]->out_every > 0 &&
GH->cctk_iteration % myGH->requests[vindex]->out_every == 0;
if (retval)
@@ -253,7 +247,7 @@ int IOFlexIO_TriggerOutput (const cGH *GH, int vindex)
if (retval == 0)
{
/* register variable as having output this iteration */
- myGH = (const flexioGH *) CCTK_GHExtension (GH, "IOFlexIO");
+ myGH = CCTK_GHExtension (GH, "IOFlexIO");
myGH->out_last[vindex] = GH->cctk_iteration;
}
@@ -261,11 +255,8 @@ int IOFlexIO_TriggerOutput (const cGH *GH, int vindex)
}
-/********************************************************************
- ******************** Internal Routines ************************
- ********************************************************************/
/*@@
- @routine CheckSteerableParameters
+ @routine IOFlexIO_CheckSteerableParameters
@date Mon Oct 10 2000
@author Thomas Radke
@desc
@@ -280,17 +271,20 @@ int IOFlexIO_TriggerOutput (const cGH *GH, int vindex)
@vtype const cGH *
@vio in
@endvar
+ @var myGH
+ @vdesc pointer to IOFlexIO GH
+ @vtype flexioGH *
+ @vio inout
+ @endvar
@@*/
-static void CheckSteerableParameters (const cGH *GH)
+void IOFlexIO_CheckSteerableParameters (const cGH *GH, flexioGH *myGH)
{
int i, vindex, num_vars;
- flexioGH *myGH;
char *fullname, *msg;
DECLARE_CCTK_PARAMETERS
/* how often to output */
- myGH = (flexioGH *) CCTK_GHExtension (GH, "IOFlexIO");
i = myGH->out_every_default;
myGH->out_every_default = out_every >= 0 ? out_every : io_out_every;
@@ -299,12 +293,12 @@ static void CheckSteerableParameters (const cGH *GH)
{
if (myGH->out_every_default > 0)
{
- CCTK_VInfo (CCTK_THORNSTRING, "IOFlexIO: Periodic output every %d "
+ CCTK_VInfo (CCTK_THORNSTRING, "Periodic IOFlexIO output every %d "
"iterations", myGH->out_every_default);
}
else
{
- CCTK_INFO ("IOFlexIO: Periodic output turned off");
+ CCTK_INFO ("Periodic IOFlexIO output turned off");
}
}
@@ -312,8 +306,8 @@ static void CheckSteerableParameters (const cGH *GH)
if (strcmp (out_vars, myGH->out_vars) || myGH->out_every_default != i)
{
IOUtil_ParseVarsForOutput (GH, CCTK_THORNSTRING, "IOFlexIO::out_vars",
- out_vars, myGH->out_every_default,
- myGH->requests);
+ myGH->stop_on_parse_errors, out_vars,
+ myGH->out_every_default, myGH->requests);
/*** FIXME: IEEEIO doesn't provide a COMPLEX datatype
so we should map CCTK_COMPLEX to two REALs here.
@@ -346,7 +340,7 @@ static void CheckSteerableParameters (const cGH *GH)
fullname = CCTK_FullName (vindex);
if (! msg)
{
- Util_asprintf (&msg, "IOFlexIO: Periodic output requested for '%s'",
+ Util_asprintf (&msg, "Periodic IOFlexIO output requested for '%s'",
fullname);
}
else