From f05a1e81b8b740d299ae76b360f5e5630750d04b Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 19 May 2022 22:37:50 +0200 Subject: [PATCH] Improve robustness of two tests --- tests/matrix_free/parallel_multigrid_interleave.cc | 11 ++++++++++- .../parallel_multigrid_interleave_renumber.cc | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/matrix_free/parallel_multigrid_interleave.cc b/tests/matrix_free/parallel_multigrid_interleave.cc index c189eff703..dc2e5b651a 100644 --- a/tests/matrix_free/parallel_multigrid_interleave.cc +++ b/tests/matrix_free/parallel_multigrid_interleave.cc @@ -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 &dof) SolverCG> 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(); } diff --git a/tests/matrix_free/parallel_multigrid_interleave_renumber.cc b/tests/matrix_free/parallel_multigrid_interleave_renumber.cc index 9084cd849e..9e5c95d9c2 100644 --- a/tests/matrix_free/parallel_multigrid_interleave_renumber.cc +++ b/tests/matrix_free/parallel_multigrid_interleave_renumber.cc @@ -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 &dof) SolverCG> 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(); } -- 2.39.5