From eb33f8b237d2685a7015a4682f96a72100aecc4b Mon Sep 17 00:00:00 2001
From: Thomas Witkowski <thomas.witkowski@gmx.de>
Date: Tue, 6 Jul 2010 15:33:46 +0000
Subject: [PATCH] Some small changes, add tool to compare parallel and
 sequential matrices and vectors.

---
 AMDiS/libtool                            | 18 +++++++++---------
 AMDiS/src/Debug.cc                       | 18 +++++++++++++++---
 AMDiS/src/ProblemVec.cc                  |  4 ++--
 AMDiS/src/parallel/GlobalMatrixSolver.cc |  7 ++++---
 4 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/AMDiS/libtool b/AMDiS/libtool
index b194b328..02151259 100755
--- a/AMDiS/libtool
+++ b/AMDiS/libtool
@@ -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
@@ -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"
@@ -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/mpicxx"
 
 # Is the compiler the GNU C compiler?
 with_gcc=yes
@@ -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"
@@ -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/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/fastfs/wir/local/lib -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/../../.."
+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/fastfs/wir/local/lib -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"
@@ -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"
diff --git a/AMDiS/src/Debug.cc b/AMDiS/src/Debug.cc
index f3310227..ea0156a9 100644
--- a/AMDiS/src/Debug.cc
+++ b/AMDiS/src/Debug.cc
@@ -82,11 +82,23 @@ namespace AMDiS {
     {
       std::map<int, double> vec;    
       TraverseStack stack;
-      ElInfo *elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_LEAF_EL);
-      
+      ElInfo *elInfo = stack.traverseFirst(mesh, -1, Mesh::CALL_EVERY_EL_PREORDER);
+      bool markChildren = false;
+      int markLevel = -1;
+
       while (elInfo) {		  
 	int index = elInfo->getElement()->getIndex();
-	vec[index] = (index == idx ? 1.0 : 0.0);
+	if (index == idx) {
+	  markChildren = true;
+	  markLevel = elInfo->getLevel();
+	}
+
+	if (markChildren && elInfo->getLevel() < markLevel)
+	  markChildren = false;
+	  
+	if (elInfo->getElement()->isLeaf())
+	  vec[index] = (markChildren ? 1.0 : 0.0);
+
 	elInfo = stack.traverseNext(elInfo);
       }
 
diff --git a/AMDiS/src/ProblemVec.cc b/AMDiS/src/ProblemVec.cc
index d8cb296c..2e545e6c 100644
--- a/AMDiS/src/ProblemVec.cc
+++ b/AMDiS/src/ProblemVec.cc
@@ -678,8 +678,8 @@ namespace AMDiS {
 
       for (int j = 0; j < nComponents; j++) {
 
-	//	if (writeAsmInfo)
-	//	  MSG("--------- %d %d -------------\n", i, j);
+	if (writeAsmInfo)
+	  MSG("--------- %d %d -------------\n", i, j);
 
 	// Only if this variable is true, the current matrix will be assembled.	
 	bool assembleMatrix = true;
diff --git a/AMDiS/src/parallel/GlobalMatrixSolver.cc b/AMDiS/src/parallel/GlobalMatrixSolver.cc
index 0359b421..a4c8dc80 100644
--- a/AMDiS/src/parallel/GlobalMatrixSolver.cc
+++ b/AMDiS/src/parallel/GlobalMatrixSolver.cc
@@ -422,8 +422,8 @@ namespace AMDiS {
     // === Create PETSc matrix with the computed nnz data structure. ===
 
     MatCreateMPIAIJ(PETSC_COMM_WORLD, nRankRows, nRankRows, nOverallRows, nOverallRows,
-		    0, d_nnz, 0, o_nnz, &petscMatrix);
-
+  		    0, d_nnz, 0, o_nnz, &petscMatrix);
+    
     INFO(info, 8)("Fill petsc matrix 1 needed %.5f seconds\n", TIME_USED(first, clock()));
 
 #if (DEBUG != 0)
@@ -441,7 +441,8 @@ namespace AMDiS {
     for (int i = 0; i < nComponents; i++)
       for (int j = 0; j < nComponents; j++)
 	if ((*mat)[i][j])
-	  setDofMatrix((*mat)[i][j], nComponents, i, j);		
+	  setDofMatrix((*mat)[i][j], nComponents, i, j);	
+	
 
     INFO(info, 8)("Fill petsc matrix 2 needed %.5f seconds\n", TIME_USED(first, clock()));
 
-- 
GitLab