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
committerBarry Wardell <barry.wardell@gmail.com>2012-09-11 18:23:09 +0100
commitbabbc62443d1402e0feaa95d14a1aca81794c795 (patch)
treeba6e44f25507d9af3efb4774c7a5804156667694 /Carpet/CarpetLib/src/timestat.cc
parent91c6fb2a157e8357dc510dfd67d7859e55427136 (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()