From 840fc2a52cb60e90b46ec1a40c1a4f69bf7cc052 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 27 Mar 2020 10:24:28 -0400 Subject: [PATCH] Remove deprecated Timer member functions --- .../incompatibilities/20200327DanielArndt | 9 ++ include/deal.II/base/timer.h | 100 ------------------ source/base/timer.cc | 20 +--- tests/base/timer.cc | 12 +-- tests/base/timer_05.cc | 6 -- 5 files changed, 17 insertions(+), 130 deletions(-) create mode 100644 doc/news/changes/incompatibilities/20200327DanielArndt diff --git a/doc/news/changes/incompatibilities/20200327DanielArndt b/doc/news/changes/incompatibilities/20200327DanielArndt new file mode 100644 index 0000000000..ffc56a91a9 --- /dev/null +++ b/doc/news/changes/incompatibilities/20200327DanielArndt @@ -0,0 +1,9 @@ +Removed: The deprecated member functions Timer::get_data(), +Timer::get_total_data(), Timer::print_data(), Timer::print_total_data() and +Timer::operator(), Timer::get_lap_time() have been removed. Use +Timer::get_last_lap_wall_time_data(), Timer::get_accumulated_wall_time_data(), +Timer::print_last_lap_wall_time_data(), +Timer::print_accumulated_wall_time_data() and +Timer::cpu_time() and Timer::last_wall_time() instead. +
+(Daniel Arndt, 2020/03/27) diff --git a/include/deal.II/base/timer.h b/include/deal.II/base/timer.h index c5a53a4a27..e8fe4585b2 100644 --- a/include/deal.II/base/timer.h +++ b/include/deal.II/base/timer.h @@ -140,18 +140,6 @@ public: */ Timer(MPI_Comm mpi_communicator, const bool sync_lap_times = false); - /** - * Return a reference to the data structure with global timing information - * for the last lap. This structure does not contain meaningful values until - * Timer::stop() has been called. - * - * @deprecated Use Timer::get_last_lap_wall_time_data() instead, which - * returns a reference to the same structure. - */ - DEAL_II_DEPRECATED - const Utilities::MPI::MinMaxAvg & - get_data() const; - /** * Return a reference to the data structure containing basic statistics on * the last lap's wall time measured across all MPI processes in the given @@ -161,19 +149,6 @@ public: const Utilities::MPI::MinMaxAvg & get_last_lap_wall_time_data() const; - /** - * Return a reference to the data structure containing basic statistics on - * the accumulated wall time measured across all MPI processes in the given - * communicator. This structure does not contain meaningful values until - * Timer::stop() has been called. - * - * @deprecated Use Timer::get_accumulated_wall_time_data() instead, which - * returns a reference the same structure. - */ - DEAL_II_DEPRECATED - const Utilities::MPI::MinMaxAvg & - get_total_data() const; - /** * Return a reference to the data structure containing basic statistics on * the accumulated wall time measured across all MPI processes in the given @@ -183,17 +158,6 @@ public: const Utilities::MPI::MinMaxAvg & get_accumulated_wall_time_data() const; - /** - * Prints the data returned by get_data(), i.e. for the last lap, - * to the given stream. - * - * @deprecated Use Timer::print_last_lap_wall_time_data() instead, which - * prints the same information. - */ - template - DEAL_II_DEPRECATED void - print_data(StreamType &stream) const; - /** * Print the data returned by Timer::get_last_lap_wall_time_data() to the * given stream. @@ -202,17 +166,6 @@ public: void print_last_lap_wall_time_data(StreamType &stream) const; - /** - * Prints the data returned by get_total_data(), i.e. for the total run, - * to the given stream. - * - * @deprecated Use Timer::print_accumulated_wall_time_data() instead, which - * prints the same information. - */ - template - DEAL_II_DEPRECATED void - print_total_data(StreamType &stream) const; - /** * Print the data returned by Timer::get_accumulated_wall_time_data() to the * given stream. @@ -253,16 +206,6 @@ public: void restart(); - /** - * Access to the current CPU time without stopping the timer. The elapsed - * time is returned in units of seconds. - * - * @deprecated Use cpu_time() instead. - */ - DEAL_II_DEPRECATED - double - operator()() const; - /** * Return the current accumulated wall time (including the current lap, if * the timer is running) in seconds without stopping the timer. @@ -295,15 +238,6 @@ public: double last_cpu_time() const; - /** - * Return the wall time taken between the last start()/stop() call. - * - * @deprecated Use last_wall_time() instead. - */ - DEAL_II_DEPRECATED - double - get_lap_time() const; - private: /** * The Timer class stores timing information for two different clocks: a @@ -981,14 +915,6 @@ Timer::restart() -inline const Utilities::MPI::MinMaxAvg & -Timer::get_data() const -{ - return last_lap_wall_time_data; -} - - - inline const Utilities::MPI::MinMaxAvg & Timer::get_last_lap_wall_time_data() const { @@ -997,14 +923,6 @@ Timer::get_last_lap_wall_time_data() const -inline const Utilities::MPI::MinMaxAvg & -Timer::get_total_data() const -{ - return accumulated_wall_time_data; -} - - - inline const Utilities::MPI::MinMaxAvg & Timer::get_accumulated_wall_time_data() const { @@ -1013,15 +931,6 @@ Timer::get_accumulated_wall_time_data() const -template -inline void -Timer::print_data(StreamType &stream) const -{ - print_last_lap_wall_time_data(stream); -} - - - template inline void Timer::print_last_lap_wall_time_data(StreamType &stream) const @@ -1034,15 +943,6 @@ Timer::print_last_lap_wall_time_data(StreamType &stream) const -template -inline void -Timer::print_total_data(StreamType &stream) const -{ - print_accumulated_wall_time_data(stream); -} - - - template inline void Timer::print_accumulated_wall_time_data(StreamType &stream) const diff --git a/source/base/timer.cc b/source/base/timer.cc index b5d9264228..1e9087eae0 100644 --- a/source/base/timer.cc +++ b/source/base/timer.cc @@ -260,22 +260,6 @@ Timer::last_cpu_time() const -double -Timer::get_lap_time() const -{ - return internal::TimerImplementation::to_seconds(wall_times.last_lap_time); -} - - - -double -Timer::operator()() const -{ - return cpu_time(); -} - - - double Timer::wall_time() const { @@ -571,7 +555,7 @@ TimerOutput::print_summary() const if (output_type != wall_times) { double total_cpu_time = - Utilities::MPI::sum(timer_all(), mpi_communicator); + Utilities::MPI::sum(timer_all.cpu_time(), mpi_communicator); // check that the sum of all times is less or equal than the total // time. otherwise, we might have generated a lot of overhead in this @@ -732,7 +716,7 @@ TimerOutput::print_summary() const { const double total_wall_time = timer_all.wall_time(); double total_cpu_time = - Utilities::MPI::sum(timer_all(), mpi_communicator); + Utilities::MPI::sum(timer_all.cpu_time(), mpi_communicator); // check that the sum of all times is less or equal than the total time. // otherwise, we might have generated a lot of overhead in this function. diff --git a/tests/base/timer.cc b/tests/base/timer.cc index 524b5c4543..3195707b23 100644 --- a/tests/base/timer.cc +++ b/tests/base/timer.cc @@ -43,7 +43,7 @@ main() Timer t; burn(50); - double s1 = t(); + double s1 = t.cpu_time(); if (s1 > 0.) deallog << "OK" << std::endl; @@ -52,7 +52,7 @@ main() burn(50); t.stop(); - double s2 = t(); + double s2 = t.cpu_time(); if (s2 > s1) deallog << "OK" << std::endl; @@ -60,7 +60,7 @@ main() deallog << "ERROR - s2 should be greater than s1" << std::endl; burn(50); - double s3 = t(); + double s3 = t.cpu_time(); if (s3 == s2) deallog << "OK" << std::endl; @@ -69,7 +69,7 @@ main() t.start(); burn(50); - double s4 = t(); + double s4 = t.cpu_time(); if (s4 > s3) deallog << "OK" << std::endl; @@ -79,7 +79,7 @@ main() t.stop(); t.reset(); burn(50); - double s5 = t(); + double s5 = t.cpu_time(); if (s5 == 0.) deallog << "OK" << std::endl; @@ -90,7 +90,7 @@ main() burn(50); t.reset(); burn(50); - double s6 = t(); + double s6 = t.cpu_time(); if (s6 == 0.) deallog << "OK" << std::endl; diff --git a/tests/base/timer_05.cc b/tests/base/timer_05.cc index 4110da4001..39aff373d3 100644 --- a/tests/base/timer_05.cc +++ b/tests/base/timer_05.cc @@ -76,15 +76,11 @@ test_timer(Timer &t) AssertThrow(old_wall_time > 0., ExcInternalError()); const double old_cpu_time = t.cpu_time(); AssertThrow(old_cpu_time > 0., ExcInternalError()); - assert_min_max_avg_invalid(t.get_data()); - assert_min_max_avg_invalid(t.get_total_data()); assert_min_max_avg_invalid(t.get_last_lap_wall_time_data()); assert_min_max_avg_invalid(t.get_accumulated_wall_time_data()); burn(50); AssertThrow(t.stop() > 0., ExcInternalError()); - assert_min_max_avg_valid(t.get_data()); - assert_min_max_avg_valid(t.get_total_data()); assert_min_max_avg_valid(t.get_last_lap_wall_time_data()); assert_min_max_avg_valid(t.get_accumulated_wall_time_data()); @@ -96,8 +92,6 @@ test_timer(Timer &t) t.reset(); AssertThrow(t.wall_time() == 0., ExcInternalError()); AssertThrow(t.cpu_time() == 0., ExcInternalError()); - assert_min_max_avg_invalid(t.get_data()); - assert_min_max_avg_invalid(t.get_total_data()); assert_min_max_avg_invalid(t.get_last_lap_wall_time_data()); assert_min_max_avg_invalid(t.get_accumulated_wall_time_data()); -- 2.39.5