Commit 4d42e7f5 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Added debug functions for comparing matrices and vectors.

parent da038785
......@@ -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 deimos102:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......@@ -66,12 +66,12 @@ fast_install=yes
# The host system.
host_alias=
host=i686-pc-linux-gnu
host=x86_64-unknown-linux-gnu
host_os=linux-gnu
# The build system.
build_alias=
build=i686-pc-linux-gnu
build=x86_64-unknown-linux-gnu
build_os=linux-gnu
# An echo program that does not interpret backslashes.
......@@ -82,13 +82,13 @@ AR="ar"
AR_FLAGS="cru"
# A C compiler.
LTCC="gcc"
LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
# LTCC compiler flags.
LTCFLAGS="-g -O2"
# A language-specific compiler.
CC="gcc"
CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
# Is the compiler the GNU C compiler?
with_gcc=yes
......@@ -97,7 +97,7 @@ with_gcc=yes
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"
......@@ -171,7 +171,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"
......@@ -325,10 +325,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=" /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/"
sys_lib_search_path_spec=" /usr/lib64/gcc/x86_64-suse-linux/4.1.2/ /usr/lib/gcc/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/ /lib/x86_64-suse-linux/4.1.2/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.1.2/ /usr/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../ /lib/ /usr/lib/"
# 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 /usr/lib /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.99 /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/libso "
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path=""
......@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host NWRW15:
# Libtool was configured on host deimos102:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......@@ -6782,12 +6782,12 @@ fast_install=yes
# The host system.
host_alias=
host=i686-pc-linux-gnu
host=x86_64-unknown-linux-gnu
host_os=linux-gnu
# The build system.
build_alias=
build=i686-pc-linux-gnu
build=x86_64-unknown-linux-gnu
build_os=linux-gnu
# An echo program that does not interpret backslashes.
......@@ -6798,13 +6798,13 @@ AR="ar"
AR_FLAGS="cru"
# A C compiler.
LTCC="gcc"
LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
# 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
......@@ -6813,7 +6813,7 @@ with_gcc=yes
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"
......@@ -6887,7 +6887,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"
......@@ -6942,11 +6942,11 @@ striplib="strip --strip-unneeded"
# Dependencies to place before the objects being linked to create a
# shared library.
predep_objects="/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.2/crtbeginS.o"
predep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbeginS.o"
# Dependencies to place after the objects being linked to create a
# shared library.
postdep_objects="/usr/lib/gcc/i386-redhat-linux/4.1.2/crtendS.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crtn.o"
postdep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtendS.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o"
# Dependencies to place before the objects being linked to create a
# shared library.
......@@ -6954,11 +6954,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="-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/../../.."
compiler_lib_search_path="-L/usr/lib64 -L/licsoft/libraries/openmpi/1.2.6/64bit/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/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/../../.."
# Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all"
......@@ -7038,10 +7038,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=" /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/"
sys_lib_search_path_spec=" /usr/lib64/gcc/x86_64-suse-linux/4.1.2/ /usr/lib/gcc/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../x86_64-suse-linux/4.1.2/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/ /lib/x86_64-suse-linux/4.1.2/ /lib/../lib64/ /usr/lib/x86_64-suse-linux/4.1.2/ /usr/lib/../lib64/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../ /lib/ /usr/lib/"
# 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 /usr/lib /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.99 /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/libso "
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path=""
......@@ -7065,7 +7065,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host NWRW15:
# Libtool was configured on host deimos102:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......@@ -7087,12 +7087,12 @@ fast_install=yes
# The host system.
host_alias=
host=i686-pc-linux-gnu
host=x86_64-unknown-linux-gnu
host_os=linux-gnu
# The build system.
build_alias=
build=i686-pc-linux-gnu
build=x86_64-unknown-linux-gnu
build_os=linux-gnu
# An echo program that does not interpret backslashes.
......@@ -7103,7 +7103,7 @@ AR="ar"
AR_FLAGS="cru"
# A C compiler.
LTCC="gcc"
LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc"
# LTCC compiler flags.
LTCFLAGS="-g -O2"
......@@ -7112,13 +7112,13 @@ LTCFLAGS="-g -O2"
CC="g77"
# Is the compiler the GNU C compiler?
with_gcc=yes
with_gcc=
# 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"
......@@ -7346,10 +7346,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=" /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/"
sys_lib_search_path_spec=" /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/ /usr/lib/gcc/x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/lib/x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../x86_64-suse-linux/lib/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../x86_64-suse-linux/3.3.5/ /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../ /lib/x86_64-suse-linux/3.3.5/ /lib/ /usr/lib/x86_64-suse-linux/3.3.5/ /usr/lib/"
# 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 /usr/lib /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.99 /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/libso "
# Fix the shell variable $srcfile for the compiler.
fix_srcfile_path=""
......
......@@ -31,8 +31,6 @@ namespace AMDiS {
elInfo->getElement()->getIndex(),
MPI::COMM_WORLD.Get_rank());
PartitionStatus status = elData->getPartitionStatus();
//if(status == IN || status == OVERLAP) {
decoratedEstimator_->estimateElement(elInfo);
//} else {
......@@ -45,7 +43,6 @@ namespace AMDiS {
while(elInfo) {
PartitionElementData *elData = dynamic_cast<PartitionElementData*>
(elInfo->getElement()->getElementData(PARTITION_ED));
PartitionStatus status = elData->getPartitionStatus();
//if(status == IN) {
elementCount_++;
partition_sum += elInfo->getElement()->getEstimation(row_);
......
......@@ -34,7 +34,7 @@ namespace AMDiS {
*
* Should be used in the following way:
*
* ElementDofIterator elDofIter(admin);
* ElementDofIterator elDofIter(feSpace);
* elDofIter.reset(el);
* do {
* elDofIter.getDOF();
......
#include <stdarg.h>
#include <stdio.h>
#include <sstream>
#include "Global.h"
#include "Parameters.h"
#include "Element.h"
......@@ -5,10 +9,6 @@
#include "Triangle.h"
#include "Tetrahedron.h"
#include <stdarg.h>
#include <stdio.h>
namespace AMDiS {
const char *funcName = NULL;
......@@ -36,7 +36,6 @@ namespace AMDiS {
MSG("wait for <enter> ...");
fgets(line, 9, stdin);
}
return;
}
void Msg::change_out(std::ostream *fp)
......@@ -54,32 +53,6 @@ namespace AMDiS {
ERROR("file pointer is pointer to nil;\n");
ERROR("use previous stream for errors furthermore\n");
}
return;
}
void Msg::open_file(const char *filename, OPENMODE type)
{
FUNCNAME("Msg::open_file()");
std::ofstream *fp;
if (filename && (fp = new std::ofstream(filename, type))) {
if (out && *out != std::cout && *out != std::cerr) {
dynamic_cast< std::ofstream*>(out)->close();
delete out;
}
out = fp;
} else {
if (filename)
ERROR("can not open %s;\n", filename);
else
ERROR("no filename specified;\n");
ERROR("use previous stream for messages furthermore\n");
}
return;
}
void Msg::change_error_out(std::ofstream *fp)
......@@ -97,8 +70,6 @@ namespace AMDiS {
ERROR("file pointer is pointer to nil;\n");
ERROR("use previous stream for errors furthermore\n");
}
return;
}
void Msg::open_error_file(const char *filename, OPENMODE type)
......@@ -120,34 +91,6 @@ namespace AMDiS {
ERROR("no filename specified;\n");
ERROR("use previous stream for errors furthermore\n");
}
return;
}
const char *generate_filename(const char * path, const char * fn, int ntime)
{
static char name[256];
char *cp;
if (path == NULL || path[0] == '\0') {
sprintf(name, "./%s", fn);
} else {
const char* ccp = path;
while (*ccp)
ccp++;
ccp--;
if (*ccp == '/')
sprintf(name, "%s%s", path, fn);
else
sprintf(name, "%s/%s", path, fn);
}
cp = name;
while (*cp)
cp++;
sprintf(cp, "%d", 100000 + ntime);
if (ntime < 100000) *cp = '0';
return(const_cast<const char *>(name));
}
void Msg::print_funcname(const char *funcName)
......@@ -156,36 +99,37 @@ namespace AMDiS {
out = &std::cout;
if (funcName && oldFuncName != funcName) {
(*out)<< funcName << ":" << std::endl;
PRINT_LINE((*out), funcName << ":" << std::endl);
} else if (!funcName) {
(*out)<<"*unknown function*" << std::endl;
PRINT_LINE((*out), "*unknown function*" << std::endl);
}
(*out) << " ";
PRINT_LINE((*out), " ");
oldFuncName = funcName;
}
void Msg::print_error_funcname(const char *funcName,
const char *file,
int line)
void Msg::print_error_funcname(const char *funcName, const char *file, int line)
{
static int old_line = -1;
if (!error)
error = &std::cerr;
if (funcName && oldFuncName != funcName) {
(*error)<<funcName<< ": ";
}
std::stringstream oss;
if (funcName && oldFuncName != funcName)
oss << funcName << ": ";
else if (!funcName) {
if (line-old_line > 5)
(*error) << "*unknown function*";
oss << "*unknown function*";
}
if (oldFuncName != funcName) {
(*error) << "ERROR in " << file << ", line " << line << "\n";
oss << "ERROR in " << file << ", line " << line << std::endl;;
oldFuncName = funcName;
} else if (line - old_line > 5)
(*error) << "ERROR in " << file << ", line " << line << "\n";
oss << "ERROR in " << file << ", line " << line << "\n" << std::endl;
PRINT_LINE((*error), oss.str());
old_line = line;
}
......@@ -199,7 +143,7 @@ namespace AMDiS {
va_start(arg, format);
vsprintf(buff, format, arg);
(*error)<<buff;
PRINT_LINE((*error), buff);
va_end(arg);
exit(1);
......@@ -216,10 +160,8 @@ namespace AMDiS {
va_start(arg, format);
vsprintf(buff, format, arg);
(*error)<<buff;
PRINT_LINE((*error), buff);
va_end(arg);
return;
}
void Msg::print_warn_funcname(const char *funcName,
......@@ -231,17 +173,22 @@ namespace AMDiS {
if (!out)
out = &std::cout;
std::stringstream oss;
if (funcName && oldFuncName != funcName) {
(*out) << funcName << ": ";
}
else if (!funcName){
(*out) << "*unknown function*";
oss << funcName << ": ";
} else if (!funcName) {
oss << "*unknown function*";
}
if (oldFuncName != funcName) {
(*out) << "WARNING in " << file << ", line " << line << "\n";
oss << "WARNING in " << file << ", line " << line << std::endl;
oldFuncName = funcName;
} else if (line - old_line > 5)
(*out) << "WARNING in " << file << ", line " << line << "\n";
} else if (line - old_line > 5) {
oss << "WARNING in " << file << ", line " << line << std::endl;
}
PRINT_LINE((*out), oss.str());
old_line = line;
}
......@@ -256,10 +203,8 @@ namespace AMDiS {
va_start(arg, format);
vsprintf(buff, format, arg);
(*out)<<buff;
PRINT_LINE((*out), buff);
va_end(arg);
return;
}
......@@ -273,7 +218,7 @@ namespace AMDiS {
va_start(arg, format);
vsprintf(buff, format, arg);
(*out) << buff;
PRINT_LINE((*out), buff);
va_end(arg);
}
......@@ -295,10 +240,9 @@ namespace AMDiS {
geoIndexTable.resize(4);
for (int i = 0; i < 4; i++) {
geoIndexTable[i].resize(geoTableSize);
for (int j = 0; j < geoTableSize; j++) {
for (int j = 0; j < geoTableSize; j++)
geoIndexTable[i][j] = 0;
}
}
geoIndexTable[0][PARTS - MINPART] = 1;
geoIndexTable[0][VERTEX - MINPART] = 1;
......
......@@ -47,6 +47,10 @@
#include <functional>
#include <float.h>
#if HAVE_PARALLEL_DOMAIN_AMDIS
#include "mpi.h"
#endif
#include "AMDiS_fwd.h"
namespace AMDiS {
......@@ -76,6 +80,12 @@ namespace AMDiS {
/// returns the dimension of GeoIndex ind for dimension dim
#define DIM_OF_INDEX(ind, dim) ((static_cast<int>(ind) == 0) ? dim : static_cast<int>(ind) - 1)
#if HAVE_PARALLEL_DOMAIN_AMDIS
#define PRINT_LINE(stream, line) stream << "[" << MPI::COMM_WORLD.Get_rank() << "]" << line
#else
#define PRINT_LINE(stream, line) stream << line
#endif
/// Calculates factorial of i
int fac(int i);
......@@ -172,20 +182,12 @@ namespace AMDiS {
/// Changes the message stream
static void change_out(std::ostream*);
/// Creates a filestream and sets the message stream to this filestream
static void open_file(const char *filename, OPENMODE);
/// Changes the error stream
static void change_error_out(std::ofstream *fp);
/// Creates a filestream and sets the error stream to this filestream
static void open_error_file(const char *filename, OPENMODE);
/// Generates a filename from path, file and ntime
static const char *generate_filename(const char *path,
const char *file,
int ntime);
/// Sets \ref msgInfo
static void setMsgInfo(int info)
{
......
......@@ -244,6 +244,13 @@ namespace AMDiS {
for (icursor_type icursor = begin<nz>(cursor),
icend = end<nz>(cursor); icursor != icend; ++icursor)
if (value(*icursor) != 0.0) {
if (mpiRank == 0 && r == 0)
std::cout << "C = " << col(*icursor)
<< " = " << mapLocalGlobalDOFs[col(*icursor)]
<< " = " << mapLocalGlobalDOFs[col(*icursor)] * dispMult + dispAddCol
<< " -> " << value(*icursor)
<< std::endl;
cols.push_back(mapLocalGlobalDOFs[col(*icursor)] * dispMult + dispAddCol);
values.push_back(value(*icursor));
}
......@@ -251,6 +258,7 @@ namespace AMDiS {
MatSetValues(petscMatrix, 1, &r, cols.size(), &(cols[0]), &(values[0]), ADD_VALUES);
}
std::cout << "==========" << std::endl;
}
......@@ -475,13 +483,9 @@ namespace AMDiS {
i++;
}
INFO(info, 8)("Fill petsc matrix 1 needed %.5f seconds\n", TIME_USED(first, clock()));
MatCreateMPIAIJ(PETSC_COMM_WORLD, nRankRows, nRankRows, nOverallRows, nOverallRows,
0, d_nnz, 0, o_nnz, &petscMatrix);
INFO(info, 8)("Fill petsc matrix 2 needed %.5f seconds\n", TIME_USED(first, clock()));
#if (DEBUG != 0)
int a, b;
MatGetOwnershipRange(petscMatrix, &a, &b);
......@@ -498,13 +502,9 @@ namespace AMDiS {
if ((*mat)[i][j])
setDofMatrix((*mat)[i][j], nComponents, i, j);
INFO(info, 8)("Fill petsc matrix 3 needed %.5f seconds\n", TIME_USED(first, clock()));
MatAssemblyBegin(petscMatrix, MAT_FINAL_ASSEMBLY);
MatAssemblyEnd(petscMatrix, MAT_FINAL_ASSEMBLY);
INFO(info, 8)("Fill petsc matrix 4 needed %.5f seconds\n", TIME_USED(first, clock()));
for (int i = 0; i < nComponents; i++)
setDofVector(vec->getDOFVector(i), nComponents, i);
......@@ -589,7 +589,7 @@ namespace AMDiS {
}
void ParallelDomainBase::solvePetscMatrix(SystemVector *vec)
void ParallelDomainBase::solvePetscMatrix(SystemVector &vec)
{
FUNCNAME("ParallelDomainBase::solvePetscMatrix()");
......@@ -610,14 +610,38 @@ namespace AMDiS {
VecGetArray(petscSolVec, &vecPointer);
for (int i = 0; i < nComponents; i++) {
DOFVector<double> *dofvec = vec->getDOFVector(i);
for (int j = 0; j < nRankDOFs; j++)
DOFVector<double> *dofvec = vec.getDOFVector(i);
for (int j = 0; j < nRankDOFs; j++) {
if (i == 0 && mapLocalToDofIndex[j] == 0)
std::cout << "ZUGRIFF AUF: " << j * nComponents + i << std::endl;
(*dofvec)[mapLocalToDofIndex[j]] = vecPointer[j * nComponents + i];
}
}
if (mpiRank == 0)
std::cout << "RESULT = " << (*(vec.getDOFVector(0)))[0] << std::endl;
VecRestoreArray(petscSolVec, &vecPointer);
synchVectors(vec);
int iterations = 0;
KSPGetIterationNumber(solver, &iterations);
MSG(" Number of iterations: %d\n", iterations);
double norm = 0.0;
MatMult(petscMatrix, petscSolVec, petscTmpVec);
VecAXPY(petscTmpVec, -1.0, petscRhsVec);
VecNorm(petscTmpVec, NORM_2, &norm);
MSG(" Residual norm: %e\n", norm);