From ad082c7ca224660be81edcaeb3ced0652873f7f6 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 29 Feb 2012 21:50:38 -0500 Subject: CarpetLib: Ensure that time and memory statistics are output --- Carpet/CarpetLib/src/timestat.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Carpet/CarpetLib/src/timestat.cc') diff --git a/Carpet/CarpetLib/src/timestat.cc b/Carpet/CarpetLib/src/timestat.cc index 8de116566..19211e027 100644 --- a/Carpet/CarpetLib/src/timestat.cc +++ b/Carpet/CarpetLib/src/timestat.cc @@ -365,9 +365,10 @@ namespace CarpetLib { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - if ((print_timestats_every > 0 and - cctk_iteration % print_timestats_every == 0)) - { + static int next_output = 0; + if (print_timestats_every > 0 and cctk_iteration >= next_output) { + next_output = cctk_iteration + print_timestats_every; + ostringstream filenamebuf; filenamebuf << out_dir << "/" << timestat_file << "." << setw(4) << setfill('0') << dist::rank() -- cgit v1.2.3