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

New OpenMP parallelization mode.

parent fa6432f0
...@@ -620,6 +620,7 @@ namespace AMDiS { ...@@ -620,6 +620,7 @@ namespace AMDiS {
{ {
FUNCNAME("ProblemVec::buildAfterCoarsen()"); FUNCNAME("ProblemVec::buildAfterCoarsen()");
// printOpenmpTraverseInfo(this, true);
// buildAfterCoarsen_sebastianMode(adaptInfo, flag); // buildAfterCoarsen_sebastianMode(adaptInfo, flag);
clock_t first = clock(); clock_t first = clock();
...@@ -1183,7 +1184,7 @@ namespace AMDiS { ...@@ -1183,7 +1184,7 @@ namespace AMDiS {
const BasisFunction *basisFcts = feSpace->getBasisFcts(); const BasisFunction *basisFcts = feSpace->getBasisFcts();
#ifdef _OPENMP #ifdef _OPENMP
TraverseParallelStack stack; TraverseParallelStack stack(0, 1);
#else #else
TraverseStack stack; TraverseStack stack;
#endif #endif
......
...@@ -47,8 +47,13 @@ namespace AMDiS { ...@@ -47,8 +47,13 @@ namespace AMDiS {
if (parallelMode == 0) { if (parallelMode == 0) {
return stacks[omp_get_thread_num()]->traverseNext(elInfoOld); return stacks[omp_get_thread_num()]->traverseNext(elInfoOld);
} else { } else {
ElInfo *elInfo = stacks[omp_get_thread_num()]->traverseNext(elInfoOld);
} while (elInfo &&
elInfo->getElement()->getIndex() % nThreads != omp_get_thread_num()) {
elInfo = stacks[omp_get_thread_num()]->traverseNext(elInfo);
}
return elInfo;
}
} }
private: private:
......
Markdown is supported
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