diff options
author | Erik Schnetter <schnetter@gmail.com> | 2012-02-29 21:50:38 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2012-02-29 21:50:38 -0500 |
commit | ad082c7ca224660be81edcaeb3ced0652873f7f6 (patch) | |
tree | b9331a14a96dc56f5a48058303edb4122ba65f50 /Carpet/CarpetLib/src/timestat.cc | |
parent | 2712f70e2948ecb6cb1ce8f1baca526c298836d6 (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() |