diff options
author | Erik Schnetter <schnetter@gmail.com> | 2012-02-29 21:50:38 -0500 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2012-09-11 18:23:09 +0100 |
commit | babbc62443d1402e0feaa95d14a1aca81794c795 (patch) | |
tree | ba6e44f25507d9af3efb4774c7a5804156667694 /Carpet/CarpetLib/src/timestat.cc | |
parent | 91c6fb2a157e8357dc510dfd67d7859e55427136 (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.cc | 7 |
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() |