From b3a0996f029a48c6a50fe9433434a985a1400e3f Mon Sep 17 00:00:00 2001 From: schnetter Date: Sun, 8 May 2005 12:17:21 +0000 Subject: For timer output before checkpointing, check the parameter IO::checkpoint_every, and output the timers only when a checkpoint should indeed be written at this iteration. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/TimerReport/trunk@14 d0051148-8e13-4bef-be1d-f6c572c85f9f --- param.ccl | 3 +++ src/Output.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/param.ccl b/param.ccl index 20240a2..015b6a6 100644 --- a/param.ccl +++ b/param.ccl @@ -23,3 +23,6 @@ BOOLEAN next "On next iteration" STEERABLE=ALWAYS { } "no" +shares: IO + +USES INT checkpoint_every diff --git a/src/Output.c b/src/Output.c index eca295d..d1d9241 100644 --- a/src/Output.c +++ b/src/Output.c @@ -60,7 +60,9 @@ void TimerReport_Output(CCTK_ARGUMENTS) DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - if (next || out_at == cctk_iteration || (out_every && cctk_iteration%out_every == 0)) + if (next || + out_at == cctk_iteration || + (out_every && cctk_iteration%out_every == 0)) { CCTK_VInfo(CCTK_THORNSTRING, @@ -89,12 +91,15 @@ void TimerReport_Checkpoint(CCTK_ARGUMENTS) DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - if (before_checkpoint) + if (before_checkpoint && + (checkpoint_every && cctk_iteration%checkpoint_every == 0)) { + CCTK_VInfo(CCTK_THORNSTRING, "Timer Report before checkpointing at iteration %d, time %g", cctk_iteration, (double)cctk_time); CCTK_SchedulePrintTimes(NULL); + } } -- cgit v1.2.3