diff options
author | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2000-09-18 20:06:56 +0000 |
---|---|---|
committer | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2000-09-18 20:06:56 +0000 |
commit | e8f24ec4a38e4056962229c37ed2e4ed8cbbc611 (patch) | |
tree | 3039ac406c8011a9679d715fdf357ff603ce65ee /src | |
parent | 89da3588c8551a9d41a73e8fedaf98a2fd1d8b2e (diff) |
Give a more explanatory warning message if output for a given variable
was already done. Increased warning level to 5.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@66 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src')
-rw-r--r-- | src/Output.c | 70 | ||||
-rw-r--r-- | src/OutputInfo.c | 27 |
2 files changed, 86 insertions, 11 deletions
diff --git a/src/Output.c b/src/Output.c index bff5c34..05541f9 100644 --- a/src/Output.c +++ b/src/Output.c @@ -55,14 +55,19 @@ int IOBasic_OutputGH (cGH *GH) /* Return if no output is required */ if (myGH->outScalar_every <= 0) + { return (0); + } /* Loop over all variables */ - for (index = 0; index < CCTK_NumVars (); index++) { + for (index = 0; index < CCTK_NumVars (); index++) + { /* Is it time for output ? */ if (! IOBasic_TimeForOutput (GH, index)) + { continue; + } /* Get the variable name for this index (for filename) */ name = CCTK_VarName (index); @@ -76,9 +81,13 @@ int IOBasic_OutputGH (cGH *GH) /* Make the IO call */ if (CCTK_GroupTypeFromVarI (index) == GROUP_SCALAR) + { IOBasic_Write (GH, index, name); + } else + { IOBasic_WriteGF (GH, index, name); + } /* Register GF as having 0D output this iteration */ myGH->outScalar_last [index] = GH->cctk_iteration; @@ -86,8 +95,6 @@ int IOBasic_OutputGH (cGH *GH) } /* end of loop over all variables */ return (0); - - } @@ -133,9 +140,13 @@ int IOBasic_OutputVarAs (cGH *GH, const char *fullname, const char *alias) #endif if (CCTK_GroupTypeFromVarI (index) == GROUP_SCALAR) + { IOBasic_Write (GH, index, alias); + } else + { IOBasic_WriteGF (GH, index, alias); + } return (0); } @@ -187,25 +198,62 @@ int IOBasic_TimeForOutput (cGH *GH, int index) /* check if any output was requested */ if (myGH->outScalar_every <= 0) + { return (0); + } grouptype = CCTK_GroupTypeFromVarI (index); /* Check this GF should be output */ if (myGH->do_outScalar [index] && (grouptype == GROUP_GF || grouptype == GROUP_SCALAR) - && (GH->cctk_iteration % myGH->outScalar_every == 0)) { + && (GH->cctk_iteration % myGH->outScalar_every == 0)) + { /* Check GF not already output this iteration */ if (myGH->outScalar_last [index] == GH->cctk_iteration) - CCTK_WARN (2, "Already done Scalar output in IO"); + { + char *fullname = CCTK_FullName (index); + + + CCTK_VWarn (5, __LINE__, __FILE__, CCTK_THORNSTRING, + "Already done Scalar output for variable '%s' in current " + "iteration (probably via triggers)", fullname); + free (fullname); + } else + { return_type = 1; + } } return (return_type); } + +/*@@ + @routine IOBasic_TriggerOutput + @date Sat March 6 1999 + @author Gabrielle Allen + @desc + Triggers the output a variable using IOBasic's Scalar + output method + method + @enddesc + @calledby CCTK scheduler + @var GH + @vdesc Pointer to CCTK GH + @vtype cGH + @vio in + @vcomment + @endvar + @var index + @vdesc index of variable to output + @vtype int + @vio in + @vcomment + @endvar +@@*/ int IOBasic_TriggerOutput (cGH *GH, int index) { const char *name; @@ -225,9 +273,13 @@ int IOBasic_TriggerOutput (cGH *GH, int index) /* Do the Scalar output */ if (CCTK_GroupTypeFromVarI (index) == GROUP_SCALAR) + { IOBasic_Write (GH, index, name); + } else + { IOBasic_WriteGF (GH, index, name); + } /* Register variable as having Scalar output this iteration */ myGH->outScalar_last [index] = GH->cctk_iteration; @@ -247,17 +299,21 @@ static void CheckSteerableParameters (iobasicGH *myGH) /* How often to output */ myGH->outScalar_every = out_every > 0 ? out_every : -1; if (outScalar_every > 0) + { myGH->outScalar_every = outScalar_every; + } /* Check the 'outScalar_vars' parameter */ paramdata = CCTK_ParameterData ("outScalar_vars", CCTK_THORNSTRING); - if (! paramdata) { + if (! paramdata) + { CCTK_WARN (1, "Couldn't get info on parameter 'outScalar_vars'"); return; } /* re-parse the 'outScalar_vars' parameter if it was changed */ - if (paramdata->n_set != outScalar_vars_lastset) { + if (paramdata->n_set != outScalar_vars_lastset) + { IOUtil_ParseVarsForOutput (outScalar_vars, myGH->do_outScalar); /* Save the last setting of 'outScalar_vars' parameter */ diff --git a/src/OutputInfo.c b/src/OutputInfo.c index eaf3bf1..c7b79a5 100644 --- a/src/OutputInfo.c +++ b/src/OutputInfo.c @@ -23,7 +23,9 @@ /* the number at which to switch from decimal to exp notation */ #define DECIMAL_PRECISION 1.0e-8 #define DECIMAL_TOOBIG 1.0e+8 -#define USE_DECIMAL_NOTATION(x) ((fabs (x) > DECIMAL_PRECISION) || ((x) == 0.0) || (fabs(x) < DECIMAL_TOOBIG)) +#define USE_DECIMAL_NOTATION(x) ((fabs (x) > DECIMAL_PRECISION) || \ + ((x) == 0.0) || \ + (fabs(x) < DECIMAL_TOOBIG)) /* static variables */ static int print_header = 0; @@ -98,11 +100,15 @@ int IOBasic_OutputInfoGH (cGH *GH) do_outInfo = 0; for (i = 0; i < CCTK_NumVars (); i++) + { do_outInfo |= myGH->do_outInfo[i]; + } /* suppress any output if there are no variables to output */ if (! do_outInfo) + { return (0); + } print_header = 1; } @@ -254,7 +260,6 @@ int IOBasic_OutputInfoGH (cGH *GH) @vcomment @endvar @@*/ - int IOBasic_TimeForInfo (cGH *GH, int index) { DECLARE_CCTK_PARAMETERS @@ -272,11 +277,15 @@ int IOBasic_TimeForInfo (cGH *GH, int index) /* How often to output */ myGH->outInfo_every = out_every > 0 ? out_every : -1; if (outInfo_every > 0) + { myGH->outInfo_every = outInfo_every; + } /* return if no output requested */ if (myGH->outInfo_every <= 0) + { return (0); + } /* Check the 'outInfo_vars' parameter */ paramdata = CCTK_ParameterData ("outInfo_vars", CCTK_THORNSTRING); @@ -305,9 +314,19 @@ int IOBasic_TimeForInfo (cGH *GH, int index) /* Check GF not already output this iteration */ if (myGH->outInfo_last[index] == GH->cctk_iteration) - CCTK_WARN (2, "Already done info output in IO"); + { + char *fullname = CCTK_FullName (index); + + + CCTK_VWarn (5, __LINE__, __FILE__, CCTK_THORNSTRING, + "Already done Info output for variable '%s' in current " + "iteration (probably via triggers)", fullname); + free (fullname); + } else - retval = 1; + { + return_type = 1; + } } return retval; |