From 3e59c65ff85f6c8cd1dde70a3faf43fffaa30174 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 18 May 2022 09:45:15 +0200 Subject: [PATCH] Make multigrid test more robust --- .../parallel_multigrid_interleave_renumber.cc | 18 ++- ...4est=true.with_lapack=true.mpirun=2.output | 112 ++++++++++-------- ...st=true.with_lapack=true.mpirun=2.output.2 | 65 ---------- 3 files changed, 72 insertions(+), 123 deletions(-) delete mode 100644 tests/matrix_free/parallel_multigrid_interleave_renumber.with_p4est=true.with_lapack=true.mpirun=2.output.2 diff --git a/tests/matrix_free/parallel_multigrid_interleave_renumber.cc b/tests/matrix_free/parallel_multigrid_interleave_renumber.cc index 0a26bbdfe6..9084cd849e 100644 --- a/tests/matrix_free/parallel_multigrid_interleave_renumber.cc +++ b/tests/matrix_free/parallel_multigrid_interleave_renumber.cc @@ -63,9 +63,11 @@ public: ~LaplaceOperator() { + // round number of calls to make test more robust if (n_calls_vmult > 0) - deallog << "Number of calls to special vmult for Operator of size " << m() - << ": " << n_calls_vmult << std::endl; + deallog + << "Approx. number of calls to special vmult for Operator of size " + << m() << ": " << (n_calls_vmult + 5) / 10 * 10 << std::endl; } void @@ -437,8 +439,8 @@ do_test(DoFHandler &dof) ++level) { smoother_data[level].smoothing_range = 15.; - smoother_data[level].degree = 5; - smoother_data[level].eig_cg_n_iterations = 15; + smoother_data[level].degree = 4; + smoother_data[level].eig_cg_n_iterations = 10; auto preconditioner = std::make_shared< DiagonalMatrix>>(); preconditioner->reinit(mg_matrices[level].get_matrix_diagonal_inverse()); @@ -461,7 +463,11 @@ do_test(DoFHandler &dof) { // avoid output from inner (coarse-level) solver deallog.depth_file(2); - ReductionControl control(30, 1e-20, 1e-7); + + // Require a fixed number of iterations rather than a tolerance, in order + // to make output more stable + IterationNumberControl control(6, 1e-15); + SolverCG> solver(control); solver.solve(fine_matrix, sol, in, preconditioner); } @@ -473,7 +479,7 @@ template void test(const unsigned int fe_degree) { - for (unsigned int i = 5; i < 7; ++i) + for (unsigned int i = 6; i < 8; ++i) { parallel::distributed::Triangulation tria( MPI_COMM_WORLD, diff --git a/tests/matrix_free/parallel_multigrid_interleave_renumber.with_p4est=true.with_lapack=true.mpirun=2.output b/tests/matrix_free/parallel_multigrid_interleave_renumber.with_p4est=true.with_lapack=true.mpirun=2.output index d51f7fbac3..892a6e9106 100644 --- a/tests/matrix_free/parallel_multigrid_interleave_renumber.with_p4est=true.with_lapack=true.mpirun=2.output +++ b/tests/matrix_free/parallel_multigrid_interleave_renumber.with_p4est=true.with_lapack=true.mpirun=2.output @@ -1,65 +1,73 @@ -DEAL::Testing FE_Q<2>(1) -DEAL::Number of degrees of freedom: 81 -DEAL:cg::Starting value 7.00000 -DEAL:cg::Convergence step 3 value 2.50859e-07 -DEAL::Number of calls to special vmult for Operator of size 4: 13 -DEAL::Number of calls to special vmult for Operator of size 9: 29 -DEAL::Number of calls to special vmult for Operator of size 25: 33 -DEAL::Number of calls to special vmult for Operator of size 81: 42 DEAL::Testing FE_Q<2>(1) DEAL::Number of degrees of freedom: 289 DEAL:cg::Starting value 15.0000 -DEAL:cg::Convergence step 4 value 2.05438e-08 -DEAL::Number of calls to special vmult for Operator of size 4: 17 -DEAL::Number of calls to special vmult for Operator of size 9: 38 -DEAL::Number of calls to special vmult for Operator of size 25: 42 -DEAL::Number of calls to special vmult for Operator of size 81: 51 -DEAL::Number of calls to special vmult for Operator of size 289: 51 -DEAL::Testing FE_Q<2>(3) -DEAL::Number of degrees of freedom: 625 -DEAL:cg::Starting value 23.0000 -DEAL:cg::Convergence step 4 value 2.11999e-07 -DEAL::Number of calls to special vmult for Operator of size 16: 19 -DEAL::Number of calls to special vmult for Operator of size 49: 48 -DEAL::Number of calls to special vmult for Operator of size 169: 51 -DEAL::Number of calls to special vmult for Operator of size 625: 51 +DEAL:cg::Convergence step 6 value 5.63311e-11 +DEAL::Approx. number of calls to special vmult for Operator of size 4: 20 +DEAL::Approx. number of calls to special vmult for Operator of size 9: 40 +DEAL::Approx. number of calls to special vmult for Operator of size 25: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 81: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 289: 50 +DEAL::Testing FE_Q<2>(1) +DEAL::Number of degrees of freedom: 1089 +DEAL:cg::Starting value 31.0000 +DEAL:cg::Convergence step 6 value 6.08657e-10 +DEAL::Approx. number of calls to special vmult for Operator of size 4: 20 +DEAL::Approx. number of calls to special vmult for Operator of size 9: 40 +DEAL::Approx. number of calls to special vmult for Operator of size 25: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 81: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 289: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 1089: 50 DEAL::Testing FE_Q<2>(3) DEAL::Number of degrees of freedom: 2401 DEAL:cg::Starting value 47.0000 -DEAL:cg::Convergence step 4 value 4.14038e-07 -DEAL::Number of calls to special vmult for Operator of size 16: 19 -DEAL::Number of calls to special vmult for Operator of size 49: 48 -DEAL::Number of calls to special vmult for Operator of size 169: 51 -DEAL::Number of calls to special vmult for Operator of size 625: 51 -DEAL::Number of calls to special vmult for Operator of size 2401: 51 -DEAL::Testing FE_Q<3>(1) -DEAL::Number of degrees of freedom: 125 -DEAL:cg::Starting value 5.19615 -DEAL:cg::Convergence step 3 value 4.30693e-08 -DEAL::Number of calls to special vmult for Operator of size 8: 13 -DEAL::Number of calls to special vmult for Operator of size 27: 28 -DEAL::Number of calls to special vmult for Operator of size 125: 34 +DEAL:cg::Convergence step 6 value 1.96747e-09 +DEAL::Approx. number of calls to special vmult for Operator of size 16: 20 +DEAL::Approx. number of calls to special vmult for Operator of size 49: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 169: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 625: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 2401: 50 +DEAL::Testing FE_Q<2>(3) +DEAL::Number of degrees of freedom: 9409 +DEAL:cg::Starting value 95.0000 +DEAL:cg::Convergence step 6 value 6.94687e-09 +DEAL::Approx. number of calls to special vmult for Operator of size 16: 20 +DEAL::Approx. number of calls to special vmult for Operator of size 49: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 169: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 625: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 2401: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 9409: 50 DEAL::Testing FE_Q<3>(1) DEAL::Number of degrees of freedom: 729 DEAL:cg::Starting value 18.5203 -DEAL:cg::Convergence step 3 value 3.62205e-07 -DEAL::Number of calls to special vmult for Operator of size 8: 13 -DEAL::Number of calls to special vmult for Operator of size 27: 28 -DEAL::Number of calls to special vmult for Operator of size 125: 34 -DEAL::Number of calls to special vmult for Operator of size 729: 42 -DEAL::Testing FE_Q<3>(2) -DEAL::Number of degrees of freedom: 729 -DEAL:cg::Starting value 18.5203 -DEAL:cg::Convergence step 4 value 1.13788e-08 -DEAL::Number of calls to special vmult for Operator of size 27: 17 -DEAL::Number of calls to special vmult for Operator of size 125: 43 -DEAL::Number of calls to special vmult for Operator of size 729: 51 +DEAL:cg::Convergence step 6 value 2.77603e-11 +DEAL::Approx. number of calls to special vmult for Operator of size 8: 20 +DEAL::Approx. number of calls to special vmult for Operator of size 27: 40 +DEAL::Approx. number of calls to special vmult for Operator of size 125: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 729: 50 +DEAL::Testing FE_Q<3>(1) +DEAL::Number of degrees of freedom: 4913 +DEAL:cg::Starting value 58.0948 +DEAL:cg::Convergence step 6 value 3.05980e-10 +DEAL::Approx. number of calls to special vmult for Operator of size 8: 20 +DEAL::Approx. number of calls to special vmult for Operator of size 27: 40 +DEAL::Approx. number of calls to special vmult for Operator of size 125: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 729: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 4913: 50 DEAL::Testing FE_Q<3>(2) DEAL::Number of degrees of freedom: 4913 DEAL:cg::Starting value 58.0948 -DEAL:cg::Convergence step 4 value 9.17189e-08 -DEAL::Number of calls to special vmult for Operator of size 27: 17 -DEAL::Number of calls to special vmult for Operator of size 125: 43 -DEAL::Number of calls to special vmult for Operator of size 729: 51 -DEAL::Number of calls to special vmult for Operator of size 4913: 51 +DEAL:cg::Convergence step 6 value 1.26931e-09 +DEAL::Approx. number of calls to special vmult for Operator of size 27: 20 +DEAL::Approx. number of calls to special vmult for Operator of size 125: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 729: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 4913: 50 +DEAL::Testing FE_Q<3>(2) +DEAL::Number of degrees of freedom: 35937 +DEAL:cg::Starting value 172.601 +DEAL:cg::Convergence step 6 value 4.73674e-09 +DEAL::Approx. number of calls to special vmult for Operator of size 27: 20 +DEAL::Approx. number of calls to special vmult for Operator of size 125: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 729: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 4913: 50 +DEAL::Approx. number of calls to special vmult for Operator of size 35937: 50 diff --git a/tests/matrix_free/parallel_multigrid_interleave_renumber.with_p4est=true.with_lapack=true.mpirun=2.output.2 b/tests/matrix_free/parallel_multigrid_interleave_renumber.with_p4est=true.with_lapack=true.mpirun=2.output.2 deleted file mode 100644 index 0aae474fa4..0000000000 --- a/tests/matrix_free/parallel_multigrid_interleave_renumber.with_p4est=true.with_lapack=true.mpirun=2.output.2 +++ /dev/null @@ -1,65 +0,0 @@ - -DEAL::Testing FE_Q<2>(1) -DEAL::Number of degrees of freedom: 81 -DEAL:cg::Starting value 7.00000 -DEAL:cg::Convergence step 3 value 1.45467e-07 -DEAL::Number of calls to special vmult for Operator of size 4: 13 -DEAL::Number of calls to special vmult for Operator of size 9: 29 -DEAL::Number of calls to special vmult for Operator of size 25: 33 -DEAL::Number of calls to special vmult for Operator of size 81: 42 -DEAL::Testing FE_Q<2>(1) -DEAL::Number of degrees of freedom: 289 -DEAL:cg::Starting value 15.0000 -DEAL:cg::Convergence step 4 value 1.05853e-08 -DEAL::Number of calls to special vmult for Operator of size 4: 17 -DEAL::Number of calls to special vmult for Operator of size 9: 38 -DEAL::Number of calls to special vmult for Operator of size 25: 42 -DEAL::Number of calls to special vmult for Operator of size 81: 51 -DEAL::Number of calls to special vmult for Operator of size 289: 51 -DEAL::Testing FE_Q<2>(3) -DEAL::Number of degrees of freedom: 625 -DEAL:cg::Starting value 23.0000 -DEAL:cg::Convergence step 4 value 6.97010e-08 -DEAL::Number of calls to special vmult for Operator of size 16: 19 -DEAL::Number of calls to special vmult for Operator of size 49: 48 -DEAL::Number of calls to special vmult for Operator of size 169: 51 -DEAL::Number of calls to special vmult for Operator of size 625: 51 -DEAL::Testing FE_Q<2>(3) -DEAL::Number of degrees of freedom: 2401 -DEAL:cg::Starting value 47.0000 -DEAL:cg::Convergence step 4 value 2.52497e-07 -DEAL::Number of calls to special vmult for Operator of size 16: 19 -DEAL::Number of calls to special vmult for Operator of size 49: 48 -DEAL::Number of calls to special vmult for Operator of size 169: 51 -DEAL::Number of calls to special vmult for Operator of size 625: 51 -DEAL::Number of calls to special vmult for Operator of size 2401: 51 -DEAL::Testing FE_Q<3>(1) -DEAL::Number of degrees of freedom: 125 -DEAL:cg::Starting value 5.19615 -DEAL:cg::Convergence step 3 value 5.18177e-09 -DEAL::Number of calls to special vmult for Operator of size 8: 13 -DEAL::Number of calls to special vmult for Operator of size 27: 28 -DEAL::Number of calls to special vmult for Operator of size 125: 34 -DEAL::Testing FE_Q<3>(1) -DEAL::Number of degrees of freedom: 729 -DEAL:cg::Starting value 18.5203 -DEAL:cg::Convergence step 3 value 9.84548e-07 -DEAL::Number of calls to special vmult for Operator of size 8: 13 -DEAL::Number of calls to special vmult for Operator of size 27: 28 -DEAL::Number of calls to special vmult for Operator of size 125: 34 -DEAL::Number of calls to special vmult for Operator of size 729: 42 -DEAL::Testing FE_Q<3>(2) -DEAL::Number of degrees of freedom: 729 -DEAL:cg::Starting value 18.5203 -DEAL:cg::Convergence step 4 value 5.63253e-09 -DEAL::Number of calls to special vmult for Operator of size 27: 18 -DEAL::Number of calls to special vmult for Operator of size 125: 43 -DEAL::Number of calls to special vmult for Operator of size 729: 51 -DEAL::Testing FE_Q<3>(2) -DEAL::Number of degrees of freedom: 4913 -DEAL:cg::Starting value 58.0948 -DEAL:cg::Convergence step 4 value 3.48121e-08 -DEAL::Number of calls to special vmult for Operator of size 27: 18 -DEAL::Number of calls to special vmult for Operator of size 125: 43 -DEAL::Number of calls to special vmult for Operator of size 729: 51 -DEAL::Number of calls to special vmult for Operator of size 4913: 51 -- 2.39.5