PetscSetFPTrap

Enables traps/exceptions on common floating point errors. This option may not work on certain machines.

Synopsis

int PetscSetFPTrap(int flag)
Not Collective

Input Parameters

flag -PETSC_FP_TRAP_ON, PETSC_FP_TRAP_OFF.

Options Database Keys

-fp_trap -Activates floating point trapping

Description

On systems that support it, this routine causes floating pointoverflow, divide-by-zero, and invalid-operand (e.g., a NaN) tocause a message to be printed and the program to exit.

Caution

On certain machines, in particular the IBM rs6000, floating pointtrapping is VERY slow!

Keywords

floating point trap, overflow, divide-by-zero, invalid-operand

Location: src/sys/src/errorfp.c
System Index
Table of Contents