From ba4a25580fd0c386136d7844fda7558ea6e2cd50 Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 30 Jan 2006 11:50:15 +0000 Subject: Bugfix for periodic checking for NaNs: NaNChecker::action_if_found was ignored if NaNChecker::out_nanmask was set to "no". git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/NaNChecker/trunk@80 ff385933-4943-42dc-877b-ffc776028de6 --- src/NaNCheck.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/NaNCheck.c b/src/NaNCheck.c index 13814c2..6f339f0 100644 --- a/src/NaNCheck.c +++ b/src/NaNCheck.c @@ -181,12 +181,10 @@ void NaNChecker_NaNCheck (CCTK_ARGUMENTS) #endif CCTK_TraverseString (check_vars, CheckForNaN, &info, CCTK_GROUP_OR_VAR); - if (info.NaNmask && info.bitmask) - { - sum_handle = CCTK_ReductionHandle ("sum"); - CCTK_ReduceLocalScalar (cctkGH, -1, sum_handle, &info.count, NaNsFound, - CCTK_VARIABLE_INT); - } + + sum_handle = CCTK_ReductionHandle ("sum"); + CCTK_ReduceLocalScalar (cctkGH, -1, sum_handle, &info.count, NaNsFound, + CCTK_VARIABLE_INT); } @@ -218,16 +216,19 @@ void NaNChecker_TakeAction (CCTK_ARGUMENTS) } /* output NaN mask with the 'IOHDF5' I/O method */ - if (CCTK_Equals (verbose, "all")) + if (out_NaNmask) { - CCTK_INFO ("Write out NaN mask using the 'IOHDF5' I/O method"); - } - CCTK_OutputVarAsByMethod (cctkGH, - "NaNChecker::NaNmask{downsample={1 1 1}}", - "IOHDF5", "NaNmask"); + if (CCTK_Equals (verbose, "all")) + { + CCTK_INFO ("Write out NaN mask using the 'IOHDF5' I/O method"); + } + CCTK_OutputVarAsByMethod (cctkGH, + "NaNChecker::NaNmask{downsample={1 1 1}}", + "IOHDF5", "NaNmask"); - /* save the iteration of the last NaNmask output */ - last_iteration_output = cctk_iteration; + /* save the iteration of the last NaNmask output */ + last_iteration_output = cctk_iteration; + } if (CCTK_Equals (action_if_found, "terminate")) { -- cgit v1.2.3