COMP: scotchDecomp: floating point error checking

This commit is contained in:
mattijs
2012-08-20 18:02:22 +01:00
parent bc976819b4
commit 34395ddcd4
2 changed files with 11 additions and 27 deletions

View File

@ -129,17 +129,9 @@ extern "C"
// Hack: scotch generates floating point errors so need to switch of error // Hack: scotch generates floating point errors so need to switch of error
// trapping! // trapping!
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64) #ifdef __GLIBC__
# define LINUX # ifndef _GNU_SOURCE
#endif # define _GNU_SOURCE
#if defined(LINUX) && defined(__GNUC__)
# define LINUX_GNUC
#endif
#ifdef LINUX_GNUC
# ifndef __USE_GNU
# define __USE_GNU
# endif # endif
# include <fenv.h> # include <fenv.h>
#endif #endif
@ -651,7 +643,7 @@ Foam::label Foam::ptscotchDecomp::decompose
// Hack:switch off fpu error trapping // Hack:switch off fpu error trapping
# ifdef LINUX_GNUC # ifdef FE_NOMASK_ENV
int oldExcepts = fedisableexcept int oldExcepts = fedisableexcept
( (
FE_DIVBYZERO FE_DIVBYZERO
@ -681,7 +673,7 @@ Foam::label Foam::ptscotchDecomp::decompose
"SCOTCH_graphMap" "SCOTCH_graphMap"
); );
# ifdef LINUX_GNUC # ifdef FE_NOMASK_ENV
feenableexcept(oldExcepts); feenableexcept(oldExcepts);
# endif # endif

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -135,17 +135,9 @@ extern "C"
// Hack: scotch generates floating point errors so need to switch of error // Hack: scotch generates floating point errors so need to switch of error
// trapping! // trapping!
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64) #ifdef __GLIBC__
# define LINUX # ifndef _GNU_SOURCE
#endif # define _GNU_SOURCE
#if defined(LINUX) && defined(__GNUC__)
# define LINUX_GNUC
#endif
#ifdef LINUX_GNUC
# ifndef __USE_GNU
# define __USE_GNU
# endif # endif
# include <fenv.h> # include <fenv.h>
#endif #endif
@ -503,7 +495,7 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
// Hack:switch off fpu error trapping // Hack:switch off fpu error trapping
# ifdef LINUX_GNUC # ifdef FE_NOMASK_ENV
int oldExcepts = fedisableexcept int oldExcepts = fedisableexcept
( (
FE_DIVBYZERO FE_DIVBYZERO
@ -526,7 +518,7 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
"SCOTCH_graphMap" "SCOTCH_graphMap"
); );
# ifdef LINUX_GNUC # ifdef FE_NOMASK_ENV
feenableexcept(oldExcepts); feenableexcept(oldExcepts);
# endif # endif