Enables traps/exceptions on common floating point errors. This option may not work on certain machines.
PetscErrorCode PetscSetFPTrap(PetscFPTrap flag)
flag -PETSC_FP_TRAP_ON, PETSC_FP_TRAP_OFF.
Options Database Keys
-fp_trap -Activates floating point trapping
On systems that support it, this routine causes floating point
overflow, divide-by-zero, and invalid-operand (e.g., a NaN) to
cause a message to be printed and the program to exit.
On many common systems including x86 and x86-64 Linux, the floating
point exception state is not preserved from the location where the trap
occurred through to the signal handler. In this case, the signal handler
will just say that an unknown floating point exception occurred and which
function it occurred in. If you run with -fp_trap in a debugger, it will
break on the line where the error occurred. You can check which
exception occurred using fetestexcept(FE_ALL_EXCEPT). See fenv.h
(usually at /usr/include/bits/fenv.h) for the enum values on your system.
On certain machines, in particular the IBM rs6000, floating point
trapping is VERY slow!
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages