aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@ff385933-4943-42dc-877b-ffc776028de6>2003-06-17 10:47:23 +0000
committertradke <tradke@ff385933-4943-42dc-877b-ffc776028de6>2003-06-17 10:47:23 +0000
commita1b2cf0343152ad1240d27ff9265f78b8c323852 (patch)
tree4cc00e65df3166db439689b9365f2ac877a76754
parentc78af4d3724f4ee7fe7a8442e8aae8095e83da96 (diff)
Added steerable INTEGER parameter NaNChecker::check_after to specify an
iteration number when to start checking for NaNs. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/NaNChecker/trunk@41 ff385933-4943-42dc-877b-ffc776028de6
-rw-r--r--doc/documentation.tex7
-rw-r--r--param.ccl19
-rw-r--r--src/NaNCheck.c3
3 files changed, 17 insertions, 12 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex
index 4dd7a8e..c2383d0 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -51,15 +51,16 @@ Periodic testing of variables can easily be achieved by adding NaNChecker
to the {\tt ActiveThorns} parameter, and setting the parameters
\noindent
-{\tt NaNChecker::check\_every} and {\tt NaNChecker::check\_vars}
+{\tt NaNChecker::check\_every, NaNChecker::check\_after,} and {\tt NaNChecker::check\_vars}
\noindent
to the required
-values. (For most testing purposes these can be set to {\tt 1} and {"all"}
+values. (For most testing purposes these can be set to {\tt 1, 0,} and {"all"}
respectively).
The NaNChecker then registers a routine at {\bf CCTK\_POSTSTEP} which checks
-at every {\tt NanChecker::check\_every} iteration all the variables listed in
+at every {\tt NanChecker::check\_every} iteration -- starting at iteration
+number {\tt NaNChecker::check\_after} -- all the variables listed in
{\tt NaNChecker::check\_vars} for NaN or infinite values (depending on {\tt
NaNChecker::check\_for}) and --- if such a value is found --- performs an
action as specified in {\tt NaNChecker::action\_if\_found}.\\
diff --git a/param.ccl b/param.ccl
index 56e1892..2705545 100644
--- a/param.ccl
+++ b/param.ccl
@@ -6,28 +6,33 @@
#############################################################################
private:
-INT check_every "How often to check for NaN's" STEERABLE = ALWAYS
+INT check_every "How often to check for NaNs" STEERABLE = ALWAYS
{
0 :: "Never (default)"
1:* :: "Every so many iterations"
} 0
-INT report_max "How many NaN's to report for a single variable" STEERABLE = ALWAYS
+INT check_after "Start checking for NaNs after so many iterations" STEERABLE = ALWAYS
+{
+ 0:* :: "Any valid iteration number"
+} 0
+
+INT report_max "How many NaNs to report for a single variable" STEERABLE = ALWAYS
{
-1 :: "Report all (default)"
- 0:* :: "Do not report more than report_max number of NaN's"
+ 0:* :: "Do not report more than report_max number of NaNs"
} -1
-STRING check_vars "Groups and/or variables to check for NaN's" STEERABLE = ALWAYS
+STRING check_vars "Groups and/or variables to check for NaNs" STEERABLE = ALWAYS
{
.* :: "List of full group and/or variable names, or 'all' for everything"
} ""
-KEYWORD check_for "Check for NaN's and/or infinite numbers (only evaluated if finite(3) is available)" STEERABLE = ALWAYS
+KEYWORD check_for "Check for NaNs and/or infinite numbers (only evaluated if finite(3) is available)" STEERABLE = ALWAYS
{
- "NaN" :: "Check only for NaN's"
+ "NaN" :: "Check only for NaNs"
"Inf" :: "Check only for infinite numbers"
- "both" :: "Check for both NaN's and infinite numbers"
+ "both" :: "Check for both NaNs and infinite numbers"
} "both"
BOOLEAN out_NaNmask "Dump the NaN grid function mask into an HDF5 file" STEERABLE = ALWAYS
diff --git a/src/NaNCheck.c b/src/NaNCheck.c
index 4368143..d140c47 100644
--- a/src/NaNCheck.c
+++ b/src/NaNCheck.c
@@ -115,7 +115,7 @@ int NaNChecker_NaNCheck (const cGH *GH)
DECLARE_CCTK_PARAMETERS
- if (GH->cctk_iteration % check_every)
+ if (GH->cctk_iteration < check_after || GH->cctk_iteration % check_every)
{
return (0);
}
@@ -182,7 +182,6 @@ int NaNChecker_NaNCheck (const cGH *GH)
{
CCTK_WARN (1, "'action_if_found' parameter is set to 'terminate' - "
"scheduling graceful termination of Cactus");
- CCTK_TerminateNext (NULL);
}
else if (CCTK_Equals (info.action_if_found, "abort"))
{