diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-03-12 16:15:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-03-12 16:15:00 +0000 |
commit | ad9094cdc37a89c1e9b0fefa2bf9800727a70ed4 (patch) | |
tree | 610d3d1c5e98db044eb3ff13994a2183e652a015 /Carpet/Carpet | |
parent | 880be55769936e6b37cbacc0e3cb3c00a6ca115d (diff) |
Carpet: Simplify timer interface
Remove parameter parameters Carpet::silent, which was inconvenient to
use.
Do not output timing statistics by default.
Allow parameter values -1 in addition to 0 to disable timing output.
Place the timing statistics into the grid scalars even if timing
output is disabled.
darcs-hash:20070312161517-dae7b-77a7d21f37179962beae2f544e7ee6a174c45508.gz
Diffstat (limited to 'Carpet/Carpet')
-rw-r--r-- | Carpet/Carpet/param.ccl | 8 | ||||
-rw-r--r-- | Carpet/Carpet/src/Evolve.cc | 5 | ||||
-rw-r--r-- | Carpet/Carpet/src/Timing.cc | 58 |
3 files changed, 36 insertions, 35 deletions
diff --git a/Carpet/Carpet/param.ccl b/Carpet/Carpet/param.ccl index 7244d43a5..3bb90b3e4 100644 --- a/Carpet/Carpet/param.ccl +++ b/Carpet/Carpet/param.ccl @@ -317,10 +317,6 @@ BOOLEAN suppress_restriction "Suppress the restriction operations. This makes t -BOOLEAN silent "Display no info on the screen" STEERABLE=always -{ -} "no" - BOOLEAN verbose "Display more info on the screen" STEERABLE=always { } "no" @@ -347,12 +343,14 @@ BOOLEAN output_internal_data "Periodically print internal data to the screen for INT print_timestats_every "Print interesting timing statistics periodically" STEERABLE=always { + -1 :: "don't report" 0 :: "don't report" 1:* :: "report every so many iterations" -} 1 +} 0 INT output_timers_every "Print detailed statistics periodically" STEERABLE=always { + -1 :: "don't report" 0 :: "don't report" 1:* :: "report every so many iterations" } 0 diff --git a/Carpet/Carpet/src/Evolve.cc b/Carpet/Carpet/src/Evolve.cc index 687b725c0..15c63999a 100644 --- a/Carpet/Carpet/src/Evolve.cc +++ b/Carpet/Carpet/src/Evolve.cc @@ -467,10 +467,7 @@ namespace Carpet { // Checking CheckChecksums (cctkGH, alltimes); - if (do_global_mode and - print_timestats_every > 0 and - cctkGH->cctk_iteration % print_timestats_every == 0) - { + if (do_global_mode) { // Timing statistics PrintTimingStats (cctkGH); } diff --git a/Carpet/Carpet/src/Timing.cc b/Carpet/Carpet/src/Timing.cc index ce1f13617..c66ec1fb2 100644 --- a/Carpet/Carpet/src/Timing.cc +++ b/Carpet/Carpet/src/Timing.cc @@ -176,42 +176,46 @@ namespace Carpet { * grid_points_per_second = * local_grid_points_per_second; - if (not silent) { + if (print_timestats_every > 0 and + cctkGH->cctk_iteration % print_timestats_every == 0) + { + CCTK_VInfo (CCTK_THORNSTRING, "This processor's grid point updates per second (local): %g", double (* local_grid_points_per_second)); CCTK_VInfo (CCTK_THORNSTRING, "Overall grid point updates per second (total) : %g", double (* total_grid_points_per_second)); - } #if 0 - CCTK_REAL const updates_per_second_2 = ipow (updates_per_second, 2); - - struct { - CCTK_REAL ups, ups2; - } local, global; - local.ups = updates_per_second; - local.ups2 = updates_per_second_2; - MPI_Allreduce (& local, & global, 2, - dist::datatype (global.ups), MPI_SUM, dist::comm()); - - int const count = dist::size(); - CCTK_REAL const avg = global.ups / count; - CCTK_REAL const stddev = sqrt (abs (global.ups2 - ipow (avg,2)) / count); - - CCTK_VInfo (CCTK_THORNSTRING, - "Local updates per second: %g", double (updates_per_second)); - CCTK_VInfo (CCTK_THORNSTRING, - "Global updates per second: %g", double (global.ups)); - - if (verbose) { + CCTK_REAL const updates_per_second_2 = ipow (updates_per_second, 2); + + struct { + CCTK_REAL ups, ups2; + } local, global; + local.ups = updates_per_second; + local.ups2 = updates_per_second_2; + MPI_Allreduce (& local, & global, 2, + dist::datatype (global.ups), MPI_SUM, dist::comm()); + + int const count = dist::size(); + CCTK_REAL const avg = global.ups / count; + CCTK_REAL const stddev = sqrt (abs (global.ups2 - ipow (avg,2)) / count); + CCTK_VInfo (CCTK_THORNSTRING, - "Average updates per second: %g", double (avg)); + "Local updates per second: %g", double (updates_per_second)); CCTK_VInfo (CCTK_THORNSTRING, - "Standard deviation: %g", double (stddev)); - } + "Global updates per second: %g", double (global.ups)); + + if (verbose) { + CCTK_VInfo (CCTK_THORNSTRING, + "Average updates per second: %g", double (avg)); + CCTK_VInfo (CCTK_THORNSTRING, + "Standard deviation: %g", double (stddev)); + } #endif + + } } @@ -233,7 +237,9 @@ namespace Carpet { * physical_time_per_hour = physical_time / elapsed_walltime * CCTK_REAL (3600.0); - if (not silent) { + if (print_timestats_every > 0 and + cctkGH->cctk_iteration % print_timestats_every == 0) + { CCTK_VInfo (CCTK_THORNSTRING, "Physical time per hour: %g", double (* physical_time_per_hour)); |