From: David Wells Date: Thu, 14 Sep 2017 18:22:22 +0000 (-0400) Subject: Use last lap times for TimerOutput accumulation. X-Git-Tag: v9.0.0-rc1~1073^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e4b9e37f7f2ab1da8c8d7528ec4d81b292f538;p=dealii.git Use last lap times for TimerOutput accumulation. The methods Timer::wall_time() and Timer::cpu_time() (i.e., Timer::operator()()) return cumulative times instead of times over the last lap. --- diff --git a/source/base/timer.cc b/source/base/timer.cc index fe1a58ac94..39a685e41c 100644 --- a/source/base/timer.cc +++ b/source/base/timer.cc @@ -431,13 +431,13 @@ TimerOutput::leave_subsection (const std::string §ion_name) sections[actual_section_name].timer.stop(); sections[actual_section_name].total_wall_time - += sections[actual_section_name].timer.wall_time(); + += sections[actual_section_name].timer.last_wall_time(); // Get cpu time. On MPI systems, if constructed with an mpi_communicator // like MPI_COMM_WORLD, then the Timer will sum up the CPU time between // processors among the provided mpi_communicator. Therefore, no // communication is needed here. - const double cpu_time = sections[actual_section_name].timer(); + const double cpu_time = sections[actual_section_name].timer.last_cpu_time(); sections[actual_section_name].total_cpu_time += cpu_time; // in case we have to print out something, do that here... @@ -448,7 +448,7 @@ TimerOutput::leave_subsection (const std::string §ion_name) std::ostringstream cpu; cpu << cpu_time << "s"; std::ostringstream wall; - wall << sections[actual_section_name].timer.wall_time() << "s"; + wall << sections[actual_section_name].timer.last_wall_time() << "s"; if (output_type == cpu_times) output_time = ", CPU time: " + cpu.str(); else if (output_type == wall_times)