]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve robustness of two tests
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Thu, 19 May 2022 20:37:50 +0000 (22:37 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Thu, 19 May 2022 20:37:50 +0000 (22:37 +0200)
tests/matrix_free/parallel_multigrid_interleave.cc
tests/matrix_free/parallel_multigrid_interleave_renumber.cc

index c189eff703df075e6c3444c44c3ccf48bef06b31..dc2e5b651a1a568abdec8eaae69427a91f1130dc 100644 (file)
@@ -60,7 +60,8 @@ public:
     : n_calls_vmult(0)
   {}
 
-  ~LaplaceOperator()
+  void
+  print_n_calls_special()
   {
     // round number of calls to make test more robust
     if (n_calls_vmult > 0)
@@ -430,6 +431,14 @@ do_test(const DoFHandler<dim> &dof)
     SolverCG<LinearAlgebra::distributed::Vector<double>> solver(control);
     solver.solve(fine_matrix, sol, in, preconditioner);
   }
+
+  // Print statistics
+  for (unsigned int level = 0;
+       level < dof.get_triangulation().n_global_levels();
+       ++level)
+    mg_matrices[level].print_n_calls_special();
+
+  fine_matrix.print_n_calls_special();
 }
 
 
index 9084cd849e117fd3296e1f913fefbbc485574cd8..9e5c95d9c2a08aa0968aafd42a95a50da61911d6 100644 (file)
@@ -61,7 +61,8 @@ public:
     : n_calls_vmult(0)
   {}
 
-  ~LaplaceOperator()
+  void
+  print_n_calls_special()
   {
     // round number of calls to make test more robust
     if (n_calls_vmult > 0)
@@ -471,6 +472,14 @@ do_test(DoFHandler<dim> &dof)
     SolverCG<LinearAlgebra::distributed::Vector<double>> solver(control);
     solver.solve(fine_matrix, sol, in, preconditioner);
   }
+
+  // Print statistics
+  for (unsigned int level = 0;
+       level < dof.get_triangulation().n_global_levels();
+       ++level)
+    mg_matrices[level].print_n_calls_special();
+
+  fine_matrix.print_n_calls_special();
 }
 
 

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.