Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
amdis
Commits
9e3e5617
Commit
9e3e5617
authored
Dec 08, 2012
by
Thomas Witkowski
Browse files
Checker partitioner with tetrahedron (4) mode works also for larger numer of MPI tasks.
parent
18b97ade
Changes
4
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/CheckerPartitioner.cc
View file @
9e3e5617
...
...
@@ -152,10 +152,19 @@ namespace AMDiS {
case
4
:
// tetrahedron-stripes
elInRank
=
elStripeInRank
[
elIndex
];
#if 0
{
int nStripes = elInStripe.size();
int elsPerStripe = elInStripe[0].size();
int procPerStripe = mpiSize / nStripes;
TEST_EXIT(mpiSize % nStripes == 0)("Should not happen!\n");
int inStripe = -1;
int stripePos = -1;
for
(
int
stripe
=
0
;
stripe
<
elI
nStripe
.
size
()
;
stripe
++
)
{
for (int stripe = 0; stripe < nStripe
s
; stripe++) {
for (int pos = 0; pos < elInStripe[stripe].size(); pos++) {
if (elInStripe[stripe][pos] == elIndex) {
inStripe = stripe;
...
...
@@ -171,6 +180,7 @@ namespace AMDiS {
elInRank = inStripe;
}
#endif
break
;
...
...
@@ -197,6 +207,7 @@ namespace AMDiS {
FUNCNAME
(
"CheckerPartitioner::createTetrahedronStripes()"
);
vector
<
vector
<
MacroElement
*>
>
stripes
;
vector
<
vector
<
int
>
>
elInStripe
;
int
nElements
=
0
;
TraverseStack
stack
;
...
...
@@ -300,6 +311,32 @@ namespace AMDiS {
}
TEST_EXIT
(
testElementCounter
==
nElements
)(
"Should not happen!
\n
"
);
int
elsPerStripe
=
stripes
[
0
].
size
();
for
(
int
i
=
0
;
i
<
stripes
.
size
();
i
++
)
{
TEST_EXIT
(
stripes
[
i
].
size
()
==
elsPerStripe
)
(
"Should not happen!
\n
"
);
}
// === Computing mapping from macro element indices to ranks ===
int
nStripes
=
elInStripe
.
size
();
int
procPerStripe
=
mpiSize
/
nStripes
;
int
elsPerRank
=
elsPerStripe
/
procPerStripe
;
TEST_EXIT
(
mpiSize
%
nStripes
==
0
)(
"Should not happen!
\n
"
);
TEST_EXIT
(
elsPerStripe
%
procPerStripe
==
0
)(
"Should not happen!
\n
"
);
elStripeInRank
.
clear
();
int
rankCount
=
0
;
for
(
int
i
=
0
;
i
<
nStripes
;
i
++
)
{
for
(
int
j
=
0
;
j
<
procPerStripe
;
j
++
)
{
for
(
int
k
=
0
;
k
<
elsPerRank
;
k
++
)
elStripeInRank
[
elInStripe
[
i
][
j
*
elsPerRank
+
k
]]
=
rankCount
;
rankCount
++
;
}
}
}
}
AMDiS/src/parallel/CheckerPartitioner.h
View file @
9e3e5617
...
...
@@ -65,7 +65,7 @@ namespace AMDiS {
int
mode
;
/// Only used in mode 4.
vector
<
vector
<
int
>
>
elInStripe
;
map
<
int
,
int
>
elStripeInRank
;
bool
multilevel
;
};
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
9e3e5617
...
...
@@ -1392,7 +1392,7 @@ namespace AMDiS {
#else
int
writePartMesh
=
0
;
#endif
Parameters
::
get
(
"
db
g->write part mesh"
,
writePartMesh
);
Parameters
::
get
(
"
parallel->debu
g->write part mesh"
,
writePartMesh
);
if
(
writePartMesh
>
0
&&
repartitioningCounter
==
0
)
ParallelDebug
::
writePartitioningFile
(
debugOutputDir
+
"partitioning"
,
repartitioningCounter
,
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
9e3e5617
...
...
@@ -352,6 +352,8 @@ namespace AMDiS {
(
fabs
(
c
[
0
]
-
12.5
)
<
e
&&
fabs
(
c
[
1
]
-
12.5
)
<
e
))
{
MSG
(
"PRIMAL COORD %f %f
\n
"
,
c
[
0
],
c
[
1
]);
primals
.
insert
(
**
it
);
}
else
{
MSG
(
"OMMIT SOME PRIMAL!
\n
"
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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