From ce4295007c536b15fa381f6755d3379ff515da56 Mon Sep 17 00:00:00 2001 From: berenger-bramas Date: Thu, 28 Apr 2011 12:16:06 +0000 Subject: [PATCH] MPI Algo validate with 50.000 particles. But need to be validate for a the FMB computation. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@64 2616d619-271b-44dc-8df4-d4a8f33a7222 --- Src/Core/FFmmAlgorithmThreadProc.hpp | 21 +++++++++++++-------- Tests/testFmmAlgorithm.cpp | 2 +- Tests/testFmmAlgorithmProc.cpp | 5 ++++- Tests/testLoaderFMACreate.cpp | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Src/Core/FFmmAlgorithmThreadProc.hpp b/Src/Core/FFmmAlgorithmThreadProc.hpp index 9d1ca52f..f53c638c 100644 --- a/Src/Core/FFmmAlgorithmThreadProc.hpp +++ b/Src/Core/FFmmAlgorithmThreadProc.hpp @@ -589,7 +589,7 @@ public: const int idPorcess = processId(); // for each levels exepted leaf level - for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){ + for(int idxLevel = 2 ; idxLevel <= heightMinusOne ; ++idxLevel ){ //print(); // keep data @@ -610,6 +610,8 @@ public: const int startIdx = getLeft(idPorcess,leafs,nbProcess); const int endIdx = getRight(idPorcess,leafs,nbProcess); + std::cout << "At level " << idxLevel << " left " << startIdx << " right " << endIdx << std::endl; + const int currentLeft = startIdx; const int currentRight = endIdx -1; @@ -655,14 +657,16 @@ public: } } - #pragma omp parallel num_threads(FThreadNumbers) - { - Kernel * const myThreadkernels = kernels[omp_get_thread_num()]; - #pragma omp for - for(int idxLeafs = startIdx ; idxLeafs < endIdx ; ++idxLeafs){ - myThreadkernels->L2L( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel); + if(idxLevel != heightMinusOne){ + #pragma omp parallel num_threads(FThreadNumbers) + { + Kernel * const myThreadkernels = kernels[omp_get_thread_num()]; + #pragma omp for + for(int idxLeafs = startIdx ; idxLeafs < endIdx ; ++idxLeafs){ + myThreadkernels->L2L( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel); + } } - } + } processBarrier(); } @@ -791,6 +795,7 @@ public: NbPart += octreeIterator.getCurrentListSrc()->getSize(); ++NbLeafs; } while(octreeIterator.moveRight()); + std::cout << "There is " << NbPart << " particles on " << NbLeafs << " Leafs" << std::endl; } { const int startIdx = getLeft(processId(),NbLeafs,processCount()); diff --git a/Tests/testFmmAlgorithm.cpp b/Tests/testFmmAlgorithm.cpp index 4f5f1b05..481715b8 100644 --- a/Tests/testFmmAlgorithm.cpp +++ b/Tests/testFmmAlgorithm.cpp @@ -40,7 +40,7 @@ int main(int argc, char ** argv){ const int NbLevels = 10;//10; const int SizeSubLevels = 3;//3 - const long NbPart = 2000000;//2000000 + const long NbPart = 2000;//2000000 FTestParticle* particles = new FTestParticle[NbPart]; FTic counter; diff --git a/Tests/testFmmAlgorithmProc.cpp b/Tests/testFmmAlgorithmProc.cpp index c13cd1a6..dc1e8507 100644 --- a/Tests/testFmmAlgorithmProc.cpp +++ b/Tests/testFmmAlgorithmProc.cpp @@ -87,9 +87,11 @@ int main(int argc, char ** argv){ counter.tic(); TestParticle* particles = new TestParticle[loader.getNumberOfParticles()]; + TestParticle* particlesValide = new TestParticle[loader.getNumberOfParticles()]; for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){ loader.fillParticle(&particles[idxPart]); + particlesValide[idxPart] = particles[idxPart]; } counter.tac(); @@ -109,7 +111,7 @@ int main(int argc, char ** argv){ counter.tic(); for(long idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){ tree.insert(&particles[idxPart]); - treeValide.insert(&particles[idxPart]); + treeValide.insert(&particlesValide[idxPart]); } counter.tac(); std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl; @@ -141,6 +143,7 @@ int main(int argc, char ** argv){ std::cout << "Deleting particles ..." << std::endl; counter.tic(); delete [] particles; + delete [] particlesValide; counter.tac(); std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl; ////////////////////////////////////////////////////////////////////////////////// diff --git a/Tests/testLoaderFMACreate.cpp b/Tests/testLoaderFMACreate.cpp index 1c8f4711..e83ba5bd 100644 --- a/Tests/testLoaderFMACreate.cpp +++ b/Tests/testLoaderFMACreate.cpp @@ -24,7 +24,7 @@ int main(int argc, char ** argv){ ////////////////////////////////////////////////////////////// // Nb of particles - const long NbParticles = 20; + const long NbParticles = 50000; // Center of the box const FReal XCenter = 0.5; -- GitLab