Commit ebaf0476 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

update fmm tsm

parent e1cc54c3
......@@ -313,18 +313,20 @@ public:
KernelClass * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for nowait
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
CellClass* potentialChild[8];
CellClass** const realChild = iterArray[idxCell].getCurrentChild();
CellClass* const currentCell = iterArray[idxCell].getCurrentCell();
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
if(realChild[idxChild] && realChild[idxChild]->hasTargetsChild()){
potentialChild[idxChild] = realChild[idxChild];
}
else{
potentialChild[idxChild] = 0;
if( iterArray[idxCell].getCurrentCell()->hasTargetsChild() ){
CellClass* potentialChild[8];
CellClass** const realChild = iterArray[idxCell].getCurrentChild();
CellClass* const currentCell = iterArray[idxCell].getCurrentCell();
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
if(realChild[idxChild] && realChild[idxChild]->hasTargetsChild()){
potentialChild[idxChild] = realChild[idxChild];
}
else{
potentialChild[idxChild] = 0;
}
}
myThreadkernels->L2L( currentCell , potentialChild, idxLevel);
}
myThreadkernels->L2L( currentCell , potentialChild, idxLevel);
}
}
FLOG(computationCounter.tac());
......@@ -362,12 +364,14 @@ public:
#pragma omp for schedule(dynamic) nowait
for(int idxLeafs = 0 ; idxLeafs < numberOfLeafs ; ++idxLeafs){
myThreadkernels->L2P(iterArray[idxLeafs].getCurrentCell(), iterArray[idxLeafs].getCurrentListTargets());
// need the current particles and neighbors particles
const int counter = tree->getLeafsNeighbors(neighbors, iterArray[idxLeafs].getCurrentGlobalCoordinate(),heightMinusOne);
neighbors[13] = iterArray[idxLeafs].getCurrentListSrc();
myThreadkernels->P2PRemote( iterArray[idxLeafs].getCurrentGlobalCoordinate(), iterArray[idxLeafs].getCurrentListTargets(),
iterArray[idxLeafs].getCurrentListSrc() , neighbors, counter);
if( iterArray[idxLeafs].getCurrentCell()->hasTargetsChild() ){
myThreadkernels->L2P(iterArray[idxLeafs].getCurrentCell(), iterArray[idxLeafs].getCurrentListTargets());
// need the current particles and neighbors particles
const int counter = tree->getLeafsNeighbors(neighbors, iterArray[idxLeafs].getCurrentGlobalCoordinate(),heightMinusOne);
neighbors[13] = iterArray[idxLeafs].getCurrentListSrc();
myThreadkernels->P2PRemote( iterArray[idxLeafs].getCurrentGlobalCoordinate(), iterArray[idxLeafs].getCurrentListTargets(),
iterArray[idxLeafs].getCurrentListSrc() , neighbors, counter + 1);
}
}
}
FLOG(computationCounter.tac());
......
......@@ -195,6 +195,7 @@ public:
do{
FLOG(computationCounter.tic());
CellClass* const currentCell = octreeIterator.getCurrentCell();
if(currentCell->hasTargetsChild()){
const int counter = tree->getInteractionNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(),idxLevel);
if( counter ){
......@@ -247,21 +248,23 @@ public:
FLOG(FTic counterTimeLevel);
// for each cells
do{
FLOG(computationCounter.tic());
CellClass* potentialChild[8];
CellClass** const realChild = octreeIterator.getCurrentChild();
CellClass* const currentCell = octreeIterator.getCurrentCell();
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
if(realChild[idxChild] && realChild[idxChild]->hasTargetsChild()){
potentialChild[idxChild] = realChild[idxChild];
}
else{
potentialChild[idxChild] = 0;
if( octreeIterator.getCurrentCell()->hasTargetsChild() ){
FLOG(computationCounter.tic());
CellClass* potentialChild[8];
CellClass** const realChild = octreeIterator.getCurrentChild();
CellClass* const currentCell = octreeIterator.getCurrentCell();
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
if(realChild[idxChild] && realChild[idxChild]->hasTargetsChild()){
potentialChild[idxChild] = realChild[idxChild];
}
else{
potentialChild[idxChild] = 0;
}
}
kernels->L2L( currentCell , potentialChild, idxLevel);
FLOG(computationCounter.tac());
FLOG(totalComputation += computationCounter.elapsed());
}
kernels->L2L( currentCell , potentialChild, idxLevel);
FLOG(computationCounter.tac());
FLOG(totalComputation += computationCounter.elapsed());
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
......@@ -291,15 +294,17 @@ public:
ContainerClass* neighbors[27];
// for each leafs
do{
FLOG(computationCounter.tic());
kernels->L2P(octreeIterator.getCurrentCell(), octreeIterator.getCurrentListTargets());
// need the current particles and neighbors particles
const int counter = tree->getLeafsNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(), heightMinusOne);
neighbors[13] = octreeIterator.getCurrentListSrc();
kernels->P2PRemote( octreeIterator.getCurrentGlobalCoordinate(), octreeIterator.getCurrentListTargets(),
octreeIterator.getCurrentListSrc() , neighbors, counter);
FLOG(computationCounter.tac());
FLOG(totalComputation += computationCounter.elapsed());
if( octreeIterator.getCurrentCell()->hasTargetsChild() ){
FLOG(computationCounter.tic());
kernels->L2P(octreeIterator.getCurrentCell(), octreeIterator.getCurrentListTargets());
// need the current particles and neighbors particles
const int counter = tree->getLeafsNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(), heightMinusOne);
neighbors[13] = octreeIterator.getCurrentListSrc();
kernels->P2PRemote( octreeIterator.getCurrentGlobalCoordinate(), octreeIterator.getCurrentListTargets(),
octreeIterator.getCurrentListSrc() , neighbors, counter + 1);
FLOG(computationCounter.tac());
FLOG(totalComputation += computationCounter.elapsed());
}
} while(octreeIterator.moveRight());
FLOG( counterTime.tac() );
......
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