Commit af7c27c8 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

assign default visibility to variable in Openmp tasks

parent 828203e7
...@@ -715,7 +715,7 @@ private: ...@@ -715,7 +715,7 @@ private:
{ {
const int chunckSize = FMath::Max(1, numberOfCells/(omp_get_num_threads()*omp_get_num_threads())); const int chunckSize = FMath::Max(1, numberOfCells/(omp_get_num_threads()*omp_get_num_threads()));
for(int idxCell = 0 ; idxCell < numberOfCells ; idxCell += chunckSize){ for(int idxCell = 0 ; idxCell < numberOfCells ; idxCell += chunckSize){
#pragma omp task #pragma omp task default(none) shared(numberOfCells,idxLevel,chunckSize) firstprivate(idxCell)
{ {
KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; KernelClass * const myThreadkernels = kernels[omp_get_thread_num()];
const CellClass* neighbors[343]; const CellClass* neighbors[343];
...@@ -732,11 +732,12 @@ private: ...@@ -732,11 +732,12 @@ private:
#pragma omp taskwait #pragma omp taskwait
for(int idxThread = 0 ; idxThread < omp_get_num_threads() ; ++idxThread){ for(int idxThread = 0 ; idxThread < omp_get_num_threads() ; ++idxThread){
#pragma omp task #pragma omp task default(none) firstprivate(idxThread) shared(idxLevel)
{ {
kernels[idxThread]->finishedLevelM2L(idxLevel); kernels[idxThread]->finishedLevelM2L(idxLevel);
} }
} }
#pragma omp taskwait
FLOG(computationCounter.tac()); FLOG(computationCounter.tac());
} }
...@@ -1271,7 +1272,7 @@ private: ...@@ -1271,7 +1272,7 @@ private:
for(int idxLeafs = previous ; idxLeafs < endAtThisShape ; idxLeafs += chunckSize){ for(int idxLeafs = previous ; idxLeafs < endAtThisShape ; idxLeafs += chunckSize){
const int nbLeavesInTask = FMath::Min(endAtThisShape-idxLeafs, chunckSize); const int nbLeavesInTask = FMath::Min(endAtThisShape-idxLeafs, chunckSize);
#pragma omp task #pragma omp task default(none) firstprivate(nbLeavesInTask,idxLeafs) shared(leafsDataArray)
{ {
KernelClass* myThreadkernels = (kernels[omp_get_thread_num()]); KernelClass* myThreadkernels = (kernels[omp_get_thread_num()]);
// There is a maximum of 26 neighbors // There is a maximum of 26 neighbors
......
...@@ -761,7 +761,7 @@ private: ...@@ -761,7 +761,7 @@ private:
{ {
const int chunckSize = FMath::Max(1, numberOfCells/(omp_get_num_threads()*omp_get_num_threads())); const int chunckSize = FMath::Max(1, numberOfCells/(omp_get_num_threads()*omp_get_num_threads()));
for(int idxCell = 0 ; idxCell < numberOfCells ; idxCell += chunckSize){ for(int idxCell = 0 ; idxCell < numberOfCells ; idxCell += chunckSize){
#pragma omp task #pragma omp task default(none) shared(numberOfCells,idxLevel,chunckSize) firstprivate(idxCell)
{ {
KernelClass * const myThreadkernels = kernels[omp_get_thread_num()]; KernelClass * const myThreadkernels = kernels[omp_get_thread_num()];
const CellClass* neighbors[343]; const CellClass* neighbors[343];
...@@ -783,11 +783,12 @@ private: ...@@ -783,11 +783,12 @@ private:
#pragma omp taskwait #pragma omp taskwait
for(int idxThread = 0 ; idxThread < omp_get_num_threads() ; ++idxThread){ for(int idxThread = 0 ; idxThread < omp_get_num_threads() ; ++idxThread){
#pragma omp task #pragma omp task default(none) firstprivate(idxThread) shared(idxLevel)
{ {
kernels[idxThread]->finishedLevelM2L(fackLevel); kernels[idxThread]->finishedLevelM2L(fackLevel);
} }
} }
#pragma omp taskwait
FLOG(computationCounter.tac()); FLOG(computationCounter.tac());
} }
...@@ -1347,7 +1348,7 @@ private: ...@@ -1347,7 +1348,7 @@ private:
for(int idxLeafs = previous ; idxLeafs < endAtThisShape ; idxLeafs += chunckSize){ for(int idxLeafs = previous ; idxLeafs < endAtThisShape ; idxLeafs += chunckSize){
const int nbLeavesInTask = FMath::Min(endAtThisShape-idxLeafs, chunckSize); const int nbLeavesInTask = FMath::Min(endAtThisShape-idxLeafs, chunckSize);
#pragma omp task #pragma omp task default(none) firstprivate(nbLeavesInTask,idxLeafs) shared(leafsDataArray)
{ {
KernelClass* myThreadkernels = (kernels[omp_get_thread_num()]); KernelClass* myThreadkernels = (kernels[omp_get_thread_num()]);
......
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