From: Stefano Zampini Date: Sun, 25 Jun 2023 00:14:15 +0000 (+0300) Subject: Disable FPE trapping in some tests with older versions of PETSc X-Git-Tag: v9.5.0-rc1~21^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15474%2Fhead;p=dealii.git Disable FPE trapping in some tests with older versions of PETSc --- diff --git a/tests/petsc/petsc_snes_06.cc b/tests/petsc/petsc_snes_06.cc index 5c8661a111..12320877b9 100644 --- a/tests/petsc/petsc_snes_06.cc +++ b/tests/petsc/petsc_snes_06.cc @@ -66,6 +66,14 @@ main(int argc, char **argv) last_residual_eval = X(0); }; + // This test triggers false positives in FPE trapping for some versions of + // PETSc +#if DEAL_II_PETSC_VERSION_LT(3, 19, 2) && defined(DEBUG) && \ + defined(DEAL_II_HAVE_FP_EXCEPTIONS) + PetscErrorCode ierr = PetscFPTrapPush(PETSC_FP_TRAP_OFF); + (void)ierr; +#endif + for (int setjac = 0; setjac < 2; setjac++) { if (setjac) diff --git a/tests/petsc/petsc_snes_07.cc b/tests/petsc/petsc_snes_07.cc index 64d9328b42..22f72e4906 100644 --- a/tests/petsc/petsc_snes_07.cc +++ b/tests/petsc/petsc_snes_07.cc @@ -153,6 +153,14 @@ run_test(int testcase, bool recoverable) x(0) = starting_x; x.compress(VectorOperation::insert); + // This test triggers false positives in FPE trapping for some versions of + // PETSc +#if DEAL_II_PETSC_VERSION_LT(3, 19, 2) && defined(DEBUG) && \ + defined(DEAL_II_HAVE_FP_EXCEPTIONS) + PetscErrorCode ierr = PetscFPTrapPush(PETSC_FP_TRAP_OFF); + (void)ierr; +#endif + deallog << "Running testcase " << testcase << std::endl; try { diff --git a/tests/petsc/petsc_ts_04.cc b/tests/petsc/petsc_ts_04.cc index e27545bb11..8db0853c15 100644 --- a/tests/petsc/petsc_ts_04.cc +++ b/tests/petsc/petsc_ts_04.cc @@ -231,6 +231,14 @@ main(int argc, char **argv) deallog << "# Testing Parameters" << std::endl; prm.print_parameters(deallog.get_file_stream(), ParameterHandler::ShortText); + // This test triggers false positives in FPE trapping for some versions of + // PETSc +#if DEAL_II_PETSC_VERSION_LT(3, 19, 2) && defined(DEBUG) && \ + defined(DEAL_II_HAVE_FP_EXCEPTIONS) + PetscErrorCode ierr = PetscFPTrapPush(PETSC_FP_TRAP_OFF); + (void)ierr; +#endif + for (int recerri = 0; recerri < 2; recerri++) { bool recerr = recerri ? false : true; diff --git a/tests/petsc/petsc_ts_05.cc b/tests/petsc/petsc_ts_05.cc index 2b8e98de18..aebefeb21c 100644 --- a/tests/petsc/petsc_ts_05.cc +++ b/tests/petsc/petsc_ts_05.cc @@ -220,6 +220,14 @@ main(int argc, char **argv) deallog << "# Testing Parameters" << std::endl; prm.print_parameters(deallog.get_file_stream(), ParameterHandler::ShortText); + // This test triggers false positives in FPE trapping for some versions of + // PETSc +#if DEAL_II_PETSC_VERSION_LT(3, 19, 2) && defined(DEBUG) && \ + defined(DEAL_II_HAVE_FP_EXCEPTIONS) + PetscErrorCode ierr = PetscFPTrapPush(PETSC_FP_TRAP_OFF); + (void)ierr; +#endif + for (int seterri = 0; seterri < 2; seterri++) { bool seterr = seterri ? true : false;