Commit 37322782 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* OpenMP bug fix

parent 8817dab1
...@@ -114,12 +114,10 @@ namespace AMDiS { ...@@ -114,12 +114,10 @@ namespace AMDiS {
TEST_EXIT_DBG(dimOfWorld == 3) TEST_EXIT_DBG(dimOfWorld == 3)
("dim != dim_of_world ! use parametric elements!\n"); ("dim != dim_of_world ! use parametric elements!\n");
int myRank = omp_get_thread_num(); WorldVector<double> *e1 = &tmpWorldVecs[0];
WorldVector<double> *e2 = &tmpWorldVecs[1];
WorldVector<double> *e1 = &tmpWorldVecs[myRank][0]; WorldVector<double> *e3 = &tmpWorldVecs[2];
WorldVector<double> *e2 = &tmpWorldVecs[myRank][1]; WorldVector<double> *v0 = &tmpWorldVecs[3];
WorldVector<double> *e3 = &tmpWorldVecs[myRank][2];
WorldVector<double> *v0 = &tmpWorldVecs[myRank][3];
double det, adet; double det, adet;
double a11, a12, a13, a21, a22, a23, a31, a32, a33; double a11, a12, a13, a21, a22, a23, a31, a32, a33;
...@@ -318,9 +316,9 @@ namespace AMDiS { ...@@ -318,9 +316,9 @@ namespace AMDiS {
int myRank = omp_get_thread_num(); int myRank = omp_get_thread_num();
WorldVector<double> *e0 = &tmpWorldVecs[myRank][0]; WorldVector<double> *e0 = &tmpWorldVecs[0];
WorldVector<double> *e1 = &tmpWorldVecs[myRank][1]; WorldVector<double> *e1 = &tmpWorldVecs[1];
WorldVector<double> *e2 = &tmpWorldVecs[myRank][2]; WorldVector<double> *e2 = &tmpWorldVecs[2];
if (dimOfWorld == 3) { if (dimOfWorld == 3) {
int i0 = (face + 1) % 4; int i0 = (face + 1) % 4;
......
...@@ -48,11 +48,7 @@ namespace AMDiS { ...@@ -48,11 +48,7 @@ namespace AMDiS {
ElInfo3d(Mesh* aMesh) ElInfo3d(Mesh* aMesh)
: ElInfo(aMesh) : ElInfo(aMesh)
{ {
tmpWorldVecs.resize(omp_get_max_threads()); tmpWorldVecs.resize(4);
for (int i = 0; i < static_cast<int>(tmpWorldVecs.size()); i++) {
tmpWorldVecs[i].resize(4);
}
}; };
/** \brief /** \brief
...@@ -138,9 +134,8 @@ namespace AMDiS { ...@@ -138,9 +134,8 @@ namespace AMDiS {
/** \brief /** \brief
* Tmp vectors used for calculations in calcGrdLambda and getNormal(). * Tmp vectors used for calculations in calcGrdLambda and getNormal().
* Thread safe!
*/ */
::std::vector< ::std::vector< WorldVector<double> > > tmpWorldVecs; ::std::vector< WorldVector<double> > tmpWorldVecs;
}; };
} }
......
...@@ -762,6 +762,7 @@ namespace AMDiS { ...@@ -762,6 +762,7 @@ namespace AMDiS {
elInfo = stack.traverseNext(elInfo); elInfo = stack.traverseNext(elInfo);
} }
if (assembleMatrix && matrix->getBoundaryManager()) if (assembleMatrix && matrix->getBoundaryManager())
matrix->getBoundaryManager()->exitMatrix(matrix); matrix->getBoundaryManager()->exitMatrix(matrix);
......
...@@ -47,10 +47,9 @@ namespace AMDiS { ...@@ -47,10 +47,9 @@ namespace AMDiS {
ElInfo* TraverseStack::traverseNext(ElInfo* elinfo_old) ElInfo* TraverseStack::traverseNext(ElInfo* elinfo_old)
{ {
FUNCNAME("TraverseStack::traverseNext()"); FUNCNAME("TraverseStack::traverseNext()");
\
ElInfo *elinfo = NULL; ElInfo *elinfo = NULL;
ElInfo::traverseId = id; ElInfo::traverseId = id;
Parametric *parametric = traverse_mesh->getParametric(); Parametric *parametric = traverse_mesh->getParametric();
if (stack_used) { if (stack_used) {
...@@ -63,9 +62,9 @@ namespace AMDiS { ...@@ -63,9 +62,9 @@ namespace AMDiS {
TEST_EXIT_DBG(elinfo_old == NULL)("invalid old elinfo != nil\n"); TEST_EXIT_DBG(elinfo_old == NULL)("invalid old elinfo != nil\n");
} }
if (traverse_fill_flag.isSet(Mesh::CALL_LEAF_EL)) if (traverse_fill_flag.isSet(Mesh::CALL_LEAF_EL)) {
elinfo = traverseLeafElement(); elinfo = traverseLeafElement();
else } else {
if (traverse_fill_flag.isSet(Mesh::CALL_LEAF_EL_LEVEL)) if (traverse_fill_flag.isSet(Mesh::CALL_LEAF_EL_LEVEL))
elinfo = traverseLeafElementLevel(); elinfo = traverseLeafElementLevel();
else if (traverse_fill_flag.isSet(Mesh::CALL_EL_LEVEL)) else if (traverse_fill_flag.isSet(Mesh::CALL_EL_LEVEL))
...@@ -81,6 +80,7 @@ namespace AMDiS { ...@@ -81,6 +80,7 @@ namespace AMDiS {
elinfo = traverseEveryElementPostorder(); elinfo = traverseEveryElementPostorder();
else else
ERROR_EXIT("invalid traverse_flag\n"); ERROR_EXIT("invalid traverse_flag\n");
}
if (elinfo) { if (elinfo) {
if (parametric) { if (parametric) {
...@@ -114,12 +114,11 @@ namespace AMDiS { ...@@ -114,12 +114,11 @@ namespace AMDiS {
int Traverse::recursive(ElInfo *elinfo) int Traverse::recursive(ElInfo *elinfo)
{ {
FUNCNAME("Traverse::recursive"); FUNCNAME("Traverse::recursive()");
Element *el = elinfo->getElement();
int mg_level,sum=0;
Element *el = elinfo->getElement();
int mg_level, sum=0;
Parametric *parametric = mesh->getParametric(); Parametric *parametric = mesh->getParametric();
ElInfo::traverseId = id; ElInfo::traverseId = id;
if (flag.isSet(Mesh::CALL_LEAF_EL)) { if (flag.isSet(Mesh::CALL_LEAF_EL)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment