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
715b5139
Commit
715b5139
authored
Aug 04, 2008
by
Thomas Witkowski
Browse files
* Added ParallelProblem debug possibilities
parent
cd501be4
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
AMDiS/libtool
View file @
715b5139
...
...
@@ -30,10 +30,10 @@
# the same distribution terms that you use for the rest of that program.
# A sed program that does not truncate output.
SED
=
"/bin/sed"
SED
=
"/
usr/
bin/sed"
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
Xsed
=
"/bin/sed -e 1s/^X//"
Xsed
=
"/
usr/
bin/sed -e 1s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
...
...
@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host
NWRW15
:
# Libtool was configured on host
p2s103
:
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
...
...
@@ -66,12 +66,12 @@ fast_install=yes
# The host system.
host_alias
=
host
=
i686-redhat
-linux-gnu
host
=
x86_64-unknown
-linux-gnu
host_os
=
linux-gnu
# The build system.
build_alias
=
build
=
i686-redhat
-linux-gnu
build
=
x86_64-unknown
-linux-gnu
build_os
=
linux-gnu
# An echo program that does not interpret backslashes.
...
...
@@ -82,25 +82,25 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
g
cc"
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
# A language-specific compiler.
CC
=
"
g
cc"
CC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
# Is the compiler the GNU C compiler?
with_gcc
=
yes
gcc_dir
=
`
gcc
-print-file-name
=
.
| /bin/sed
's,/\.$,,'
`
gcc_dir
=
`
gcc
-print-file-name
=
.
|
/usr
/bin/sed
's,/\.$,,'
`
gcc_ver
=
`
gcc
-dumpversion
`
# An ERE matcher.
EGREP
=
"grep -E"
# The linker used to build libraries.
LD
=
"/usr/
bin/ld
"
LD
=
"/usr/
x86_64-suse-linux/bin/ld -m elf_x86_64
"
# Whether we need hard or soft links.
LN_S
=
"ln -s"
...
...
@@ -174,7 +174,7 @@ dlopen_self=unknown
dlopen_self_static
=
unknown
# Compiler flag to prevent dynamic linking.
link_static_flag
=
"
-static
"
link_static_flag
=
""
# Compiler flag to turn off builtin functions.
no_builtin_flag
=
" -fno-builtin"
...
...
@@ -328,10 +328,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
link_all_deplibs
=
unknown
# Compile-time system search path for libraries
sys_lib_search_path_spec
=
`
echo
"
/usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/
"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
sys_lib_search_path_spec
=
`
echo
"
/lib64 /usr/lib64 /usr/local/lib64
"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec
=
"/lib /usr/lib /usr/
lib/octave-
2.9.9 /
usr/lib/qt-3.3
/lib "
sys_lib_dlsearch_path_spec
=
"/lib
64
/usr/lib
64
/usr/
X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/
2.9.9
9
/
opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2
/lib
so
"
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path
=
""
...
...
@@ -7266,7 +7266,7 @@ disable_libs=static
# End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host
NWRW15
:
# Libtool was configured on host
p2s103
:
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
...
...
@@ -7288,12 +7288,12 @@ fast_install=yes
# The host system.
host_alias
=
host
=
i686-redhat
-linux-gnu
host
=
x86_64-unknown
-linux-gnu
host_os
=
linux-gnu
# The build system.
build_alias
=
build
=
i686-redhat
-linux-gnu
build
=
x86_64-unknown
-linux-gnu
build_os
=
linux-gnu
# An echo program that does not interpret backslashes.
...
...
@@ -7304,25 +7304,25 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
g
cc"
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
# A language-specific compiler.
CC
=
"
g++
"
CC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpiCC
"
# Is the compiler the GNU C compiler?
with_gcc
=
yes
gcc_dir
=
`
gcc
-print-file-name
=
.
| /bin/sed
's,/\.$,,'
`
gcc_dir
=
`
gcc
-print-file-name
=
.
|
/usr
/bin/sed
's,/\.$,,'
`
gcc_ver
=
`
gcc
-dumpversion
`
# An ERE matcher.
EGREP
=
"grep -E"
# The linker used to build libraries.
LD
=
"/usr/
bin/ld
"
LD
=
"/usr/
x86_64-suse-linux/bin/ld -m elf_x86_64
"
# Whether we need hard or soft links.
LN_S
=
"ln -s"
...
...
@@ -7396,7 +7396,7 @@ dlopen_self=unknown
dlopen_self_static
=
unknown
# Compiler flag to prevent dynamic linking.
link_static_flag
=
"
-static
"
link_static_flag
=
""
# Compiler flag to turn off builtin functions.
no_builtin_flag
=
" -fno-builtin"
...
...
@@ -7451,11 +7451,11 @@ striplib="strip --strip-unneeded"
# Dependencies to place before the objects being linked to create a
# shared library.
predep_objects
=
`
echo
"/usr/lib/gcc/
i386-redhat
-linux/4.1.2/../../../crti.o /usr/lib/gcc/
i386-redhat
-linux/4.1.2/crtbeginS.o"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
predep_objects
=
`
echo
"/usr/lib
64
/gcc/
x86_64-suse
-linux/4.1.2/../../../
../lib64/
crti.o /usr/lib
64
/gcc/
x86_64-suse
-linux/4.1.2/crtbeginS.o"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
# Dependencies to place after the objects being linked to create a
# shared library.
postdep_objects
=
`
echo
"/usr/lib/gcc/
i386-redhat
-linux/4.1.2/crtendS.o /usr/lib/gcc/
i386-redhat
-linux/4.1.2/../../../crtn.o"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
postdep_objects
=
`
echo
"/usr/lib
64
/gcc/
x86_64-suse
-linux/4.1.2/crtendS.o /usr/lib
64
/gcc/
x86_64-suse
-linux/4.1.2/../../../
../lib64/
crtn.o"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
# Dependencies to place before the objects being linked to create a
# shared library.
...
...
@@ -7463,11 +7463,11 @@ predeps=""
# Dependencies to place after the objects being linked to create a
# shared library.
postdeps
=
"-lstdc++ -lm -lgcc_s -lc -lgcc_s"
postdeps
=
"
-lmpi_cxx -lmpi -lopen-rte -lopen-pal -libverbs -lrt -lnuma -ldl -lnsl -lutil -ldl
-lstdc++ -lm -lgcc_s
-lpthread
-lc -lgcc_s"
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path
=
`
echo
"-L/usr/lib
/gcc/i386-redhat
-linux/4.1.2 -L/usr/lib/gcc/
i386-redhat
-linux/4.1.2
-L/usr/lib/gcc/i386-redhat
-linux/4.1.2/../../.."
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
compiler_lib_search_path
=
`
echo
"-L/usr/lib
64 -L/licsoft/libraries/openmpi/1.2.6/64bit/lib -L/usr/lib64/gcc/x86_64-suse
-linux/4.1.2 -L/usr/lib
64
/gcc/
x86_64-suse
-linux/4.1.2
/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse
-linux/4.1.2/../../.."
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
# Method to check whether dependent libraries are shared objects.
deplibs_check_method
=
"pass_all"
...
...
@@ -7547,10 +7547,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
link_all_deplibs
=
unknown
# Compile-time system search path for libraries
sys_lib_search_path_spec
=
`
echo
"
/usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../i386-redhat-linux/4.1.2/ /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../ /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/
"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
sys_lib_search_path_spec
=
`
echo
"
/lib64 /usr/lib64 /usr/local/lib64
"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec
=
"/lib /usr/lib /usr/
lib/octave-
2.9.9 /
usr/lib/qt-3.3
/lib "
sys_lib_dlsearch_path_spec
=
"/lib
64
/usr/lib
64
/usr/
X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/
2.9.9
9
/
opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2
/lib
so
"
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path
=
""
...
...
@@ -7574,7 +7574,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host
NWRW15
:
# Libtool was configured on host
p2s103
:
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
...
...
@@ -7596,12 +7596,12 @@ fast_install=yes
# The host system.
host_alias
=
host
=
i686-redhat
-linux-gnu
host
=
x86_64-unknown
-linux-gnu
host_os
=
linux-gnu
# The build system.
build_alias
=
build
=
i686-redhat
-linux-gnu
build
=
x86_64-unknown
-linux-gnu
build_os
=
linux-gnu
# An echo program that does not interpret backslashes.
...
...
@@ -7612,7 +7612,7 @@ AR="ar"
AR_FLAGS
=
"cru"
# A C compiler.
LTCC
=
"
g
cc"
LTCC
=
"
/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpi
cc"
# LTCC compiler flags.
LTCFLAGS
=
"-g -O2"
...
...
@@ -7621,16 +7621,16 @@ LTCFLAGS="-g -O2"
CC
=
"g77"
# Is the compiler the GNU C compiler?
with_gcc
=
yes
with_gcc
=
gcc_dir
=
`
gcc
-print-file-name
=
.
| /bin/sed
's,/\.$,,'
`
gcc_dir
=
`
gcc
-print-file-name
=
.
|
/usr
/bin/sed
's,/\.$,,'
`
gcc_ver
=
`
gcc
-dumpversion
`
# An ERE matcher.
EGREP
=
"grep -E"
# The linker used to build libraries.
LD
=
"/usr/
bin/ld
"
LD
=
"/usr/
x86_64-suse-linux/bin/ld -m elf_x86_64
"
# Whether we need hard or soft links.
LN_S
=
"ln -s"
...
...
@@ -7858,10 +7858,10 @@ variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COM
link_all_deplibs
=
unknown
# Compile-time system search path for libraries
sys_lib_search_path_spec
=
`
echo
"
/usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../ /lib/i386-redhat-linux/3.4.6/ /lib/ /usr/lib/i386-redhat-linux/3.4.6/ /usr/lib/
"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
sys_lib_search_path_spec
=
`
echo
"
/lib64 /usr/lib64 /usr/local/lib64
"
|
$SED
-e
"s@
${
gcc_dir
}
@
\$
{gcc_dir}@g;s@
${
gcc_ver
}
@
\$
{gcc_ver}@g"
`
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec
=
"/lib /usr/lib /usr/
lib/octave-
2.9.9 /
usr/lib/qt-3.3
/lib "
sys_lib_dlsearch_path_spec
=
"/lib
64
/usr/lib
64
/usr/
X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/
2.9.9
9
/
opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2
/lib
so
"
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path
=
""
...
...
AMDiS/src/MeshStructure.cc
View file @
715b5139
...
...
@@ -14,14 +14,14 @@ namespace AMDiS {
void
MeshStructure
::
insertElement
(
bool
isLeaf
)
{
// overflow? -> next index
if
(
pos_
>=
unsignedLongSize_
)
{
if
(
pos_
>=
unsignedLongSize_
)
{
code_
.
push_back
(
currentCode_
);
pos_
=
0
;
currentCode_
=
0
;
}
// insert element in binary code
if
(
!
isLeaf
)
{
if
(
!
isLeaf
)
{
unsigned
long
int
one
=
1
;
currentCode_
+=
(
one
<<
pos_
);
}
...
...
@@ -44,7 +44,7 @@ namespace AMDiS {
clear
();
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_EVERY_EL_PREORDER
);
while
(
elInfo
)
{
while
(
elInfo
)
{
insertElement
(
elInfo
->
getElement
()
->
isLeaf
());
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
...
...
@@ -84,7 +84,7 @@ namespace AMDiS {
bool
MeshStructure
::
skipBranch
(
MeshStructure
*
insert
)
{
if
(
isLeafElement
())
{
if
(
isLeafElement
())
{
return
nextElement
(
insert
);
}
else
{
bool
cont
=
nextElement
(
insert
);
...
...
@@ -104,13 +104,13 @@ namespace AMDiS {
structure2
->
reset
();
bool
cont
=
true
;
while
(
cont
)
{
while
(
cont
)
{
bool
cont1
,
cont2
;
if
(
structure1
->
isLeafElement
()
==
structure2
->
isLeafElement
())
{
if
(
structure1
->
isLeafElement
()
==
structure2
->
isLeafElement
())
{
cont1
=
structure1
->
nextElement
(
result
);
cont2
=
structure2
->
nextElement
();
}
else
{
if
(
structure1
->
isLeafElement
())
{
if
(
structure1
->
isLeafElement
())
{
cont1
=
structure1
->
nextElement
();
cont2
=
structure2
->
skipBranch
(
result
);
}
else
{
...
...
@@ -127,7 +127,8 @@ namespace AMDiS {
void
MeshStructure
::
fitMeshToStructure
(
Mesh
*
mesh
,
RefinementManager
*
manager
,
bool
checkPartition
)
bool
checkPartition
,
bool
debugMode
)
{
FUNCNAME
(
"MeshStructure::fitMeshToStructure()"
);
...
...
@@ -140,32 +141,32 @@ namespace AMDiS {
// decorate leaf data
reset
();
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_EVERY_EL_PREORDER
);
while
(
elInfo
)
{
while
(
elInfo
)
{
TEST_EXIT_DBG
(
cont
)(
"unexpected structure code end!
\n
"
);
Element
*
element
=
elInfo
->
getElement
();
if
(
isLeafElement
())
{
if
(
isLeafElement
())
{
TEST_EXIT_DBG
(
element
->
isLeaf
())(
"mesh finer than code
\n
"
);
};
if
(
element
->
isLeaf
()
&&
!
isLeafElement
())
{
if
(
element
->
isLeaf
()
&&
!
isLeafElement
())
{
MeshStructure
*
structure
=
NEW
MeshStructure
();
cont
=
skipBranch
(
structure
);
structure
->
commit
();
bool
decorate
=
true
;
if
(
checkPartition
)
{
if
(
checkPartition
)
{
PartitionElementData
*
partitionData
=
dynamic_cast
<
PartitionElementData
*>
(
element
->
getElementData
(
PARTITION_ED
));
TEST_EXIT_DBG
(
partitionData
)(
"no partition element data
\n
"
);
PartitionStatus
status
=
partitionData
->
getPartitionStatus
();
if
(
status
==
OUT
||
status
==
UNDEFINED
)
{
if
((
debugMode
==
false
)
&&
(
status
==
OUT
||
status
==
UNDEFINED
)
)
{
decorate
=
false
;
}
}
if
(
decorate
)
{
if
(
decorate
)
{
MeshStructure_ED
*
elData
=
NEW
MeshStructure_ED
(
element
->
getElementData
());
elData
->
setStructure
(
structure
);
element
->
setElementData
(
elData
);
...
...
@@ -185,9 +186,9 @@ namespace AMDiS {
do
{
finished
=
true
;
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_LEAF_EL
);
while
(
elInfo
)
{
while
(
elInfo
)
{
Element
*
element
=
elInfo
->
getElement
();
if
(
element
->
getElementData
(
MESH_STRUCTURE
)
!=
NULL
)
{
if
(
element
->
getElementData
(
MESH_STRUCTURE
)
!=
NULL
)
{
element
->
setMark
(
1
);
finished
=
false
;
}
else
{
...
...
@@ -196,7 +197,7 @@ namespace AMDiS {
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
manager
->
refineMesh
(
mesh
);
}
while
(
!
finished
);
}
while
(
!
finished
);
}
}
AMDiS/src/MeshStructure.h
View file @
715b5139
...
...
@@ -46,11 +46,12 @@ namespace AMDiS {
void
clear
();
/** \brief
* Creates a mesh structure code from a Mesh object by traversing it in preorder.
*/
void
init
(
Mesh
*
mesh
);
void
init
(
const
std
::
vector
<
unsigned
long
int
>&
code
,
int
numElements
)
{
void
init
(
const
std
::
vector
<
unsigned
long
int
>&
code
,
int
numElements
)
{
code_
=
code
;
numElements_
=
numElements
;
reset
();
...
...
@@ -58,10 +59,8 @@ namespace AMDiS {
void
reset
();
void
insertElement
(
bool
isLeaf
);
inline
void
commit
()
{
if
(
pos_
>
0
)
{
if
(
pos_
>
0
)
{
code_
.
push_back
(
currentCode_
);
}
reset
();
...
...
@@ -77,25 +76,37 @@ namespace AMDiS {
return
(
currentCode_
&
1
)
==
0
;
};
/** \brief
* Merges a mesh structure code with its own mesh structure code. The
* result overwrites the own mesh structure code.
*/
void
merge
(
MeshStructure
*
structure
)
{
MeshStructure
temp
(
*
this
);
merge
(
&
temp
,
structure
,
this
);
};
static
void
merge
(
MeshStructure
*
structure1
,
MeshStructure
*
structure2
,
MeshStructure
*
result
);
/** \brief
* Fits a given mesh to the mesh structure code.
*
* \param debugMode In debugMode, the whole mesh is fitted to the mesh
* structure code. Otherwise, the mesh is fitted only on the partition
* of the current process.
*/
void
fitMeshToStructure
(
Mesh
*
mesh
,
RefinementManager
*
manager
,
bool
checkPartition
=
false
);
bool
checkPartition
=
false
,
bool
debugMode
=
false
);
/** \brief
* Prints the mesh structure code.
*/
void
print
()
{
FUNCNAME
(
"MeshStructure::print()"
);
reset
();
bool
cont
=
true
;
while
(
cont
)
{
if
(
isLeafElement
())
{
while
(
cont
)
{
if
(
isLeafElement
())
{
MSG
(
"0"
);
}
else
{
MSG
(
"1"
);
...
...
@@ -105,6 +116,9 @@ namespace AMDiS {
MSG
(
"
\n
"
);
};
/** \brief
* Returns the mesh structure code.
*/
inline
const
std
::
vector
<
unsigned
long
int
>&
getCode
()
{
return
code_
;
};
...
...
@@ -117,6 +131,20 @@ namespace AMDiS {
return
currentElement_
;
};
protected:
/** \brief
* Insert a new element to the structure code. Is used by the init
* function.
*/
void
insertElement
(
bool
isLeaf
);
/** \brief
* Merges two mesh structure codes to one structure code.
*/
void
merge
(
MeshStructure
*
structure1
,
MeshStructure
*
structure2
,
MeshStructure
*
result
);
protected:
std
::
vector
<
unsigned
long
int
>
code_
;
...
...
AMDiS/src/ParallelProblem.cc
View file @
715b5139
This diff is collapsed.
Click to expand it.
AMDiS/src/ParallelProblem.h
View file @
715b5139
...
...
@@ -42,6 +42,7 @@ namespace AMDiS {
class
ParallelProblemInterface
{
public:
virtual
~
ParallelProblemInterface
()
{};
virtual
void
initParallelization
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
void
exitParallelization
(
AdaptInfo
*
adaptInfo
)
=
0
;
};
...
...
@@ -63,17 +64,41 @@ namespace AMDiS {
virtual
~
ParallelProblemBase
()
{};
/** \brief
* Must return true, if a new partitioning of the domain (due to unbalanced
* calculation times) have to be done.
*/
virtual
bool
doPartitioning
(
AdaptInfo
*
adaptInfo
,
double
localWeightSum
)
=
0
;
virtual
bool
doBuildGlobalSolution
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
double
setElemWeights
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
void
partitionMesh
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
void
refineOverlap
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
void
globalRefineOutOfPartition
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
void
createOverlap
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
void
exchangeDOFVectors
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
void
coarsenOutOfPartition
(
AdaptInfo
*
adaptInfo
)
=
0
;
/** \brief
*
*/
virtual
void
synchronizeMeshes
(
AdaptInfo
*
adaptInfo
)
=
0
;
/** \brief
*
*/
virtual
void
exchangeRankSolutions
(
AdaptInfo
*
adaptInfo
)
=
0
;
/** \brief
*
*/
virtual
void
buildGlobalSolution
(
AdaptInfo
*
adaptInfo
)
=
0
;
virtual
void
exitParallelization
(
AdaptInfo
*
adaptInfo
)
...
...
@@ -96,11 +121,12 @@ namespace AMDiS {
virtual
void
closeTimestep
(
AdaptInfo
*
adaptInfo
)
{
if
(
mpiSize
_
>
1
&&
doBuildGlobalSolution
(
adaptInfo
))
{
synchronizeMeshes
(
adaptInfo
);
if
(
mpiSize
>
1
&&
doBuildGlobalSolution
(
adaptInfo
))
{
synchronizeMeshes
(
adaptInfo
);
exchangeRankSolutions
(
adaptInfo
);
buildGlobalSolution
(
adaptInfo
);
}
if
(
timeIF_
)
timeIF_
->
closeTimestep
(
adaptInfo
);
};
...
...
@@ -127,12 +153,11 @@ namespace AMDiS {
{
Flag
flag
;
if
(
mpiSize
_
>
1
&&
toDo
.
isSet
(
MARK
|
ADAPT
))
{
if
(
mpiSize
>
1
&&
toDo
.
isSet
(
MARK
|
ADAPT
))
{
flag
=
iterationIF_
->
oneIteration
(
adaptInfo
,
MARK
|
ADAPT
);
double
localWeightSum
=
setElemWeights
(
adaptInfo
);
if
(
doPartitioning
(
adaptInfo
,
localWeightSum
))
{
if
(
doPartitioning
(
adaptInfo
,
localWeightSum
))
{
clock_t
partitioningStart
=
clock
();
synchronizeMeshes
(
adaptInfo
);
...
...
@@ -155,31 +180,42 @@ namespace AMDiS {
}
// synchronize adaption flag
unsigned
long
*
flagBuffer
=
GET_MEMORY
(
unsigned
long
,
mpiSize
_
);
unsigned
long
*
flagBuffer
=
GET_MEMORY
(
unsigned
long
,
mpiSize
);
unsigned
long
localFlag
=
flag
.
getFlags
();
MPI
::
COMM_WORLD
.
Allgather
(
&
localFlag
,
1
,
MPI_UNSIGNED_LONG
,
flagBuffer
,
1
,
MPI_UNSIGNED_LONG
);
int
i
;
for
(
i
=
0
;
i
<
mpiSize_
;
i
++
)
{
for
(
int
i
=
0
;
i
<
mpiSize
;
i
++
)
{
flag
.
setFlag
(
flagBuffer
[
i
]);
}
FREE_MEMORY
(
flagBuffer
,
unsigned
long
,
mpiSize_
);
FREE_MEMORY
(
flagBuffer
,
unsigned
long
,
mpiSize
);
return
flag
;
};
virtual
void
endIteration
(
AdaptInfo
*
adaptInfo
)
{
virtual
void
endIteration
(
AdaptInfo
*
adaptInfo
)
{
iterationIF_
->
endIteration
(
adaptInfo
);
};
virtual
void
startDelayedTimestepCalculation
()
{};
virtual
bool
existsDelayedCalculation
()
{
return
false
;
};
protected:
int
mpiRank_
;
int
mpiSize_
;
int
mpiRank
;
int
mpiSize
;
ProblemIterationInterface
*
iterationIF_
;
ProblemTimeInterface
*
timeIF_
;
clock_t
computationStart
;
double
partitioningTime
;
};
...
...
@@ -220,7 +256,11 @@ namespace AMDiS {
virtual
void
globalRefinements
();
/** \brief
*
*/
void
exchangeRankSolutions
(
AdaptInfo
*
adaptInfo
,
Mesh
*
workMesh
,
std
::
vector
<
DOFVector
<
double
>*>
rankSolutions
);
void
exchangeDOFVector
(
AdaptInfo
*
adaptInfo
,
...
...
@@ -236,51 +276,61 @@ namespace AMDiS {
void
fillVertexPartitions
(
int
level
,
int
overlap
,
bool
openOverlap
,
std
::
map
<
Element
*
,
int
>
&
overlapDistance
);
void
setRepartitionSteps
(
int
steps
)
{
repartitionSteps_
=
steps
;
};
void
setRepartitionSteps
(
int
steps
)
{
repartitionSteps_
=
steps
;
};
void
puEveryTimestep
(
bool
pu
)
{
puEveryTimestep_
=
pu
;
};
void
puEveryTimestep
(
bool
pu
)
{
puEveryTimestep_
=
pu
;
};
void
addDOFVector
(
DOFVector
<
double
>
*
vec
)
{
void
addDOFVector
(
DOFVector
<
double
>
*
vec
)
{
dofVectors_
.
push_back
(
vec
);
};