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
8cce62bb
Commit
8cce62bb
authored
Apr 13, 2012
by
Thomas Witkowski
Browse files
Just some small changes.
parent
bb1e643b
Changes
5
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/AMDiS.cc
View file @
8cce62bb
...
...
@@ -24,7 +24,7 @@ namespace AMDiS {
mtl
::
par
::
environment
*
mtl_environment
=
NULL
;
#endif
void
init
(
int
argc
,
char
**
argv
)
void
init
(
int
argc
,
char
**
argv
,
std
::
string
initFileName
)
{
FUNCNAME
(
"AMDiS::init()"
);
...
...
@@ -42,9 +42,13 @@ namespace AMDiS {
#endif
#endif
TEST_EXIT
(
argc
>=
2
)(
"No init file!
\n
"
);
if
(
initFileName
==
""
)
{
TEST_EXIT
(
argc
>=
2
)(
"No init file!
\n
"
);
Parameters
::
init
(
string
(
argv
[
1
]));
}
else
{
Parameters
::
init
(
initFileName
);
}
Parameters
::
init
(
string
(
argv
[
1
]));
Parameters
::
readArgv
(
argc
,
argv
);
}
...
...
AMDiS/src/AMDiS.h
View file @
8cce62bb
...
...
@@ -153,8 +153,8 @@
namespace
AMDiS
{
void
init
(
int
argc
,
char
**
argv
);
void
init
(
int
argc
,
char
**
argv
,
std
::
string
initFileName
=
""
);
void
init
(
std
::
string
initFileName
);
void
finalize
();
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
8cce62bb
...
...
@@ -451,7 +451,12 @@ namespace AMDiS {
/// Adds a stationary problem to the global mesh distributor objects.
static
void
addProblemStatGlobal
(
ProblemStatSeq
*
probStat
);
MeshLevelData
&
getMeshLevelData
()
{
return
levelData
;
}
protected:
void
addProblemStat
(
ProblemStatSeq
*
probStat
);
...
...
AMDiS/src/parallel/MeshLevelData.cc
View file @
8cce62bb
...
...
@@ -10,6 +10,7 @@
// See also license.opensource.txt in the distribution.
#include
<boost/lexical_cast.hpp>
#include
"parallel/MeshLevelData.h"
#include
"Global.h"
...
...
@@ -24,8 +25,8 @@ namespace AMDiS {
levelRanks
[
0
].
insert
(
-
1
);
nLevel
=
1
;
levelNeighbour
.
resize
(
1
);
levelNeighbour
[
0
]
=
neighbourRanks
;
levelNeighbour
s
.
resize
(
1
);
levelNeighbour
s
[
0
]
=
neighbourRanks
;
}
...
...
@@ -39,13 +40,13 @@ namespace AMDiS {
levelRanks
.
insert
(
levelRanks
.
begin
(),
ranksInDomain
);
nLevel
++
;
levelNeighbour
.
resize
(
2
);
levelNeighbour
[
1
]
=
levelNeighbour
[
0
];
levelNeighbour
[
0
].
clear
();
for
(
std
::
set
<
int
>::
iterator
it
=
levelNeighbour
[
1
].
begin
();
it
!=
levelNeighbour
[
1
].
end
();
++
it
)
levelNeighbour
s
.
resize
(
2
);
levelNeighbour
s
[
1
]
=
levelNeighbour
s
[
0
];
levelNeighbour
s
[
0
].
clear
();
for
(
std
::
set
<
int
>::
iterator
it
=
levelNeighbour
s
[
1
].
begin
();
it
!=
levelNeighbour
s
[
1
].
end
();
++
it
)
if
(
levelRanks
[
0
].
count
(
*
it
)
==
0
)
levelNeighbour
[
0
].
insert
(
*
it
);
levelNeighbour
s
[
0
].
insert
(
*
it
);
}
...
...
@@ -58,4 +59,35 @@ namespace AMDiS {
{
}
void
MeshLevelData
::
print
()
{
FUNCNAME
(
"MeshLevelData::print()"
);
using
boost
::
lexical_cast
;
MSG
(
"Print mesh level structure with %d levels:
\n
"
,
nLevel
);
for
(
int
i
=
0
;
i
<
nLevel
;
i
++
)
{
string
ranks
=
"ranks in level "
+
lexical_cast
<
string
>
(
i
)
+
":"
;
for
(
std
::
set
<
int
>::
iterator
it
=
levelRanks
[
i
].
begin
();
it
!=
levelRanks
[
i
].
end
();
++
it
)
ranks
+=
" "
+
lexical_cast
<
string
>
(
*
it
);
string
neighbours
=
"neighbours in level "
+
lexical_cast
<
string
>
(
i
)
+
": "
;
for
(
std
::
set
<
int
>::
iterator
it
=
levelNeighbours
[
i
].
begin
();
it
!=
levelNeighbours
[
i
].
end
();
++
it
)
neighbours
+=
" "
+
lexical_cast
<
string
>
(
*
it
);
if
(
ranks
.
length
()
<
250
)
MSG
(
" %s
\n
"
,
ranks
.
c_str
());
else
MSG
(
" ranks string to long!
\n
"
);
if
(
neighbours
.
length
()
<
250
)
MSG
(
"%s
\n
"
,
neighbours
.
c_str
());
else
MSG
(
" neighbours string to long!
\n
"
);
}
}
}
AMDiS/src/parallel/MeshLevelData.h
View file @
8cce62bb
...
...
@@ -27,6 +27,7 @@
#include
<iostream>
#include
<set>
#include
<vector>
#include
"Global.h"
namespace
AMDiS
{
...
...
@@ -49,12 +50,28 @@ namespace AMDiS {
// Reads the object data from an input stream.
void
deserialize
(
istream
&
in
);
void
print
();
std
::
set
<
int
>&
getLevelRanks
(
int
level
)
{
TEST_EXIT_DBG
(
level
<
nLevel
)(
"Should not happen!
\n
"
);
return
levelRanks
[
level
];
}
std
::
set
<
int
>&
getLevelNeighbours
(
int
level
)
{
TEST_EXIT_DBG
(
level
<
nLevel
)(
"Should not happen!
\n
"
);
return
levelNeighbours
[
level
];
}
protected:
vector
<
std
::
set
<
int
>
>
levelRanks
;
int
nLevel
;
vector
<
std
::
set
<
int
>
>
levelNeighbour
;
vector
<
std
::
set
<
int
>
>
levelNeighbour
s
;
};
}
...
...
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