]> https://gitweb.dealii.org/ - dealii.git/commitdiff
base/timer_03: remove test 16105/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 6 Oct 2023 15:06:43 +0000 (10:06 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 6 Oct 2023 15:06:43 +0000 (10:06 -0500)
The test is fragile under load (depending on how the process gets
scheduled, timer sections end up with different CPU and WALL counts).
Furthermore, as written the test isn't really a regression or unit test
for a deal.II functionality but rather verifies that the underlying
std::chrono framework works as intended.

Let's simply remove the test.

tests/base/timer_03.cc [deleted file]
tests/base/timer_03.output [deleted file]

diff --git a/tests/base/timer_03.cc b/tests/base/timer_03.cc
deleted file mode 100644 (file)
index 8b6d514..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 1998 - 2020 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE.md at
-// the top level directory of deal.II.
-//
-// ---------------------------------------------------------------------
-
-#include <deal.II/base/timer.h>
-
-#include <thread>
-
-#include "../tests.h"
-
-// compute the ratio of two measurements and compare to
-// the expected value.
-
-void
-compare(double t1, double t2, double ratio)
-{
-  double r = t2 / t1;
-  double d = std::fabs(r - ratio) / ratio;
-
-  // use a really coarse tolerance to account for situations in which we are
-  // running the test suite with very high load
-  if (d <= 0.5)
-    {
-      deallog << "OK" << std::endl;
-    }
-  else
-    {
-      deallog << "Ratio " << r << " should be " << ratio << std::endl;
-    }
-}
-
-void
-match(double v1, double v2)
-{
-  double eps = 1.0e-6;
-  if (std::fabs(v1 - v2) < eps)
-    {
-      deallog << "OK" << std::endl;
-    }
-  else
-    {
-      deallog << "Value " << v1 << " should be " << v2 << std::endl;
-    }
-}
-
-int
-main()
-{
-  initlog();
-
-  Timer       t1, t2;
-  TimerOutput tO(std::cout, TimerOutput::summary, TimerOutput::wall_times);
-
-  tO.enter_subsection("Section1");
-  tO.enter_subsection("Section2");
-  std::this_thread::sleep_for(std::chrono::seconds(2));
-  tO.leave_subsection("Section2");
-  tO.enter_subsection("Section2");
-  std::this_thread::sleep_for(std::chrono::seconds(2));
-  tO.leave_subsection("Section2");
-  tO.leave_subsection("Section1");
-
-  std::map<std::string, double> cpu_times =
-    tO.get_summary_data(TimerOutput::OutputData::total_cpu_time);
-  std::map<std::string, double> wall_times =
-    tO.get_summary_data(TimerOutput::OutputData::total_wall_time);
-  std::map<std::string, double> calls =
-    tO.get_summary_data(TimerOutput::OutputData::n_calls);
-
-  match(calls["Section1"], 1.0);
-  match(calls["Section2"], 2.0);
-
-  if (cpu_times["Section1"] * cpu_times["Section2"] > 0.)
-    deallog << "OK" << std::endl;
-  else
-    deallog << "ERROR - total cpu time 0" << std::endl;
-
-  if (wall_times["Section1"] * wall_times["Section2"] > 0.)
-    deallog << "OK" << std::endl;
-  else
-    deallog << "ERROR - total wall time 0" << std::endl;
-
-  compare(cpu_times["Section1"], cpu_times["Section2"], 1.);
-  compare(wall_times["Section1"], wall_times["Section2"], 1.);
-}
diff --git a/tests/base/timer_03.output b/tests/base/timer_03.output
deleted file mode 100644 (file)
index 0aa61ff..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-DEAL::OK
-DEAL::OK
-DEAL::OK
-DEAL::OK
-DEAL::OK
-DEAL::OK

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.