Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
feb846bd
Commit
feb846bd
authored
May 29, 2009
by
mattijs
Browse files
work around scotch fpe bug
parent
0100aa87
Changes
2
Hide whitespace changes
Inline
Side-by-side
applications/utilities/parallelProcessing/decomposePar/decomposeParDict
View file @
feb846bd
...
...
@@ -55,7 +55,17 @@ metisCoeffs
}
scotchCoeffs
{}
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
//writeGraph true;
//strategy "b";
}
manualCoeffs
{
...
...
src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C
View file @
feb846bd
...
...
@@ -75,6 +75,24 @@ extern "C"
}
// Hack: scotch generates floating point errors so need to switch of error
// trapping!
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64)
# define LINUX
#endif
#if defined(LINUX) && defined(__GNUC__)
# define LINUX_GNUC
#endif
#ifdef LINUX_GNUC
# ifndef __USE_GNU
# define __USE_GNU
# endif
# include <fenv.h>
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
...
...
@@ -113,13 +131,30 @@ Foam::label Foam::scotchDecomp::decompose
{
// Strategy
// ~~~~~~~~
// Default.
SCOTCH_Strat
stradat
;
check
(
SCOTCH_stratInit
(
&
stradat
),
"SCOTCH_stratInit"
);
//SCOTCH_stratGraphMap(&stradat, &argv[i][2]);
//fprintf(stdout, "S\tStrat=");
//SCOTCH_stratSave(&stradat, stdout);
//fprintf(stdout, "\n");
if
(
decompositionDict_
.
found
(
"scotchCoeffs"
))
{
const
dictionary
&
scotchCoeffs
=
decompositionDict_
.
subDict
(
"scotchCoeffs"
);
string
strategy
;
if
(
scotchCoeffs
.
readIfPresent
(
"strategy"
,
strategy
))
{
if
(
debug
)
{
Info
<<
"scotchDecomp : Using strategy "
<<
strategy
<<
endl
;
}
SCOTCH_stratGraphMap
(
&
stradat
,
strategy
.
c_str
());
//fprintf(stdout, "S\tStrat=");
//SCOTCH_stratSave(&stradat, stdout);
//fprintf(stdout, "\n");
}
}
// Graph
...
...
@@ -198,12 +233,36 @@ Foam::label Foam::scotchDecomp::decompose
SCOTCH_Arch
archdat
;
check
(
SCOTCH_archInit
(
&
archdat
),
"SCOTCH_archInit"
);
check
(
// SCOTCH_archCmpltw for weighted.
SCOTCH_archCmplt
(
&
archdat
,
nProcessors_
),
"SCOTCH_archCmplt"
);
List
<
label
>
processorWeights
;
if
(
decompositionDict_
.
found
(
"scotchCoeffs"
))
{
const
dictionary
&
scotchCoeffs
=
decompositionDict_
.
subDict
(
"scotchCoeffs"
);
scotchCoeffs
.
readIfPresent
(
"processorWeights"
,
processorWeights
);
}
if
(
processorWeights
.
size
())
{
if
(
debug
)
{
Info
<<
"scotchDecomp : Using procesor weights "
<<
processorWeights
<<
endl
;
}
check
(
SCOTCH_archCmpltw
(
&
archdat
,
nProcessors_
,
processorWeights
.
begin
()),
"SCOTCH_archCmpltw"
);
}
else
{
check
(
SCOTCH_archCmplt
(
&
archdat
,
nProcessors_
),
"SCOTCH_archCmplt"
);
}
//SCOTCH_Mapping mapdat;
...
...
@@ -212,6 +271,16 @@ Foam::label Foam::scotchDecomp::decompose
//SCOTCH_graphMapExit(&grafdat, &mapdat);
// Hack:switch off fpu error trapping
# ifdef LINUX_GNUC
int
oldExcepts
=
fedisableexcept
(
FE_DIVBYZERO
|
FE_INVALID
|
FE_OVERFLOW
);
# endif
finalDecomp
.
setSize
(
xadj
.
size
()
-
1
);
finalDecomp
=
0
;
check
...
...
@@ -226,6 +295,11 @@ Foam::label Foam::scotchDecomp::decompose
"SCOTCH_graphMap"
);
# ifdef LINUX_GNUC
feenableexcept
(
oldExcepts
);
# endif
//finalDecomp.setSize(xadj.size()-1);
//check
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment