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:
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());
......
......@@ -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;
......
......@@ -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;
//////////////////////////////////////////////////////////////////////////////////
......
......@@ -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;
......
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