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
80ce300b
Commit
80ce300b
authored
Aug 26, 2013
by
Praetorius, Simon
Browse files
some compiler warnings removed
parent
f5c1cb21
Changes
53
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/CoarseningManager3d.cc
View file @
80ce300b
...
@@ -129,8 +129,7 @@ namespace AMDiS {
...
@@ -129,8 +129,7 @@ namespace AMDiS {
int
edgeNo1
=
el
->
getEdgeOfChild
(
1
,
i
,
elInfo2
->
getType
());
int
edgeNo1
=
el
->
getEdgeOfChild
(
1
,
i
,
elInfo2
->
getType
());
bool
refineChildFirst
=
bool
refineChildFirst
=
!
(
i
>
0
&&
!
((
i
>
0
&&
(
edgeNo0
>=
0
&&
!
el2
->
getChild
(
0
)
->
isLeaf
()))
||
(
edgeNo0
>=
0
&&
!
el2
->
getChild
(
0
)
->
isLeaf
())
||
(
edgeNo1
>=
0
&&
!
el2
->
getChild
(
1
)
->
isLeaf
()));
(
edgeNo1
>=
0
&&
!
el2
->
getChild
(
1
)
->
isLeaf
()));
if
(
refineChildFirst
)
{
if
(
refineChildFirst
)
{
...
...
AMDiS/src/ElInfo.cc
View file @
80ce300b
...
@@ -218,7 +218,7 @@ namespace AMDiS {
...
@@ -218,7 +218,7 @@ namespace AMDiS {
int
i
=
0
;
int
i
=
0
;
for
(;
i
<
refinementPathLength
;
i
++
)
{
for
(;
i
<
refinementPathLength
;
i
++
)
{
elInfo
[(
i
+
1
)
%
2
]
->
fillElInfo
(
static_cast
<
int
>
((
refinementPath
&
(
1
<<
i
))
==
(
1
<<
i
)),
elInfo
[
i
%
2
]);
elInfo
[(
i
+
1
)
%
2
]
->
fillElInfo
(
static_cast
<
int
>
((
refinementPath
&
(
1
<<
i
))
==
static_cast
<
unsigned
long
>
(
1
<<
i
)),
elInfo
[
i
%
2
]);
}
}
if
(
i
%
2
==
0
)
if
(
i
%
2
==
0
)
*
this
=
*
elInfo
[
0
];
*
this
=
*
elInfo
[
0
];
...
...
AMDiS/src/ProblemStatDbg.cc
View file @
80ce300b
...
@@ -128,9 +128,9 @@ namespace AMDiS {
...
@@ -128,9 +128,9 @@ namespace AMDiS {
{
{
using
mtl
::
tag
::
major
;
using
mtl
::
tag
::
nz
;
using
mtl
::
begin
;
using
mtl
::
end
;
using
mtl
::
tag
::
major
;
using
mtl
::
tag
::
nz
;
using
mtl
::
begin
;
using
mtl
::
end
;
namespace
traits
=
mtl
::
traits
;
namespace
traits
=
mtl
::
traits
;
typedef
DOFMatrix
::
base_matrix_type
Matrix
;
//
typedef DOFMatrix::base_matrix_type Matrix;
typedef
traits
::
range_generator
<
major
,
Matrix
>::
type
cursor_type
;
//
typedef traits::range_generator<major, Matrix>::type cursor_type;
typedef
traits
::
range_generator
<
nz
,
cursor_type
>::
type
icursor_type
;
//
typedef traits::range_generator<nz, cursor_type>::type icursor_type;
// Create a map from coords of all DOFs, to the DOF indices in this problem.
// Create a map from coords of all DOFs, to the DOF indices in this problem.
CoordToDof
coordToDof
;
CoordToDof
coordToDof
;
...
...
AMDiS/src/RefinementManager3d.cc
View file @
80ce300b
...
@@ -686,7 +686,7 @@ namespace AMDiS {
...
@@ -686,7 +686,7 @@ namespace AMDiS {
// === of this edge to the refinement patch. ===
// === of this edge to the refinement patch. ===
for
(
int
edgeIndex
=
0
;
for
(
int
edgeIndex
=
0
;
edgeIndex
<
static_cast
<
unsigned
int
>
(
refineEdges
.
size
());
edgeIndex
++
)
{
edgeIndex
<
static_cast
<
int
>
(
refineEdges
.
size
());
edgeIndex
++
)
{
Element
*
otherEl
=
refineEdges
[
edgeIndex
].
first
;
Element
*
otherEl
=
refineEdges
[
edgeIndex
].
first
;
TraverseStack
stack2
;
TraverseStack
stack2
;
ElInfo
*
elInfo2
=
ElInfo
*
elInfo2
=
...
...
AMDiS/src/ZeroOrderTerm.h
View file @
80ce300b
...
@@ -129,14 +129,15 @@ namespace AMDiS {
...
@@ -129,14 +129,15 @@ namespace AMDiS {
/// DOFVector to be evaluated at quadrature points.
/// DOFVector to be evaluated at quadrature points.
DOFVectorBase
<
double
>*
vec
;
DOFVectorBase
<
double
>*
vec
;
/// Function for c.
AbstractFunction
<
double
,
double
>
*
f
;
/// Constant factor of zero order term.
/// Constant factor of zero order term.
double
factor
;
double
factor
;
/// Vector v at quadrature points.
/// Vector v at quadrature points.
mtl
::
dense_vector
<
double
>
vecAtQPs
;
mtl
::
dense_vector
<
double
>
vecAtQPs
;
/// Function for c.
AbstractFunction
<
double
,
double
>
*
f
;
};
};
...
@@ -176,6 +177,10 @@ namespace AMDiS {
...
@@ -176,6 +177,10 @@ namespace AMDiS {
/// DOFVectorBase to be evaluated at quadrature points.
/// DOFVectorBase to be evaluated at quadrature points.
DOFVectorBase
<
double
>*
vec1
;
DOFVectorBase
<
double
>*
vec1
;
DOFVectorBase
<
double
>*
vec2
;
DOFVectorBase
<
double
>*
vec2
;
/// Function for c.
AbstractFunction
<
double
,
double
>
*
f1
;
AbstractFunction
<
double
,
double
>
*
f2
;
/// Constant factor of zero order term.
/// Constant factor of zero order term.
double
factor
;
double
factor
;
...
@@ -183,10 +188,6 @@ namespace AMDiS {
...
@@ -183,10 +188,6 @@ namespace AMDiS {
/// Vector v at quadrature points.
/// Vector v at quadrature points.
mtl
::
dense_vector
<
double
>
vecAtQPs1
;
mtl
::
dense_vector
<
double
>
vecAtQPs1
;
mtl
::
dense_vector
<
double
>
vecAtQPs2
;
mtl
::
dense_vector
<
double
>
vecAtQPs2
;
/// Function for c.
AbstractFunction
<
double
,
double
>
*
f1
;
AbstractFunction
<
double
,
double
>
*
f2
;
};
};
...
@@ -232,6 +233,9 @@ namespace AMDiS {
...
@@ -232,6 +233,9 @@ namespace AMDiS {
DOFVectorBase
<
double
>*
vec1
;
DOFVectorBase
<
double
>*
vec1
;
/// Second DOFVector to be evaluated at quadrature points.
/// Second DOFVector to be evaluated at quadrature points.
DOFVectorBase
<
double
>*
vec2
;
DOFVectorBase
<
double
>*
vec2
;
/// Function for c.
BinaryAbstractFunction
<
double
,
double
,
double
>
*
f
;
/// Constant factor of zero order term.
/// Constant factor of zero order term.
double
factor
;
double
factor
;
...
@@ -240,9 +244,6 @@ namespace AMDiS {
...
@@ -240,9 +244,6 @@ namespace AMDiS {
mtl
::
dense_vector
<
double
>
vecAtQPs1
;
mtl
::
dense_vector
<
double
>
vecAtQPs1
;
/// Values of the second DOFVector at the quadrature points.
/// Values of the second DOFVector at the quadrature points.
mtl
::
dense_vector
<
double
>
vecAtQPs2
;
mtl
::
dense_vector
<
double
>
vecAtQPs2
;
/// Function for c.
BinaryAbstractFunction
<
double
,
double
,
double
>
*
f
;
};
};
...
@@ -281,15 +282,15 @@ namespace AMDiS {
...
@@ -281,15 +282,15 @@ namespace AMDiS {
protected:
protected:
/// DOFVectors to be evaluated at quadrature points.
/// DOFVectors to be evaluated at quadrature points.
DOFVectorBase
<
double
>
*
vec1
,
*
vec2
,
*
vec3
;
DOFVectorBase
<
double
>
*
vec1
,
*
vec2
,
*
vec3
;
/// Function for c.
TertiaryAbstractFunction
<
double
,
double
,
double
,
double
>
*
f
;
/// Constant factor of zero order term.
/// Constant factor of zero order term.
double
factor
;
double
factor
;
/// Vectors at quadrature points.
/// Vectors at quadrature points.
mtl
::
dense_vector
<
double
>
vecAtQPs1
,
vecAtQPs2
,
vecAtQPs3
;
mtl
::
dense_vector
<
double
>
vecAtQPs1
,
vecAtQPs2
,
vecAtQPs3
;
/// Function for c.
TertiaryAbstractFunction
<
double
,
double
,
double
,
double
>
*
f
;
};
};
...
...
AMDiS/src/parallel/CheckerPartitioner.cc
View file @
80ce300b
...
@@ -68,15 +68,17 @@ namespace AMDiS { namespace Parallel {
...
@@ -68,15 +68,17 @@ namespace AMDiS { namespace Parallel {
elInfo
=
stack
.
traverseNext
(
elInfo
);
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
}
if
(
mesh
->
getDim
()
==
2
)
if
(
mesh
->
getDim
()
==
2
)
{
TEST_EXIT
(
elCounter
==
2
*
mpiSize
*
mpiSize
)
TEST_EXIT
(
elCounter
==
2
*
mpiSize
*
mpiSize
)
(
"The number of macro elements is %d, but must be %d for %d number of nodes!"
,
(
"The number of macro elements is %d, but must be %d for %d number of nodes!"
,
elCounter
,
2
*
mpiSize
*
mpiSize
,
mpiSize
);
elCounter
,
2
*
mpiSize
*
mpiSize
,
mpiSize
);
}
if
(
mesh
->
getDim
()
==
3
)
if
(
mesh
->
getDim
()
==
3
)
{
TEST_EXIT
(
elCounter
==
6
*
static_cast
<
int
>
(
pow
(
mpiSize
,
1.5
)))
TEST_EXIT
(
elCounter
==
6
*
static_cast
<
int
>
(
pow
(
mpiSize
,
1.5
)))
(
"The number of macro elements is %d, but must be %d for %d number of nodes!"
,
(
"The number of macro elements is %d, but must be %d for %d number of nodes!"
,
elCounter
,
6
*
static_cast
<
int
>
(
pow
(
mpiSize
,
1.5
)),
mpiSize
);
elCounter
,
6
*
static_cast
<
int
>
(
pow
(
mpiSize
,
1.5
)),
mpiSize
);
}
}
}
...
@@ -225,8 +227,8 @@ namespace AMDiS { namespace Parallel {
...
@@ -225,8 +227,8 @@ namespace AMDiS { namespace Parallel {
while
(
elInfo
)
{
while
(
elInfo
)
{
TEST_EXIT
(
elInfo
->
getLevel
()
==
0
)(
"Should not happen!
\n
"
);
TEST_EXIT
(
elInfo
->
getLevel
()
==
0
)(
"Should not happen!
\n
"
);
Element
*
el
=
elInfo
->
getElement
();
//
Element *el = elInfo->getElement();
int
elIndex
=
el
->
getIndex
();
//
int elIndex = el->getIndex();
int
zeroCoordCounter
=
0
;
int
zeroCoordCounter
=
0
;
for
(
int
i
=
0
;
i
<
mesh
->
getGeo
(
VERTEX
);
i
++
)
for
(
int
i
=
0
;
i
<
mesh
->
getGeo
(
VERTEX
);
i
++
)
...
@@ -252,7 +254,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -252,7 +254,7 @@ namespace AMDiS { namespace Parallel {
mpiSize
,
stripes
.
size
());
mpiSize
,
stripes
.
size
());
int
testElementCounter
=
0
;
int
testElementCounter
=
0
;
for
(
in
t
stripe
=
0
;
stripe
<
stripes
.
size
();
stripe
++
)
{
for
(
size_
t
stripe
=
0
;
stripe
<
stripes
.
size
();
stripe
++
)
{
MacroElement
*
mel
=
stripes
[
stripe
][
0
];
MacroElement
*
mel
=
stripes
[
stripe
][
0
];
set
<
int
>
localDofs
;
set
<
int
>
localDofs
;
...
@@ -321,8 +323,8 @@ namespace AMDiS { namespace Parallel {
...
@@ -321,8 +323,8 @@ namespace AMDiS { namespace Parallel {
TEST_EXIT
(
testElementCounter
==
nElements
)(
"Should not happen!
\n
"
);
TEST_EXIT
(
testElementCounter
==
nElements
)(
"Should not happen!
\n
"
);
in
t
elsPerStripe
=
stripes
[
0
].
size
();
size_
t
elsPerStripe
=
stripes
[
0
].
size
();
for
(
in
t
i
=
0
;
i
<
stripes
.
size
();
i
++
)
{
for
(
size_
t
i
=
0
;
i
<
stripes
.
size
();
i
++
)
{
TEST_EXIT
(
stripes
[
i
].
size
()
==
elsPerStripe
)
TEST_EXIT
(
stripes
[
i
].
size
()
==
elsPerStripe
)
(
"Should not happen!
\n
"
);
(
"Should not happen!
\n
"
);
}
}
...
@@ -330,18 +332,18 @@ namespace AMDiS { namespace Parallel {
...
@@ -330,18 +332,18 @@ namespace AMDiS { namespace Parallel {
// === Computing mapping from macro element indices to ranks ===
// === Computing mapping from macro element indices to ranks ===
in
t
nStripes
=
elInStripe
.
size
();
size_
t
nStripes
=
elInStripe
.
size
();
in
t
procPerStripe
=
mpiSize
/
nStripes
;
size_
t
procPerStripe
=
mpiSize
/
nStripes
;
in
t
elsPerRank
=
elsPerStripe
/
procPerStripe
;
size_
t
elsPerRank
=
elsPerStripe
/
procPerStripe
;
TEST_EXIT
(
mpiSize
%
nStripes
==
0
)(
"Should not happen!
\n
"
);
TEST_EXIT
(
mpiSize
%
nStripes
==
0
)(
"Should not happen!
\n
"
);
TEST_EXIT
(
elsPerStripe
%
procPerStripe
==
0
)(
"Should not happen!
\n
"
);
TEST_EXIT
(
elsPerStripe
%
procPerStripe
==
0
)(
"Should not happen!
\n
"
);
elStripeInRank
.
clear
();
elStripeInRank
.
clear
();
int
rankCount
=
0
;
int
rankCount
=
0
;
for
(
in
t
i
=
0
;
i
<
nStripes
;
i
++
)
{
for
(
size_
t
i
=
0
;
i
<
nStripes
;
i
++
)
{
for
(
in
t
j
=
0
;
j
<
procPerStripe
;
j
++
)
{
for
(
size_
t
j
=
0
;
j
<
procPerStripe
;
j
++
)
{
for
(
in
t
k
=
0
;
k
<
elsPerRank
;
k
++
)
for
(
size_
t
k
=
0
;
k
<
elsPerRank
;
k
++
)
elStripeInRank
[
elInStripe
[
i
][
j
*
elsPerRank
+
k
]]
=
rankCount
;
elStripeInRank
[
elInStripe
[
i
][
j
*
elsPerRank
+
k
]]
=
rankCount
;
rankCount
++
;
rankCount
++
;
}
}
...
...
AMDiS/src/parallel/DofComm.cc
View file @
80ce300b
...
@@ -105,14 +105,18 @@ namespace AMDiS { namespace Parallel {
...
@@ -105,14 +105,18 @@ namespace AMDiS { namespace Parallel {
DofContainerSet
dofSet
;
DofContainerSet
dofSet
;
DofContainer
dofVec
;
DofContainer
dofVec
;
for
(
DataIter
rankIt
=
data
.
begin
();
rankIt
!=
data
.
end
();
++
rankIt
)
for
(
DataIter
rankIt
=
data
.
begin
();
rankIt
!=
data
.
end
();
++
rankIt
)
{
for
(
FeMapIter
feIt
=
rankIt
->
second
.
begin
();
for
(
FeMapIter
feIt
=
rankIt
->
second
.
begin
();
feIt
!=
rankIt
->
second
.
end
();
++
feIt
)
feIt
!=
rankIt
->
second
.
end
();
++
feIt
)
{
if
(
feIt
->
first
==
feSpace
)
if
(
feIt
->
first
==
feSpace
)
{
if
(
countDouble
)
if
(
countDouble
)
{
dofVec
.
insert
(
dofVec
.
end
(),
feIt
->
second
.
begin
(),
feIt
->
second
.
end
());
dofVec
.
insert
(
dofVec
.
end
(),
feIt
->
second
.
begin
(),
feIt
->
second
.
end
());
else
}
else
{
dofSet
.
insert
(
feIt
->
second
.
begin
(),
feIt
->
second
.
end
());
dofSet
.
insert
(
feIt
->
second
.
begin
(),
feIt
->
second
.
end
());
}
}
}
}
if
(
countDouble
)
if
(
countDouble
)
return
static_cast
<
int
>
(
dofVec
.
size
());
return
static_cast
<
int
>
(
dofVec
.
size
());
...
...
AMDiS/src/parallel/ElementObjectDatabase.cc
View file @
80ce300b
...
@@ -703,9 +703,11 @@ namespace AMDiS { namespace Parallel {
...
@@ -703,9 +703,11 @@ namespace AMDiS { namespace Parallel {
case
FACE
:
case
FACE
:
return
getOwner
(
faceElements
[
faceIter
->
first
],
level
);
return
getOwner
(
faceElements
[
faceIter
->
first
],
level
);
break
;
break
;
default:
ERROR_EXIT
(
"There is something reallllly wrong!
\n
"
);
return
-
1
;
}
}
ERROR_EXIT
(
"There is something reallllly wrong!
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -1134,7 +1136,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -1134,7 +1136,7 @@ namespace AMDiS { namespace Parallel {
const
unsigned
int
vectorOverhead
=
sizeof
(
vector
<
int
>
);
const
unsigned
int
vectorOverhead
=
sizeof
(
vector
<
int
>
);
const
unsigned
int
mapOverhead
=
48
;
//sizeof(_Rb_tree<int, int>);
const
unsigned
int
mapOverhead
=
48
;
//sizeof(_Rb_tree<int, int>);
const
unsigned
int
flatMapOverhead
=
24
;
const
unsigned
int
flatMapOverhead
=
24
;
const
unsigned
int
mapEntryOverhead
=
40
;
// sizeof(_Rb_tree_node_base);
//
const unsigned int mapEntryOverhead = 40; // sizeof(_Rb_tree_node_base);
const
unsigned
int
setOverhead
=
48
;
const
unsigned
int
setOverhead
=
48
;
const
unsigned
int
setEntryOverhead
=
40
;
const
unsigned
int
setEntryOverhead
=
40
;
...
...
AMDiS/src/parallel/InteriorBoundary.cc
View file @
80ce300b
...
@@ -52,7 +52,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -52,7 +52,7 @@ namespace AMDiS { namespace Parallel {
if
(
mpiComm
==
MPI
::
COMM_SELF
)
if
(
mpiComm
==
MPI
::
COMM_SELF
)
return
;
return
;
int
levelMpiRank
=
mpiComm
.
Get_rank
();
//
int levelMpiRank = mpiComm.Get_rank();
int
globalMpiRank
=
MPI
::
COMM_WORLD
.
Get_rank
();
int
globalMpiRank
=
MPI
::
COMM_WORLD
.
Get_rank
();
std
::
set
<
int
>
levelRanks
=
levelData
.
getLevelRanks
(
level
);
std
::
set
<
int
>
levelRanks
=
levelData
.
getLevelRanks
(
level
);
...
...
AMDiS/src/parallel/MatrixNnzStructure.cc
View file @
80ce300b
...
@@ -72,7 +72,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -72,7 +72,7 @@ namespace AMDiS { namespace Parallel {
typedef
traits
::
range_generator
<
nz
,
cursor_type
>::
type
icursor_type
;
typedef
traits
::
range_generator
<
nz
,
cursor_type
>::
type
icursor_type
;
typedef
vector
<
pair
<
int
,
int
>
>
MatrixNnzEntry
;
typedef
vector
<
pair
<
int
,
int
>
>
MatrixNnzEntry
;
typedef
map
<
int
,
DofContainer
>
RankToDofContainer
;
//
typedef map<int, DofContainer> RankToDofContainer;
// Stores to each rank a list of nnz entries (i.e. pairs of row and column
// Stores to each rank a list of nnz entries (i.e. pairs of row and column
// index) that this rank will send to. These nnz entries will be assembled
// index) that this rank will send to. These nnz entries will be assembled
...
@@ -229,7 +229,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -229,7 +229,7 @@ namespace AMDiS { namespace Parallel {
vector
<
int
>
newCols
;
vector
<
int
>
newCols
;
perMap
->
mapDof
(
colFeSpace
,
colDofIndex
.
global
,
perColAsc
,
newCols
);
perMap
->
mapDof
(
colFeSpace
,
colDofIndex
.
global
,
perColAsc
,
newCols
);
for
(
in
t
aa
=
0
;
aa
<
newCols
.
size
();
aa
++
)
{
for
(
size_
t
aa
=
0
;
aa
<
newCols
.
size
();
aa
++
)
{
int
petscColIdx
=
colDofMap
.
getMatIndex
(
colComp
,
newCols
[
aa
]);
int
petscColIdx
=
colDofMap
.
getMatIndex
(
colComp
,
newCols
[
aa
]);
// The row DOF is a rank DOF, if also the column is a rank DOF,
// The row DOF is a rank DOF, if also the column is a rank DOF,
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
80ce300b
...
@@ -445,7 +445,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -445,7 +445,7 @@ namespace AMDiS { namespace Parallel {
map
<
int
,
int
>
arhElInRank
;
map
<
int
,
int
>
arhElInRank
;
map
<
int
,
int
>
arhElCodeSize
;
map
<
int
,
int
>
arhElCodeSize
;
int
nProc
=
ArhReader
::
readMetaData
(
filename
,
arhElInRank
,
arhElCodeSize
);
/*
int nProc =
*/
ArhReader
::
readMetaData
(
filename
,
arhElInRank
,
arhElCodeSize
);
for
(
map
<
int
,
int
>::
iterator
it
=
arhElCodeSize
.
begin
();
for
(
map
<
int
,
int
>::
iterator
it
=
arhElCodeSize
.
begin
();
it
!=
arhElCodeSize
.
end
();
++
it
)
it
!=
arhElCodeSize
.
end
();
++
it
)
elemWeights
[
it
->
first
]
=
it
->
second
;
elemWeights
[
it
->
first
]
=
it
->
second
;
...
@@ -1117,7 +1117,9 @@ namespace AMDiS { namespace Parallel {
...
@@ -1117,7 +1117,9 @@ namespace AMDiS { namespace Parallel {
bool
meshChanged
=
false
;
bool
meshChanged
=
false
;
// === Check the boundaries and adapt mesh if necessary. ===
// === Check the boundaries and adapt mesh if necessary. ===
MSG_DBG
(
"Run checkAndAdaptBoundary ...
\n
"
);
#if (DEBUG != 0)
MSG
(
"Run checkAndAdaptBoundary ...
\n
"
);
#endif
// Check for periodic boundaries within rank's subdomain.
// Check for periodic boundaries within rank's subdomain.
for
(
InteriorBoundary
::
iterator
it
(
intBoundary
[
0
].
getPeriodic
());
for
(
InteriorBoundary
::
iterator
it
(
intBoundary
[
0
].
getPeriodic
());
...
@@ -1170,7 +1172,9 @@ namespace AMDiS { namespace Parallel {
...
@@ -1170,7 +1172,9 @@ namespace AMDiS { namespace Parallel {
if
(
repartitioningFailed
>
0
)
{
if
(
repartitioningFailed
>
0
)
{
MSG_DBG
(
"Repartitioning not tried because it has failed in the past!
\n
"
);
#if (DEBUG != 0)
MSG
(
"Repartitioning not tried because it has failed in the past!
\n
"
);
#endif
repartitioningFailed
--
;
repartitioningFailed
--
;
}
else
if
(
tryRepartition
&&
}
else
if
(
tryRepartition
&&
...
...
AMDiS/src/parallel/MeshManipulation.cc
View file @
80ce300b
...
@@ -315,8 +315,10 @@ namespace AMDiS { namespace Parallel {
...
@@ -315,8 +315,10 @@ namespace AMDiS { namespace Parallel {
// Create traverse stack and traverse within the mesh until the element,
// Create traverse stack and traverse within the mesh until the element,
// which should be fitted to the mesh structure code, is reached.
// which should be fitted to the mesh structure code, is reached.
TraverseStack
stack
;
TraverseStack
stack
;
#if (DEBUG != 0)
ElInfo
*
elInfo
=
ElInfo
*
elInfo
=
stack
.
traverseFirstOneMacro
(
mesh
,
boundEl
.
elIndex
,
-
1
,
traverseFlag
);
stack
.
traverseFirstOneMacro
(
mesh
,
boundEl
.
elIndex
,
-
1
,
traverseFlag
);
#endif
TEST_EXIT_DBG
(
elInfo
->
getElement
()
==
boundEl
.
el
)
TEST_EXIT_DBG
(
elInfo
->
getElement
()
==
boundEl
.
el
)
(
"This should not happen!
\n
"
);
(
"This should not happen!
\n
"
);
...
...
AMDiS/src/parallel/ParMetisPartitioner.cc
View file @
80ce300b
...
@@ -307,7 +307,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -307,7 +307,7 @@ namespace AMDiS { namespace Parallel {
for
(
int
i
=
0
;
i
<
mpiSize
;
i
++
)
for
(
int
i
=
0
;
i
<
mpiSize
;
i
++
)
tpwgts
[
i
]
=
1.0
/
static_cast
<
double
>
(
nparts
);
tpwgts
[
i
]
=
1.0
/
static_cast
<
double
>
(
nparts
);
float
scale
=
10000.0
/
maxWgt
;
//
float scale = 10000.0 / maxWgt;
for
(
int
i
=
0
;
i
<
nElements
;
i
++
)
for
(
int
i
=
0
;
i
<
nElements
;
i
++
)
wgts
[
i
]
=
floatWgts
[
i
];
wgts
[
i
]
=
floatWgts
[
i
];
// wgts[i] = static_cast<int>(floatWgts[i] * scale);
// wgts[i] = static_cast<int>(floatWgts[i] * scale);
...
...
AMDiS/src/parallel/ParallelCoarseSpaceSolver.cc
View file @
80ce300b
...
@@ -29,11 +29,11 @@ namespace AMDiS { namespace Parallel {
...
@@ -29,11 +29,11 @@ namespace AMDiS { namespace Parallel {
ParallelCoarseSpaceSolver
::
ParallelCoarseSpaceSolver
(
string
name
)
ParallelCoarseSpaceSolver
::
ParallelCoarseSpaceSolver
(
string
name
)
:
ParallelSolver
(
name
,
true
),
:
ParallelSolver
(
name
,
true
),
initFileStr
(
name
),
lastMeshNnz
(
-
1
),
lastMeshNnz
(
-
1
),
alwaysCreateNnzStructure
(
false
),
alwaysCreateNnzStructure
(
false
),
rStartInterior
(
0
),
rStartInterior
(
0
),
nGlobalOverallInterior
(
0
)
nGlobalOverallInterior
(
0
),
initFileStr
(
name
)
{
{
Parameters
::
get
(
"parallel->always create nnz structure"
,
Parameters
::
get
(
"parallel->always create nnz structure"
,
alwaysCreateNnzStructure
);
alwaysCreateNnzStructure
);
...
...
AMDiS/src/parallel/ParallelDebug.cc
View file @
80ce300b
...
@@ -45,7 +45,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -45,7 +45,7 @@ namespace AMDiS { namespace Parallel {
MPI
::
Intracomm
&
mpiComm
=
pdb
.
levelData
.
getMpiComm
(
0
);
MPI
::
Intracomm
&
mpiComm
=
pdb
.
levelData
.
getMpiComm
(
0
);
int
mpiRank
=
mpiComm
.
Get_rank
();
int
mpiRank
=
mpiComm
.
Get_rank
();
MPI
::
Request
r
equest
[
pdb
.
intBoundary
[
0
].
own
.
size
()
+
MPI
::
Request
*
request
=
new
MPI
::
R
equest
[
pdb
.
intBoundary
[
0
].
own
.
size
()
+
pdb
.
intBoundary
[
0
].
other
.
size
()
+
pdb
.
intBoundary
[
0
].
other
.
size
()
+
pdb
.
intBoundary
[
0
].
periodic
.
size
()
*
2
];
pdb
.
intBoundary
[
0
].
periodic
.
size
()
*
2
];
int
requestCounter
=
0
;
int
requestCounter
=
0
;
...
@@ -152,6 +152,8 @@ namespace AMDiS { namespace Parallel {
...
@@ -152,6 +152,8 @@ namespace AMDiS { namespace Parallel {
delete
[]
recvBuffers
[
bufCounter
++
];
delete
[]
recvBuffers
[
bufCounter
++
];
}
}
delete
[]
request
;
}
}
...
@@ -179,7 +181,6 @@ namespace AMDiS { namespace Parallel {
...
@@ -179,7 +181,6 @@ namespace AMDiS { namespace Parallel {
it
!=
perMap
.
periodicDofAssociations
[
feSpace
].
end
();
++
it
)
{
it
!=
perMap
.
periodicDofAssociations
[
feSpace
].
end
();
++
it
)
{
WorldVector
<
double
>
c
;
WorldVector
<
double
>
c
;
pdb
.
mesh
->
getDofIndexCoords
(
it
->
first
,
pdb
.
feSpaces
[
0
],
c
);
pdb
.
mesh
->
getDofIndexCoords
(
it
->
first
,
pdb
.
feSpaces
[
0
],
c
);
int
nAssoc
=
it
->
second
.
size
();
}
}
...
@@ -366,12 +367,12 @@ namespace AMDiS { namespace Parallel {
...
@@ -366,12 +367,12 @@ namespace AMDiS { namespace Parallel {
int
mpiSize
=
mpiComm
.
Get_size
();
int
mpiSize
=
mpiComm
.
Get_size
();
std
::
set
<
int
>
&
ranks
=
pdb
.
levelData
.
getLevelRanks
(
level
);
std
::
set
<
int
>
&
ranks
=
pdb
.
levelData
.
getLevelRanks
(
level
);
TEST_EXIT
(
mpiSize
==
ranks
.
size
())
TEST_EXIT
(
mpiSize
==
static_cast
<
int
>
(
ranks
.
size
())
)
(
"Wrong mpi sizes: Get_size() = %d ranks.size() = %d
\n
"
,
(
"Wrong mpi sizes: Get_size() = %d ranks.size() = %d
\n
"
,
mpiSize
,
ranks
.
size
());
mpiSize
,
ranks
.
size
());
/// Defines a mapping type from rank numbers to sets of DOFs.
/// Defines a mapping type from rank numbers to sets of DOFs.
typedef
map
<
int
,
DofContainer
>
RankToDofContainer
;
//
typedef map<int, DofContainer> RankToDofContainer;
// Maps to each neighbour rank an array of WorldVectors. This array contains the
// Maps to each neighbour rank an array of WorldVectors. This array contains the
// coordinates of all DOFs this rank shares on the interior boundary with the
// coordinates of all DOFs this rank shares on the interior boundary with the
...
@@ -400,7 +401,7 @@ namespace AMDiS { namespace Parallel {
...
@@ -400,7 +401,7 @@ namespace AMDiS { namespace Parallel {
map
<
int
,
int
>
sendSize
;
map
<
int
,
int
>
sendSize
;
map
<
int
,
int
>
recvSize
;
map
<
int
,
int
>
recvSize
;
map
<
int
,
int
>
recvSizeBuffer
;
map
<
int
,
int
>
recvSizeBuffer
;
MPI
::
Request
r
equest
[(
mpiSize
-
1
)
*
2
];
MPI
::
Request
*
request
=
new
MPI
::
R
equest
[(
mpiSize
-
1
)
*
2
];
int
requestCounter
=
0
;
int
requestCounter
=
0
;
for
(
RankToCoords
::
iterator
it
=
sendCoords
.
begin
();
it
!=
sendCoords
.
end
();
++
it
)
for
(
RankToCoords
::
iterator
it
=
sendCoords
.
begin
();
it
!=
sendCoords
.
end
();
++
it
)
...
@@ -441,6 +442,8 @@ namespace AMDiS { namespace Parallel {
...
@@ -441,6 +442,8 @@ namespace AMDiS { namespace Parallel {
mpi
::
globalAdd
(
foundError
);
mpi
::
globalAdd
(
foundError
);
TEST_EXIT
(
foundError
==
0
)(
"Error found on at least on rank!
\n
"
);
TEST_EXIT
(
foundError
==
0
)(
"Error found on at least on rank!
\n
"
);
delete
[]
request
;
// === Now we know that the number of send and received DOFs fits together. ===
// === Now we know that the number of send and received DOFs fits together. ===
// === So we can check if also the coordinates of the communicated DOFs are ===
// === So we can check if also the coordinates of the communicated DOFs are ===
// === the same on both corresponding ranks. ===
// === the same on both corresponding ranks. ===
...
@@ -514,8 +517,8 @@ namespace AMDiS { namespace Parallel {
...
@@ -514,8 +517,8 @@ namespace AMDiS { namespace Parallel {
if
(
mpiComm
==
MPI
::
COMM_SELF
)
if
(
mpiComm
==
MPI
::
COMM_SELF
)
continue
;
continue
;
int
mpiRank
=
mpiComm
.
Get_rank
();
//
int mpiRank = mpiComm.Get_rank();
int
mpiSize
=
mpiComm
.
Get_size
();
//
int mpiSize = mpiCo