aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/timestat.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2012-02-29 21:50:38 -0500
committerErik Schnetter <schnetter@gmail.com>2012-02-29 21:50:38 -0500
commitad082c7ca224660be81edcaeb3ced0652873f7f6 (patch)
treeb9331a14a96dc56f5a48058303edb4122ba65f50 /Carpet/CarpetLib/src/timestat.cc
parent2712f70e2948ecb6cb1ce8f1baca526c298836d6 (diff)
CarpetLib: Ensure that time and memory statistics are output
Diffstat (limited to 'Carpet/CarpetLib/src/timestat.cc')
-rw-r--r--Carpet/CarpetLib/src/timestat.cc7
1 files changed, 4 insertions, 3 deletions
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()