Skip to content

Commit

Permalink
COMP: scotchDecomp: floating point error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
mattijs committed Aug 20, 2012
1 parent 5a54dea commit 276d31f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
18 changes: 5 additions & 13 deletions src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
20 changes: 6 additions & 14 deletions src/parallel/decompose/scotchDecomp/scotchDecomp.C
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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


Expand Down

0 comments on commit 276d31f

Please sign in to comment.