Skip to content
GitLab
Menu
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
4bb35e1e
Commit
4bb35e1e
authored
May 02, 2012
by
Thomas Witkowski
Browse files
Ich bin so blooooeeed, eh...
parent
59ee4244
Changes
10
Show whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/ElementObjectDatabase.cc
View file @
4bb35e1e
...
@@ -572,7 +572,7 @@ namespace AMDiS {
...
@@ -572,7 +572,7 @@ namespace AMDiS {
}
}
int
ElementObjectDatabase
::
getIterateOwner
()
int
ElementObjectDatabase
::
getIterateOwner
(
int
level
)
{
{
FUNCNAME
(
"ElementObjectDatabase::getIterateOwner()"
);
FUNCNAME
(
"ElementObjectDatabase::getIterateOwner()"
);
...
@@ -593,9 +593,17 @@ namespace AMDiS {
...
@@ -593,9 +593,17 @@ namespace AMDiS {
break
;
break
;
}
}
std
::
set
<
int
>
&
levelRanks
=
levelData
->
getLevelRanks
(
level
);
bool
allRanks
=
(
levelRanks
.
size
()
==
1
&&
*
(
levelRanks
.
begin
())
==
-
1
);
MSG
(
"ALLRANKS [LEVEL%d]: %d (%d %d)
\n
"
,
level
,
allRanks
,
levelRanks
.
size
(),
*
(
levelRanks
.
begin
()));
for
(
vector
<
ElementObjectData
>::
iterator
it
=
objData
->
begin
();
for
(
vector
<
ElementObjectData
>::
iterator
it
=
objData
->
begin
();
it
!=
objData
->
end
();
++
it
)
it
!=
objData
->
end
();
++
it
)
{
owner
=
std
::
max
(
owner
,
(
*
macroElementRankMap
)[
it
->
elIndex
]);
int
elRank
=
(
*
macroElementRankMap
)[
it
->
elIndex
];
if
(
allRanks
||
levelData
->
getLevelRanks
(
level
).
count
(
elRank
))
owner
=
std
::
max
(
owner
,
elRank
);
}
return
owner
;
return
owner
;
}
}
...
...
AMDiS/src/parallel/ElementObjectDatabase.h
View file @
4bb35e1e
...
@@ -230,7 +230,7 @@ namespace AMDiS {
...
@@ -230,7 +230,7 @@ namespace AMDiS {
}
}
/// Returns the rank owner of the current iterator position.
/// Returns the rank owner of the current iterator position.
int
getIterateOwner
();
int
getIterateOwner
(
int
level
);
/// Returns the rank owner of the current iterator position.
/// Returns the rank owner of the current iterator position.
int
getIterateMaxLevel
();
int
getIterateMaxLevel
();
...
...
AMDiS/src/parallel/InteriorBoundary.cc
View file @
4bb35e1e
...
@@ -22,7 +22,8 @@ namespace AMDiS {
...
@@ -22,7 +22,8 @@ namespace AMDiS {
using
namespace
std
;
using
namespace
std
;
void
InteriorBoundary
::
create
(
MPI
::
Intracomm
&
mpiComm
,
void
InteriorBoundary
::
create
(
MeshLevelData
&
levelData
,
int
level
,
ElementObjectDatabase
&
elObjDb
)
ElementObjectDatabase
&
elObjDb
)
{
{
FUNCNAME
(
"InteriorBoundary::clear()"
);
FUNCNAME
(
"InteriorBoundary::clear()"
);
...
@@ -34,7 +35,9 @@ namespace AMDiS {
...
@@ -34,7 +35,9 @@ namespace AMDiS {
Mesh
*
mesh
=
elObjDb
.
getMesh
();
Mesh
*
mesh
=
elObjDb
.
getMesh
();
TEST_EXIT_DBG
(
mesh
)(
"Should not happen!
\n
"
);
TEST_EXIT_DBG
(
mesh
)(
"Should not happen!
\n
"
);
int
mpiRank
=
mpiComm
.
Get_rank
();
int
mpiRank
=
levelData
.
getMpiComm
(
0
);
MPI
::
Intracomm
mpiComm
=
levelData
.
getMpiComm
(
level
);
std
::
set
<
int
>
levelRanks
=
levelData
.
getLevelRanks
(
level
);
// === Create interior boundary data structure. ===
// === Create interior boundary data structure. ===
...
@@ -43,10 +46,31 @@ namespace AMDiS {
...
@@ -43,10 +46,31 @@ namespace AMDiS {
while
(
elObjDb
.
iterate
(
geoIndex
))
{
while
(
elObjDb
.
iterate
(
geoIndex
))
{
map
<
int
,
ElementObjectData
>&
objData
=
elObjDb
.
getIterateData
();
map
<
int
,
ElementObjectData
>&
objData
=
elObjDb
.
getIterateData
();
// Test, if this is a boundary object of this rank.
if
(
!
(
objData
.
count
(
mpiRank
)
&&
objData
.
size
()
>
1
))
if
(
!
(
objData
.
count
(
mpiRank
)
&&
objData
.
size
()
>
1
))
continue
;
continue
;
int
owner
=
elObjDb
.
getIterateOwner
();
#if 0
// Test, if the boundary object defines an interior boundary within the
// ranks of the MPI group. If not, go to next element.
bool boundaryWithinMpiGroup = false;
if (levelRanks.size() == 1 && *(levelRanks.begin()) == -1) {
boundaryWithinMpiGroup = true;
} else {
for (map<int, ElementObjectData>::iterator it = objData.begin();
it != objData.end(); ++it) {
if (it->first != mpiRank && levelRanks.count(it->first)) {
boundaryWithinMpiGroup == true;
break;
}
}
}
if (!boundaryWithinMpiGroup)
continue;
#endif
int
owner
=
elObjDb
.
getIterateOwner
(
level
);
ElementObjectData
&
rankBoundEl
=
objData
[
mpiRank
];
ElementObjectData
&
rankBoundEl
=
objData
[
mpiRank
];
AtomicBoundary
bound
;
AtomicBoundary
bound
;
...
...
AMDiS/src/parallel/InteriorBoundary.h
View file @
4bb35e1e
...
@@ -41,7 +41,8 @@ namespace AMDiS {
...
@@ -41,7 +41,8 @@ namespace AMDiS {
*/
*/
class
InteriorBoundary
{
class
InteriorBoundary
{
public:
public:
void
create
(
MPI
::
Intracomm
&
mpiComm
,
void
create
(
MeshLevelData
&
levelData
,
int
level
,
ElementObjectDatabase
&
elObjDb
);
ElementObjectDatabase
&
elObjDb
);
RankToBoundMap
&
getOwn
()
RankToBoundMap
&
getOwn
()
...
@@ -121,7 +122,7 @@ namespace AMDiS {
...
@@ -121,7 +122,7 @@ namespace AMDiS {
{
{
do
{
do
{
++
vecIt
;
++
vecIt
;
}
while
(
vecIt
->
maxLevel
<
level
&&
vecIt
!=
mapIt
->
second
.
end
()
);
}
while
(
vecIt
!=
mapIt
->
second
.
end
()
&&
vecIt
->
maxLevel
<
level
);
if
(
vecIt
==
mapIt
->
second
.
end
())
{
if
(
vecIt
==
mapIt
->
second
.
end
())
{
++
mapIt
;
++
mapIt
;
...
@@ -169,7 +170,7 @@ namespace AMDiS {
...
@@ -169,7 +170,7 @@ namespace AMDiS {
vecIt
=
mapIt
->
second
.
begin
();
vecIt
=
mapIt
->
second
.
begin
();
// Search for the next atomic boundary on the mesh level
// Search for the next atomic boundary on the mesh level
while
(
vecIt
->
maxLevel
<
level
&&
vecIt
!=
mapIt
->
second
.
end
()
)
while
(
vecIt
!=
mapIt
->
second
.
end
()
&&
vecIt
->
maxLevel
<
level
)
++
vecIt
;
++
vecIt
;
// If vector iterator is not at the end, we have found one and
// If vector iterator is not at the end, we have found one and
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
4bb35e1e
...
@@ -1511,9 +1511,12 @@ namespace AMDiS {
...
@@ -1511,9 +1511,12 @@ namespace AMDiS {
if
(
firstCall
)
if
(
firstCall
)
elObjDb
.
create
(
partitionMap
,
levelData
);
elObjDb
.
create
(
partitionMap
,
levelData
);
elObjDb
.
updateRankData
();
elObjDb
.
updateRankData
();
intBoundary
.
create
(
mpiComm
,
elObjDb
);
intBoundary
.
create
(
levelData
,
0
,
elObjDb
);
// if (levelData.getLevelNumber() > 1)
// intBoundarySd.create(levelData, 1, elObjDb);
#if (DEBUG != 0)
#if (DEBUG != 0)
ParallelDebug
::
printBoundaryInfo
(
*
this
);
ParallelDebug
::
printBoundaryInfo
(
*
this
);
...
@@ -1530,10 +1533,12 @@ namespace AMDiS {
...
@@ -1530,10 +1533,12 @@ namespace AMDiS {
dofComm
.
init
(
0
,
levelData
,
feSpaces
);
dofComm
.
init
(
0
,
levelData
,
feSpaces
);
dofComm
.
create
(
intBoundary
);
dofComm
.
create
(
intBoundary
);
#if 0
if (levelData.getLevelNumber() > 1) {
if (levelData.getLevelNumber() > 1) {
dofCommSd.init(1, levelData, feSpaces);
dofCommSd.init(1, levelData, feSpaces);
dofCommSd.create(intBoundary);
dofCommSd.create(intBoundary);
}
}
#endif
// === If requested, create more information on communication DOFs. ===
// === If requested, create more information on communication DOFs. ===
...
@@ -1690,6 +1695,11 @@ namespace AMDiS {
...
@@ -1690,6 +1695,11 @@ namespace AMDiS {
lastMeshChangeIndex
=
mesh
->
getChangeIndex
();
lastMeshChangeIndex
=
mesh
->
getChangeIndex
();
MSG
(
"TEST: %d %d
\n
"
,
dofComm
.
getNumberDofs
(
dofComm
.
getSendDofs
(),
0
,
feSpaces
[
0
]),
dofComm
.
getNumberDofs
(
dofComm
.
getRecvDofs
(),
0
,
feSpaces
[
0
]));
#if (DEBUG != 0)
#if (DEBUG != 0)
ParallelDebug
::
testDofContainerCommunication
(
*
this
);
ParallelDebug
::
testDofContainerCommunication
(
*
this
);
#endif
#endif
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
4bb35e1e
...
@@ -471,6 +471,8 @@ namespace AMDiS {
...
@@ -471,6 +471,8 @@ namespace AMDiS {
/// partitioning the whole mesh.
/// partitioning the whole mesh.
InteriorBoundary
intBoundary
;
InteriorBoundary
intBoundary
;
InteriorBoundary
intBoundarySd
;
DofComm
dofComm
;
DofComm
dofComm
;
DofComm
dofCommSd
;
DofComm
dofCommSd
;
...
...
AMDiS/src/parallel/ParallelDebug.cc
View file @
4bb35e1e
AMDiS/src/parallel/ParallelDofMapping.cc
View file @
4bb35e1e
...
@@ -26,12 +26,10 @@ namespace AMDiS {
...
@@ -26,12 +26,10 @@ namespace AMDiS {
nonRankDofs
.
clear
();
nonRankDofs
.
clear
();
nonRankDofs
.
resize
(
nLevel
);
nonRankDofs
.
resize
(
nLevel
);
for
(
int
i
=
0
;
i
<
nLevel
;
i
++
)
{
nRankDofs
.
resize
(
nLevel
,
0
);
nRankDofs
[
i
]
=
0
;
nLocalDofs
.
resize
(
nLevel
,
0
);
nLocalDofs
[
i
]
=
0
;
nOverallDofs
.
resize
(
nLevel
,
0
);
nOverallDofs
[
i
]
=
0
;
rStartDofs
.
resize
(
nLevel
,
0
);
rStartDofs
[
i
]
=
0
;
}
}
}
...
...
AMDiS/src/parallel/ParallelDofMapping.h
View file @
4bb35e1e
...
@@ -109,11 +109,7 @@ namespace AMDiS {
...
@@ -109,11 +109,7 @@ namespace AMDiS {
feSpace
(
NULL
),
feSpace
(
NULL
),
dofMap
(
1
),
dofMap
(
1
),
needGlobalMapping
(
false
),
needGlobalMapping
(
false
),
hasNonLocalDofs
(
false
),
hasNonLocalDofs
(
false
)
nRankDofs
(
1
),
nLocalDofs
(
1
),
nOverallDofs
(
1
),
rStartDofs
(
1
)
{
{
clear
();
clear
();
}
}
...
...
test/mpi/src/test0002.cc
View file @
4bb35e1e
...
@@ -39,7 +39,6 @@ BOOST_AUTO_TEST_CASE(amdis_mpi_feti)
...
@@ -39,7 +39,6 @@ BOOST_AUTO_TEST_CASE(amdis_mpi_feti)
BOOST_REQUIRE
(
feti
.
getNumberOfDuals
()
==
48
);
BOOST_REQUIRE
(
feti
.
getNumberOfDuals
()
==
48
);
Spreadsheet
sheet
;
Spreadsheet
sheet
;
sheet
.
read
(
"data/data0002a"
);
sheet
.
read
(
"data/data0002a"
);
vector
<
double
>
data
=
sheet
.
getData
()[
MPI
::
COMM_WORLD
.
Get_rank
()];
vector
<
double
>
data
=
sheet
.
getData
()[
MPI
::
COMM_WORLD
.
Get_rank
()];
...
...
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