Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
sigFpe Class Reference

Set up trapping for floating point exceptions (signal FPE). More...

Public Member Functions

 sigFpe ()
 Construct null. More...
 
 ~sigFpe ()
 Destructor. More...
 
void set (const bool verbose)
 Activate SIGFPE signal handler when FOAM_SIGFPE is set. More...
 

Static Public Member Functions

static void fillNan (UList< scalar > &)
 Fill block of data with NaN. More...
 

Static Public Attributes

static bool mallocNanActive_ = false
 Flag to indicate mallocNan is enabled. More...
 

Detailed Description

Set up trapping for floating point exceptions (signal FPE).

Controlled by two env vars:

Parameters
FOAM_SIGFPE
exception trapping
FOAM_SETNAN
initialization of all malloced memory to NaN. If FOAM_SIGFPE also set, this will cause usage of uninitialized scalars to trigger an abort.
Source files

Definition at line 67 of file sigFpe.H.

Constructor & Destructor Documentation

sigFpe ( )

Construct null.

Definition at line 115 of file sigFpe.C.

~sigFpe ( )

Destructor.

Definition at line 123 of file sigFpe.C.

References Foam::abort(), Foam::env(), Foam::FatalError, and FatalErrorIn.

Here is the call graph for this function:

Member Function Documentation

void set ( const bool  verbose)

Activate SIGFPE signal handler when FOAM_SIGFPE is set.

Fill memory with NaN when FOAM_SETNAN is set

Definition at line 152 of file sigFpe.C.

References Foam::abort(), Foam::endl(), Foam::env(), Foam::FatalError, FatalErrorIn, and Foam::Info.

Referenced by argList::parse().

Here is the call graph for this function:

Here is the caller graph for this function:

void fillNan ( UList< scalar > &  lst)
static

Fill block of data with NaN.

Definition at line 48 of file sigFpe.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, Foam::jobInfo, sigFpe::mallocNanActive_, Foam::Perr, and JobInfo::signalEnd().

Referenced by dynamicRefineFvMesh::refine().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool mallocNanActive_ = false
static

Flag to indicate mallocNan is enabled.

Definition at line 103 of file sigFpe.H.

Referenced by sigFpe::fillNan().


The documentation for this class was generated from the following files: