aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@d0051148-8e13-4bef-be1d-f6c572c85f9f>2005-05-08 12:17:21 +0000
committerschnetter <schnetter@d0051148-8e13-4bef-be1d-f6c572c85f9f>2005-05-08 12:17:21 +0000
commitb3a0996f029a48c6a50fe9433434a985a1400e3f (patch)
treee6b24401b066e1b5172a2c098b0260db0188e61e
parent172c609cef493c8a99701b02c66151da7d669490 (diff)
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
-rw-r--r--param.ccl3
-rw-r--r--src/Output.c9
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);
+
}
}