]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Disable FPE trapping in some tests with older versions of PETSc 15474/head
authorStefano Zampini <stefano.zampini@gmail.com>
Sun, 25 Jun 2023 00:14:15 +0000 (03:14 +0300)
committerStefano Zampini <stefano.zampini@gmail.com>
Sun, 25 Jun 2023 00:14:15 +0000 (03:14 +0300)
tests/petsc/petsc_snes_06.cc
tests/petsc/petsc_snes_07.cc
tests/petsc/petsc_ts_04.cc
tests/petsc/petsc_ts_05.cc

index 5c8661a1115c38f853dde05b5bd876d82e121495..12320877b9fc1660b77ade98c68ac97f4787cc12 100644 (file)
@@ -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)
index 64d9328b42aa4803e2ace0a7d17d2fccf3baa892..22f72e49060a3552cc0e41cf33e6bce2de32379d 100644 (file)
@@ -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
     {
index e27545bb110b5acc4a0642c954f781594b986d00..8db0853c159841c07d1d3bc512ff25b7d2c44b4c 100644 (file)
@@ -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;
index 2b8e98de1809694e4951b27bf746d7bd2d6ca10f..aebefeb21cb54efcccc52b3e5a085c4bce43a822 100644 (file)
@@ -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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.