From 2c712543dd9a00f953ff757ce0ac90effdceeed8 Mon Sep 17 00:00:00 2001
From: berenger-bramas <berenger-bramas@2616d619-271b-44dc-8df4-d4a8f33a7222>
Date: Wed, 8 Jun 2011 15:53:48 +0000
Subject: [PATCH] Add "schedule(dynamic)" to loop for P2P for threaded version.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@118 2616d619-271b-44dc-8df4-d4a8f33a7222
---
 Src/Core/FFmmAlgorithmThread.hpp     | 2 +-
 Src/Core/FFmmAlgorithmThreadProc.hpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Src/Core/FFmmAlgorithmThread.hpp b/Src/Core/FFmmAlgorithmThread.hpp
index 506ff6544..ac1a69caf 100644
--- a/Src/Core/FFmmAlgorithmThread.hpp
+++ b/Src/Core/FFmmAlgorithmThread.hpp
@@ -358,7 +358,7 @@ public:
             for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){
                 const int endAtThisShape = this->shapeLeaf[idxShape] + previous;
 
-                #pragma omp for
+                #pragma omp for schedule(dynamic)
                 for(int idxLeafs = previous ; idxLeafs < endAtThisShape ; ++idxLeafs){
                     LeafData& currentIter = leafsDataArray[idxLeafs];
                     myThreadkernels.L2P(currentIter.cell, currentIter.targets);
diff --git a/Src/Core/FFmmAlgorithmThreadProc.hpp b/Src/Core/FFmmAlgorithmThreadProc.hpp
index 9db4ca8e5..3b6e5d6bc 100644
--- a/Src/Core/FFmmAlgorithmThreadProc.hpp
+++ b/Src/Core/FFmmAlgorithmThreadProc.hpp
@@ -876,7 +876,7 @@ public:
             for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){
                 const int leafAtThisShape = shapeLeaf[idxShape];
 
-                #pragma omp for
+                #pragma omp for schedule(dynamic)
                 for(int idxLeafs = startIdx ; idxLeafs < leafAtThisShape ; ++idxLeafs){
                     OctreeIterator currentIter = shapeArray[idxShape][idxLeafs];
                     myThreadkernels->L2P(currentIter.getCurrentCell(), currentIter.getCurrentListTargets());
-- 
GitLab