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
Backofen, Rainer
amdis
Commits
76590ab6
Commit
76590ab6
authored
Nov 15, 2012
by
Thomas Witkowski
Browse files
Fixed some very small problems.
parent
8e238e78
Changes
1
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/MeshPartitioner.cc
View file @
76590ab6
...
...
@@ -30,15 +30,28 @@ namespace AMDiS {
// === Check for reading ARH meta file to create initial partitioning. ===
map
<
int
,
int
>
arh
ElInRank
;
map
<
int
,
int
>
map
ElInRank
;
map
<
int
,
int
>
arhElCodeSize
;
string
arhMetaFile
=
""
;
Parameters
::
get
(
"parallel->partitioner->read meta arh"
,
arhMetaFile
);
bool
partitioningArhBased
=
(
arhMetaFile
!=
""
);
if
(
partitioningArhBased
)
{
int
nProc
=
ArhReader
::
readMetaData
(
arhMetaFile
,
arhElInRank
,
arhElCodeSize
);
if
(
nProc
!=
mpiSize
)
partitioningArhBased
=
false
;
string
partitioningFile
=
""
;
Parameters
::
get
(
"parallel->initial partitioning file"
,
partitioningFile
);
if
(
partitioningFile
!=
""
)
{
ifstream
file
;
file
.
open
(
partitioningFile
.
c_str
());
int
nElements
=
0
;
file
>>
nElements
;
for
(
int
i
=
0
;
i
<
nElements
;
i
++
)
file
>>
mapElInRank
[
i
];
file
.
close
();
}
else
{
string
arhMetaFile
=
""
;
Parameters
::
get
(
"parallel->partitioner->read meta arh"
,
arhMetaFile
);
bool
partitioningArhBased
=
(
arhMetaFile
!=
""
);
if
(
partitioningArhBased
)
{
int
nProc
=
ArhReader
::
readMetaData
(
arhMetaFile
,
mapElInRank
,
arhElCodeSize
);
if
(
nProc
!=
mpiSize
)
partitioningArhBased
=
false
;
}
}
...
...
@@ -70,11 +83,11 @@ namespace AMDiS {
// In standard mode assign to each macro element an arbitrary but unique
// rank number.
int
elInRank
=
0
;
if
(
!
partitioningArhBased
)
int
elInRank
=
0
;
if
(
mapElInRank
.
empty
()
)
elInRank
=
std
::
min
(
elIndex
/
elPerRank
,
mpiSize
-
1
);
else
elInRank
=
arh
ElInRank
[
elIndex
];
elInRank
=
map
ElInRank
[
elIndex
];
elementInRank
[
elIndex
]
=
(
elInRank
==
mpiRank
);
partitionMap
[
elIndex
]
=
elInRank
;
...
...
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