From: Stefano Zampini Date: Wed, 19 Jul 2023 17:53:21 +0000 (+0200) Subject: tweak PETSc tests X-Git-Tag: relicensing~662^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15767%2Fhead;p=dealii.git tweak PETSc tests --- 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