From 2ee451455b112e497dce2c1bc07cf4ec10a10cec Mon Sep 17 00:00:00 2001 From: Stefano Zampini Date: Wed, 19 Jul 2023 19:53:21 +0200 Subject: [PATCH] tweak PETSc tests --- tests/petsc/assemble_matrix_parallel_01.cc | 28 +++++++++++++------ ...ith_petsc_with_mumps=true.mpirun=2.output} | 0 2 files changed, 19 insertions(+), 9 deletions(-) rename tests/petsc/{step-77-snes.with_p4est=true.mpirun=2.output => step-77-snes.with_p4est=true.with_petsc_with_mumps=true.mpirun=2.output} (100%) diff --git a/tests/petsc/assemble_matrix_parallel_01.cc b/tests/petsc/assemble_matrix_parallel_01.cc index 8ac2b5fbff..714d4f67e7 100644 --- a/tests/petsc/assemble_matrix_parallel_01.cc +++ b/tests/petsc/assemble_matrix_parallel_01.cc @@ -18,11 +18,6 @@ // same as deal.II/assemble_matrix_parallel_01, but for PETSc matrices // and vectors // -// This test requires PETSc to be configured with the option -// "--with-threadsafety" in case of debug builds of PETSc -// For optimized builds, the above option is needed only in case -// users want PETSc to produce useful logs with "-log_view" runtime -// option #include #include #include @@ -53,6 +48,8 @@ #include #include +#include + #include #include @@ -384,6 +381,12 @@ template void LaplaceProblem::assemble_test() { + // This test requires PETSc to be configured with the option + // "--with-threadsafety" in case of debug builds of PETSc. + // For optimized builds, the above option is needed only in case + // users want PETSc to produce useful logs with "-log_view" runtime + // option +#if !defined(PETSC_USE_DEBUG) || defined(PETSC_HAVE_THREADSAFETY) test_matrix = 0; test_rhs = 0; @@ -405,11 +408,18 @@ LaplaceProblem::assemble_test() test_rhs.compress(VectorOperation::add); test_matrix.add(-1, reference_matrix); - - // there should not even be roundoff difference between matrices - deallog << "error in matrix: " << test_matrix.frobenius_norm() << std::endl; test_rhs.add(-1., reference_rhs); - deallog << "error in vector: " << test_rhs.l2_norm() << std::endl; + + auto mnorm = test_matrix.frobenius_norm(); + auto vnorm = test_rhs.l2_norm(); +#else + auto mnorm = 0.0; + auto vnorm = 0.0; +#endif + + // there should not even be roundoff difference + deallog << "error in matrix: " << mnorm << std::endl; + deallog << "error in vector: " << vnorm << std::endl; } diff --git a/tests/petsc/step-77-snes.with_p4est=true.mpirun=2.output b/tests/petsc/step-77-snes.with_p4est=true.with_petsc_with_mumps=true.mpirun=2.output similarity index 100% rename from tests/petsc/step-77-snes.with_p4est=true.mpirun=2.output rename to tests/petsc/step-77-snes.with_p4est=true.with_petsc_with_mumps=true.mpirun=2.output -- 2.39.5