Set up trapping for floating point exceptions (signal FPE). More...
Classes | |
class | ignore |
Helper to locally ignore SIGFPE handling. More... | |
Public Member Functions | |
sigFpe () | |
Constructor calls set() to activate the FPE signal handler if it was was not previously activate and requested() returns true. More... | |
~sigFpe () | |
Destructor calls unset() to deactivate the FPE signal handler as required. More... | |
Static Public Member Functions | |
static bool | requested () |
Check if SIGFPE signals handler is to be enabled. More... | |
static bool | active () noexcept |
True if SIGFPE handling is currently active. More... | |
static bool | nanActive () noexcept |
True if NaN memory initialisation is currently active. More... | |
static void | set (bool verbose=false) |
Activate SIGFPE handler when FOAM_SIGFPE is enabled. Activate fill memory with signaling_NaN when FOAM_SETNAN is enabled. More... | |
static void | unset (bool verbose=false) |
Deactivate SIGFPE handler and NaN memory initialisation. More... | |
static void | fillNan (char *buf, size_t count) |
Fill data block with signaling_NaN values. More... | |
static void | fillNan (UList< scalar > &list) |
Fill data block with signaling_NaN values. More... | |
Set up trapping for floating point exceptions (signal FPE).
Defined by controlDict InfoSwitch entries:
trapFpe
, this causes usage of uninitialized scalars to trigger an abort.trapFpe
setNaN
sigFpe | ( | ) |
Constructor calls set() to activate the FPE signal handler if it was was not previously activate and requested() returns true.
~sigFpe | ( | ) |
Destructor calls unset() to deactivate the FPE signal handler as required.
Definition at line 136 of file sigFpe.C.
References Foam::BitOps::unset().
|
static |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
static |
Activate SIGFPE handler when FOAM_SIGFPE is enabled. Activate fill memory with signaling_NaN when FOAM_SETNAN is enabled.
Definition at line 150 of file sigFpe.C.
References Foam::endl(), Foam::Info, isTrue(), and Foam::setHandler().
Referenced by argList::parse(), and sigFpe::ignore::reset().
|
static |
Deactivate SIGFPE handler and NaN memory initialisation.
Definition at line 208 of file sigFpe.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::Info, and Foam::resetHandler().
Referenced by sigFpe::ignore::ignore().
|
static |
Fill data block with signaling_NaN values.
Definition at line 244 of file sigFpe.C.
References Foam::BitOps::count().
Referenced by dynamicRefineFvMesh::mapFields().
|
static |
Fill data block with signaling_NaN values.
Definition at line 261 of file sigFpe.C.
References UList< T >::data(), UList< T >::empty(), and UList< T >::size().