ENH: add trapFpe and setNaN optimisationSwitch (issue #517)

- allows configuration without an environment variable.
  For compatibility still respect FOAM_SIGFPE and FOAM_SETNAN
  env-variables

- The env-variables are now treated as true/false switch values.
  Previously there was just a check for env exists or not, but this
  can be fairly fragile for a user's environment.
This commit is contained in:
Mark Olesen
2017-07-05 17:49:37 +02:00
parent e54a930dcc
commit c50368ecc6
14 changed files with 139 additions and 83 deletions

View File

@ -79,6 +79,14 @@ OptimisationSwitches
// global reduction, even if multi-pass is not needed)
maxCommsSize 0;
// Trap floating point exception.
// Can override with FOAM_SIGFPE (true|false)
trapFpe 1;
// Initialization malloced memory to NaN.
// Can override with FOAM_SETNAN (true|false)
setNaN 0;
// Force dumping (at next timestep) upon signal (-1 to disable)
writeNowSignal -1; // 10;