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
b115e944
Commit
b115e944
authored
Feb 08, 2012
by
Thomas Witkowski
Browse files
Small changes and code refactoring in parallel AMDiS.
parent
a71cce06
Changes
7
Show whitespace changes
Inline
Side-by-side
AMDiS/src/MeshStructure.cc
View file @
b115e944
...
@@ -137,14 +137,18 @@ namespace AMDiS {
...
@@ -137,14 +137,18 @@ namespace AMDiS {
if
(
!
reverseOrder
)
{
if
(
!
reverseOrder
)
{
if
(
s1
!=
-
1
)
if
(
s1
!=
-
1
)
addAlongSide
(
el
->
getFirstChild
(),
subObj
,
s1
,
el
->
getChildType
(
elType
),
reverseOrder
);
addAlongSide
(
el
->
getFirstChild
(),
subObj
,
s1
,
el
->
getChildType
(
elType
),
reverseOrder
);
if
(
s2
!=
-
1
)
if
(
s2
!=
-
1
)
addAlongSide
(
el
->
getSecondChild
(),
subObj
,
s2
,
el
->
getChildType
(
elType
),
reverseOrder
);
addAlongSide
(
el
->
getSecondChild
(),
subObj
,
s2
,
el
->
getChildType
(
elType
),
reverseOrder
);
}
else
{
}
else
{
if
(
s2
!=
-
1
)
if
(
s2
!=
-
1
)
addAlongSide
(
el
->
getSecondChild
(),
subObj
,
s2
,
el
->
getChildType
(
elType
),
reverseOrder
);
addAlongSide
(
el
->
getSecondChild
(),
subObj
,
s2
,
el
->
getChildType
(
elType
),
reverseOrder
);
if
(
s1
!=
-
1
)
if
(
s1
!=
-
1
)
addAlongSide
(
el
->
getFirstChild
(),
subObj
,
s1
,
el
->
getChildType
(
elType
),
reverseOrder
);
addAlongSide
(
el
->
getFirstChild
(),
subObj
,
s1
,
el
->
getChildType
(
elType
),
reverseOrder
);
}
}
}
}
}
}
...
...
AMDiS/src/MeshStructure.h
View file @
b115e944
...
@@ -66,10 +66,8 @@ namespace AMDiS {
...
@@ -66,10 +66,8 @@ namespace AMDiS {
reset
();
reset
();
}
}
/** \brief
/// Sets all position counters, that are used to traverse the code, to the
* Sets all position counters, that are used to traverse the code, to the starting
/// starting position. The code itself is not changed.
* position. The code itself is not changed.
*/
void
reset
();
void
reset
();
/// Returns whether the code is empty or not.
/// Returns whether the code is empty or not.
...
...
AMDiS/src/io/ArhReader.cc
View file @
b115e944
...
@@ -51,7 +51,6 @@ namespace AMDiS {
...
@@ -51,7 +51,6 @@ namespace AMDiS {
{
{
FUNCNAME
(
"ArhReader::read()"
);
FUNCNAME
(
"ArhReader::read()"
);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if
(
writeParallel
)
{
if
(
writeParallel
)
{
using
boost
::
lexical_cast
;
using
boost
::
lexical_cast
;
int
sPos
=
filename
.
find
(
".arh"
);
int
sPos
=
filename
.
find
(
".arh"
);
...
@@ -59,8 +58,12 @@ namespace AMDiS {
...
@@ -59,8 +58,12 @@ namespace AMDiS {
string
name
=
filename
.
substr
(
0
,
sPos
);
string
name
=
filename
.
substr
(
0
,
sPos
);
if
(
nProcs
==
-
1
)
{
if
(
nProcs
==
-
1
)
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
string
procFilename
=
name
+
"-p"
+
lexical_cast
<
string
>
(
MPI
::
COMM_WORLD
.
Get_rank
())
+
"-.arh"
;
string
procFilename
=
name
+
"-p"
+
lexical_cast
<
string
>
(
MPI
::
COMM_WORLD
.
Get_rank
())
+
"-.arh"
;
readFile
(
procFilename
,
mesh
,
vecs
);
readFile
(
procFilename
,
mesh
,
vecs
);
#else
ERROR_EXIT
(
"Reading parallel ARH files in sequential computations requires to specify the number of nodes on which the ARH file was created!
\n
"
);
#endif
}
else
{
}
else
{
for
(
int
i
=
0
;
i
<
nProcs
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nProcs
;
i
++
)
{
string
procFilename
=
name
+
"-p"
+
lexical_cast
<
string
>
(
i
)
+
"-.arh"
;
string
procFilename
=
name
+
"-p"
+
lexical_cast
<
string
>
(
i
)
+
"-.arh"
;
...
@@ -70,10 +73,6 @@ namespace AMDiS {
...
@@ -70,10 +73,6 @@ namespace AMDiS {
}
else
{
}
else
{
readFile
(
filename
,
mesh
,
vecs
);
readFile
(
filename
,
mesh
,
vecs
);
}
}
#else
readFile
(
filename
,
mesh
,
vecs
);
#endif
MSG
(
"ARH file read from: %s
\n
"
,
filename
.
c_str
());
MSG
(
"ARH file read from: %s
\n
"
,
filename
.
c_str
());
}
}
...
...
AMDiS/src/parallel/DofComm.cc
View file @
b115e944
...
@@ -18,7 +18,8 @@ namespace AMDiS {
...
@@ -18,7 +18,8 @@ namespace AMDiS {
void
DofComm
::
removeEmpty
()
void
DofComm
::
removeEmpty
()
{
{
for
(
DataIter
dit
=
data
.
begin
();
dit
!=
data
.
end
();
++
dit
)
{
DataIter
dit
=
data
.
begin
();
while
(
dit
!=
data
.
end
())
{
FeMapIter
it
=
dit
->
second
.
begin
();
FeMapIter
it
=
dit
->
second
.
begin
();
while
(
it
!=
dit
->
second
.
end
())
{
while
(
it
!=
dit
->
second
.
end
())
{
if
(
it
->
second
.
size
()
==
0
)
{
if
(
it
->
second
.
size
()
==
0
)
{
...
@@ -28,6 +29,11 @@ namespace AMDiS {
...
@@ -28,6 +29,11 @@ namespace AMDiS {
}
else
}
else
++
it
;
++
it
;
}
}
if
(
dit
->
second
.
size
()
==
0
)
data
.
erase
(
dit
++
);
else
++
dit
;
}
}
}
}
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
b115e944
...
@@ -777,6 +777,9 @@ namespace AMDiS {
...
@@ -777,6 +777,9 @@ namespace AMDiS {
double
first
=
MPI
::
Wtime
();
double
first
=
MPI
::
Wtime
();
int
skip
=
0
;
Parameters
::
get
(
"parallel->debug->skip check mesh change"
,
skip
);
// === If mesh has not been changed on all ranks, return. ===
// === If mesh has not been changed on all ranks, return. ===
int
recvAllValues
=
0
;
int
recvAllValues
=
0
;
...
@@ -789,6 +792,7 @@ namespace AMDiS {
...
@@ -789,6 +792,7 @@ namespace AMDiS {
// === At least one rank mesh has been changed, so the boundaries must be ===
// === At least one rank mesh has been changed, so the boundaries must be ===
// === adapted to the new mesh structure. ===
// === adapted to the new mesh structure. ===
if
(
skip
==
0
)
do
{
do
{
bool
meshChanged
=
false
;
bool
meshChanged
=
false
;
...
...
AMDiS/src/parallel/ParallelDebug.cc
View file @
b115e944
...
@@ -785,7 +785,7 @@ namespace AMDiS {
...
@@ -785,7 +785,7 @@ namespace AMDiS {
{
{
FUNCNAME
(
"ParallelDebug::writeCoordsFile()"
);
FUNCNAME
(
"ParallelDebug::writeCoordsFile()"
);
const
FiniteElemSpace
*
feSpace
=
pdb
.
feSpaces
[
0
];
const
FiniteElemSpace
*
feSpace
=
pdb
.
feSpaces
[
pdb
.
feSpaces
.
size
()
-
1
];
stringstream
filename
;
stringstream
filename
;
filename
<<
prefix
<<
"-"
<<
pdb
.
mpiRank
<<
"."
<<
postfix
;
filename
<<
prefix
<<
"-"
<<
pdb
.
mpiRank
<<
"."
<<
postfix
;
...
...
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
View file @
b115e944
...
@@ -431,6 +431,7 @@ namespace AMDiS {
...
@@ -431,6 +431,7 @@ namespace AMDiS {
(
"Should not happen!
\n
"
);
(
"Should not happen!
\n
"
);
int
rowIndex
=
rowIt
->
first
;
int
rowIndex
=
rowIt
->
first
;
MatSetValues
(
petscMatrix
,
1
,
&
rowIndex
,
rowIt
->
second
.
size
(),
MatSetValues
(
petscMatrix
,
1
,
&
rowIndex
,
rowIt
->
second
.
size
(),
&
(
rowIt
->
second
[
0
]),
&
(
valsMap
[
rowIt
->
first
][
0
]),
ADD_VALUES
);
&
(
rowIt
->
second
[
0
]),
&
(
valsMap
[
rowIt
->
first
][
0
]),
ADD_VALUES
);
}
}
...
...
Write
Preview
Supports
Markdown
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