diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-01-30 22:20:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-01-30 22:20:00 +0000 |
commit | a912c1e35abf498fe89af20f4dc68e9c49cbbc8a (patch) | |
tree | 366b67e937cd5eb2f990a5736d2ed8ed38832b1e /Carpet/Carpet/src/Timing.cc | |
parent | 57a669a30d3478c54676d95f35a53068f05e6b1e (diff) |
Carpet: Update timing routines
darcs-hash:20080130222022-dae7b-66f7e0aa2f0fecb47b6b9649df52995c73741816.gz
Diffstat (limited to 'Carpet/Carpet/src/Timing.cc')
-rw-r--r-- | Carpet/Carpet/src/Timing.cc | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/Carpet/Carpet/src/Timing.cc b/Carpet/Carpet/src/Timing.cc index 49fff1177..0edd0130c 100644 --- a/Carpet/Carpet/src/Timing.cc +++ b/Carpet/Carpet/src/Timing.cc @@ -40,6 +40,11 @@ namespace Carpet { + // Small number to avoid division by zero + CCTK_REAL const eps = 1.0e-15; + + + // Return the current wall time static CCTK_REAL @@ -266,9 +271,9 @@ namespace Carpet { // Calculate updates per second * local_grid_points_per_second = - * local_grid_point_updates_count / max (* time_computing, 1.0e-15); + * local_grid_point_updates_count / max (* time_computing, eps); * total_grid_points_per_second = - * total_grid_point_updates_count / max (* time_computing, 1.0e-15); + * total_grid_point_updates_count / max (* time_computing, eps); * grid_points_per_second = * local_grid_points_per_second; } @@ -282,13 +287,13 @@ namespace Carpet { DECLARE_CCTK_ARGUMENTS; * io_per_second = - * io_count / max (* time_io, 1.0e-15); + * io_count / max (* time_io, eps); * io_bytes_per_second = - * io_bytes_count / max (* time_io, 1.0e-15); + * io_bytes_count / max (* time_io, eps); * io_bytes_ascii_per_second = - * io_bytes_ascii_count / max (* time_io, 1.0e-15); + * io_bytes_ascii_count / max (* time_io, eps); * io_bytes_binary_per_second = - * io_bytes_binary_count / max (* time_io, 1.0e-15); + * io_bytes_binary_count / max (* time_io, eps); } @@ -300,9 +305,9 @@ namespace Carpet { DECLARE_CCTK_ARGUMENTS; * comm_per_second = - * comm_count / max (* time_communicating, 1.0e-15); + * comm_count / max (* time_communicating, eps); * comm_bytes_per_second = - * comm_bytes_count / max (* time_communicating, 1.0e-15); + * comm_bytes_count / max (* time_communicating, eps); } @@ -318,7 +323,7 @@ namespace Carpet { // Calculate physical time per hour * physical_time_per_hour = - 3600.0 * physical_time / max (* time_computing, 1.0e-15); + 3600.0 * physical_time / max (* time_computing, eps); } @@ -347,11 +352,11 @@ namespace Carpet { CCTK_VInfo (CCTK_THORNSTRING, "(Comp, Comm, I/O) fractions = (%3.1f%%, %3.1f%%, %3.1f%%)", double (100.0 * * time_computing / - max (* time_total, 1.0e-15)), + max (* time_total, eps)), double (100.0 * * time_communicating / - max (* time_total, 1.0e-15)), + max (* time_total, eps)), double (100.0 * * time_io / - max (* time_total, 1.0e-15))); + max (* time_total, eps))); } |