Commit 4038ff37 authored by berenger-bramas's avatar berenger-bramas
Browse files

Small omp modification in Threaded version :

nowait in most of loops to avoid double barrier.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@128 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 087d0f6a
...@@ -187,7 +187,7 @@ public: ...@@ -187,7 +187,7 @@ public:
#pragma omp parallel #pragma omp parallel
{ {
Kernel * const myThreadkernels = kernels[omp_get_thread_num()]; Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for #pragma omp for nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){ for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
// We need the current cell and the child // We need the current cell and the child
// child is an array (of 8 child) that may be null // child is an array (of 8 child) that may be null
...@@ -238,7 +238,7 @@ public: ...@@ -238,7 +238,7 @@ public:
Kernel * const myThreadkernels = kernels[omp_get_thread_num()]; Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
const CellClass* neighbors[208]; const CellClass* neighbors[208];
#pragma omp for #pragma omp for nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){ for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalCoordinate(),idxLevel); const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalCoordinate(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, counter, idxLevel); if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, counter, idxLevel);
...@@ -277,7 +277,7 @@ public: ...@@ -277,7 +277,7 @@ public:
#pragma omp parallel #pragma omp parallel
{ {
Kernel * const myThreadkernels = kernels[omp_get_thread_num()]; Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for #pragma omp for nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){ for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
myThreadkernels->L2L( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel); myThreadkernels->L2L( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel);
} }
......
...@@ -77,7 +77,7 @@ int main(int argc, char ** argv){ ...@@ -77,7 +77,7 @@ int main(int argc, char ** argv){
// FTestKernels FBasicKernels // FTestKernels FBasicKernels
FTestKernels<FTestParticle, FTestCell, FVector> kernels; FTestKernels<FTestParticle, FTestCell, FVector> kernels;
//FFmmAlgorithm FFmmAlgorithmThread //FFmmAlgorithm FFmmAlgorithmThread
FFmmAlgorithm<FTestKernels, FTestParticle, FTestCell, FVector, FSimpleLeaf> algo(&tree,&kernels); FFmmAlgorithmThread<FTestKernels, FTestParticle, FTestCell, FVector, FSimpleLeaf> algo(&tree,&kernels);
algo.execute(); algo.execute();
counter.tac(); counter.tac();
......
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