Commit ce429500 authored by berenger-bramas's avatar berenger-bramas

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
parent d9a0a706
...@@ -589,7 +589,7 @@ public: ...@@ -589,7 +589,7 @@ public:
const int idPorcess = processId(); const int idPorcess = processId();
// for each levels exepted leaf level // for each levels exepted leaf level
for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){ for(int idxLevel = 2 ; idxLevel <= heightMinusOne ; ++idxLevel ){
//print(); //print();
// keep data // keep data
...@@ -610,6 +610,8 @@ public: ...@@ -610,6 +610,8 @@ public:
const int startIdx = getLeft(idPorcess,leafs,nbProcess); const int startIdx = getLeft(idPorcess,leafs,nbProcess);
const int endIdx = getRight(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 currentLeft = startIdx;
const int currentRight = endIdx -1; const int currentRight = endIdx -1;
...@@ -655,14 +657,16 @@ public: ...@@ -655,14 +657,16 @@ public:
} }
} }
#pragma omp parallel num_threads(FThreadNumbers) if(idxLevel != heightMinusOne){
{ #pragma omp parallel num_threads(FThreadNumbers)
Kernel * const myThreadkernels = kernels[omp_get_thread_num()]; {
#pragma omp for Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
for(int idxLeafs = startIdx ; idxLeafs < endIdx ; ++idxLeafs){ #pragma omp for
myThreadkernels->L2L( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel); for(int idxLeafs = startIdx ; idxLeafs < endIdx ; ++idxLeafs){
myThreadkernels->L2L( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel);
}
} }
} }
processBarrier(); processBarrier();
} }
...@@ -791,6 +795,7 @@ public: ...@@ -791,6 +795,7 @@ public:
NbPart += octreeIterator.getCurrentListSrc()->getSize(); NbPart += octreeIterator.getCurrentListSrc()->getSize();
++NbLeafs; ++NbLeafs;
} while(octreeIterator.moveRight()); } while(octreeIterator.moveRight());
std::cout << "There is " << NbPart << " particles on " << NbLeafs << " Leafs" << std::endl;
} }
{ {
const int startIdx = getLeft(processId(),NbLeafs,processCount()); const int startIdx = getLeft(processId(),NbLeafs,processCount());
......
...@@ -40,7 +40,7 @@ int main(int argc, char ** argv){ ...@@ -40,7 +40,7 @@ int main(int argc, char ** argv){
const int NbLevels = 10;//10; const int NbLevels = 10;//10;
const int SizeSubLevels = 3;//3 const int SizeSubLevels = 3;//3
const long NbPart = 2000000;//2000000 const long NbPart = 2000;//2000000
FTestParticle* particles = new FTestParticle[NbPart]; FTestParticle* particles = new FTestParticle[NbPart];
FTic counter; FTic counter;
......
...@@ -87,9 +87,11 @@ int main(int argc, char ** argv){ ...@@ -87,9 +87,11 @@ int main(int argc, char ** argv){
counter.tic(); counter.tic();
TestParticle* particles = new TestParticle[loader.getNumberOfParticles()]; TestParticle* particles = new TestParticle[loader.getNumberOfParticles()];
TestParticle* particlesValide = new TestParticle[loader.getNumberOfParticles()];
for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){ for(int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticle(&particles[idxPart]); loader.fillParticle(&particles[idxPart]);
particlesValide[idxPart] = particles[idxPart];
} }
counter.tac(); counter.tac();
...@@ -109,7 +111,7 @@ int main(int argc, char ** argv){ ...@@ -109,7 +111,7 @@ int main(int argc, char ** argv){
counter.tic(); counter.tic();
for(long idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){ for(long idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
tree.insert(&particles[idxPart]); tree.insert(&particles[idxPart]);
treeValide.insert(&particles[idxPart]); treeValide.insert(&particlesValide[idxPart]);
} }
counter.tac(); counter.tac();
std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl; std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl;
...@@ -141,6 +143,7 @@ int main(int argc, char ** argv){ ...@@ -141,6 +143,7 @@ int main(int argc, char ** argv){
std::cout << "Deleting particles ..." << std::endl; std::cout << "Deleting particles ..." << std::endl;
counter.tic(); counter.tic();
delete [] particles; delete [] particles;
delete [] particlesValide;
counter.tac(); counter.tac();
std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl; std::cout << "Done " << "(" << counter.elapsed() << "s)." << std::endl;
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
......
...@@ -24,7 +24,7 @@ int main(int argc, char ** argv){ ...@@ -24,7 +24,7 @@ int main(int argc, char ** argv){
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// Nb of particles // Nb of particles
const long NbParticles = 20; const long NbParticles = 50000;
// Center of the box // Center of the box
const FReal XCenter = 0.5; const FReal XCenter = 0.5;
......
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