From d2abb3d301d998b3e7aa497fc806b75c8de6a1d1 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 18 May 2022 09:56:04 +0200 Subject: [PATCH] Also apply robust setup to other test --- .../parallel_multigrid_interleave.cc | 18 ++- ...4est=true.with_lapack=true.mpirun=2.output | 112 ++++++++++-------- 2 files changed, 72 insertions(+), 58 deletions(-) diff --git a/tests/matrix_free/parallel_multigrid_interleave.cc b/tests/matrix_free/parallel_multigrid_interleave.cc index afebfe7e32..c189eff703 100644 --- a/tests/matrix_free/parallel_multigrid_interleave.cc +++ b/tests/matrix_free/parallel_multigrid_interleave.cc @@ -62,9 +62,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 @@ -396,8 +398,8 @@ do_test(const 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()); @@ -420,7 +422,11 @@ do_test(const 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); } @@ -432,7 +438,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.with_p4est=true.with_lapack=true.mpirun=2.output b/tests/matrix_free/parallel_multigrid_interleave.with_p4est=true.with_lapack=true.mpirun=2.output index ba30099891..a39a083dc3 100644 --- a/tests/matrix_free/parallel_multigrid_interleave.with_p4est=true.with_lapack=true.mpirun=2.output +++ b/tests/matrix_free/parallel_multigrid_interleave.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 1.44113e-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: 28 -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 3 value 1.49408e-06 -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: 28 -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::Number of calls to special vmult for Operator of size 289: 42 -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.60805e-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:cg::Convergence step 6 value 7.67890e-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 2.23750e-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 2.29801e-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.16655e-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:cg::Convergence step 6 value 3.65064e-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 8.12469e-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 1.00122e-06 -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.65178e-09 -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 1.94706e-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 2.47598e-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 6.26463e-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.18226e-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.79606e-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 -- 2.39.5