Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 94666686 authored by berenger-bramas's avatar berenger-bramas
Browse files

Rename variables to match with their reals types.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@76 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 02d1f00b
......@@ -171,11 +171,11 @@ public:
// for each levels
for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveUp();
octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft();
......@@ -185,10 +185,10 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
// We need the current cell and the child
// child is an array (of 8 child) that may be null
myThreadkernels->M2M( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel);
myThreadkernels->M2M( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel);
}
}
FDEBUG(computationCounter.tac());
......@@ -219,11 +219,11 @@ public:
// for each levels
for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
......@@ -234,9 +234,9 @@ public:
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
CellClass* neighbors[208];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxLeafs].getCurrentGlobalIndex(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxLeafs].getCurrentCell() , neighbors, counter, idxLevel);
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalIndex(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, counter, idxLevel);
}
}
FDEBUG(computationCounter.tac());
......@@ -259,11 +259,11 @@ public:
const int heightMinusOne = OctreeHeight - 1;
// for each levels exepted leaf level
for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
......@@ -273,8 +273,8 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
myThreadkernels->L2L( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel);
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
myThreadkernels->L2L( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel);
}
}
FDEBUG(computationCounter.tac());
......
......@@ -386,8 +386,8 @@ public:
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for nowait
for(int idxLeafs = startIdx ; idxLeafs < endIdx ; ++idxLeafs){
myThreadkernels->M2M( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel);
for(int idxCell = startIdx ; idxCell < endIdx ; ++idxCell){
myThreadkernels->M2M( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel);
}
#pragma omp single nowait
......@@ -401,18 +401,18 @@ public:
int parentOffset = numberOfCells - 1;
MortonIndex parentIndex = iterArray[parentOffset].getCurrentGlobalIndex();
for(int idxLeafs = previousRight ; idxLeafs >= previousLeft ; --idxLeafs){
const MortonIndex childIndex = previousIterArray[idxLeafs].getCurrentGlobalIndex() >> 3;
for(int idxCell = previousRight ; idxCell >= previousLeft ; --idxCell){
const MortonIndex childIndex = previousIterArray[idxCell].getCurrentGlobalIndex() >> 3;
while(childIndex != parentIndex){
--parentOffset;
parentIndex = iterArray[parentOffset].getCurrentGlobalIndex();
}
const int idxReceiver = getProc(parentOffset,numberOfCells);
if(!this->sendBuffer[idxReceiver].addEnoughSpace(previousIterArray[idxLeafs].getCurrentCell()->bytesToSendUp())){
if(!this->sendBuffer[idxReceiver].addEnoughSpace(previousIterArray[idxCell].getCurrentCell()->bytesToSendUp())){
app.sendData(idxReceiver,this->sendBuffer[idxReceiver].getSize(),this->sendBuffer[idxReceiver].getData(),idxLevel);
this->sendBuffer[idxReceiver].clear();
}
this->sendBuffer[idxReceiver].addDataUp(idxLeafs,*previousIterArray[idxLeafs].getCurrentCell());
this->sendBuffer[idxReceiver].addDataUp(idxCell,*previousIterArray[idxCell].getCurrentCell());
}
for(int idxProc = 0 ; idxProc < this->nbProcess ; ++idxProc){
......@@ -515,8 +515,8 @@ public:
}
#pragma omp for //schedule(dynamic)
for(int idxLeafs = startIdx ; idxLeafs < endIdx ; ++idxLeafs){
const int neighborsCounter = tree->getDistantNeighborsWithIndex(neighbors, neighborsIndexes, iterArray[idxLeafs].getCurrentGlobalIndex(),idxLevel);
for(int idxCell = startIdx ; idxCell < endIdx ; ++idxCell){
const int neighborsCounter = tree->getDistantNeighborsWithIndex(neighbors, neighborsIndexes, iterArray[idxCell].getCurrentGlobalIndex(),idxLevel);
bool needData = false;
......@@ -548,17 +548,17 @@ public:
FDEBUG(computationCounter.tac());
#pragma omp critical(CheckToSend)
{
if(!alreadySent[idxReceiver]->get(idxLeafs-startIdx)){
alreadySent[idxReceiver]->set(idxLeafs-startIdx,true);
if(!alreadySent[idxReceiver]->get(idxCell-startIdx)){
alreadySent[idxReceiver]->set(idxCell-startIdx,true);
needData = true;
if(!this->sendBuffer[idxReceiver].addEnoughSpace(iterArray[idxLeafs].getCurrentCell()->bytesToSendUp())){
if(!this->sendBuffer[idxReceiver].addEnoughSpace(iterArray[idxCell].getCurrentCell()->bytesToSendUp())){
FDEBUG(waitSendCounter.tic());
app.sendData(idxReceiver,this->sendBuffer[idxReceiver].getSize(),this->sendBuffer[idxReceiver].getData(),idxLevel);
FDEBUG(waitSendCounter.tac());
this->sendBuffer[idxReceiver].clear();
}
this->sendBuffer[idxReceiver].addDataUp(idxLeafs,*iterArray[idxLeafs].getCurrentCell());
this->sendBuffer[idxReceiver].addDataUp(idxCell,*iterArray[idxCell].getCurrentCell());
}
}
#pragma omp critical(CheckToReceive)
......@@ -575,16 +575,16 @@ public:
FDEBUG(computationCounter.tac());
// if need data we can not compute now
if(needData){
const int currentCell = idxLeafs - startIdx;
const int currentCell = idxCell - startIdx;
unfinishedCells[currentCell] = new LimitCell();
unfinishedCells[currentCell]->counter = neighborsCounter;
memcpy(unfinishedCells[currentCell]->neighbors,neighbors,sizeof(CellClass*)*neighborsCounter);
alreadySent[idPorcess]->set(idxLeafs-startIdx,true);
alreadySent[idPorcess]->set(idxCell-startIdx,true);
}
// we can compute now !
else if(neighborsCounter){
FDEBUG(computationCounter.tic());
myThreadkernels->M2L( iterArray[idxLeafs].getCurrentCell() , neighbors, neighborsCounter, idxLevel);
myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, neighborsCounter, idxLevel);
FDEBUG(computationCounter.tac());
}
FDEBUG(computationCounter.tic());
......@@ -636,10 +636,10 @@ public:
}
#pragma omp for nowait
for(int idxLeafs = startIdx ; idxLeafs < endIdx ; ++idxLeafs){
if(alreadySent[idPorcess]->get(idxLeafs-startIdx)){
myThreadkernels->M2L( iterArray[idxLeafs].getCurrentCell() , unfinishedCells[idxLeafs-startIdx]->neighbors, unfinishedCells[idxLeafs-startIdx]->counter, idxLevel);
delete unfinishedCells[idxLeafs-startIdx];
for(int idxCell = startIdx ; idxCell < endIdx ; ++idxCell){
if(alreadySent[idPorcess]->get(idxCell-startIdx)){
myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , unfinishedCells[idxCell-startIdx]->neighbors, unfinishedCells[idxCell-startIdx]->counter, idxLevel);
delete unfinishedCells[idxCell-startIdx];
}
}
......@@ -708,22 +708,22 @@ public:
{
FDEBUG(sendCounter.tic());
const int leftOffset = -leftOffsets[idxLevel];
for(int idxLeafs = 1 ; idxLeafs <= leftOffset ; ++idxLeafs){
const int idxReceiver = getProc((currentLeft-idxLeafs),numberOfCells);
if(!this->sendBuffer[idxReceiver].addEnoughSpace(iterArray[currentLeft-idxLeafs].getCurrentCell()->bytesToSendDown())){
for(int idxCell = 1 ; idxCell <= leftOffset ; ++idxCell){
const int idxReceiver = getProc((currentLeft-idxCell),numberOfCells);
if(!this->sendBuffer[idxReceiver].addEnoughSpace(iterArray[currentLeft-idxCell].getCurrentCell()->bytesToSendDown())){
app.sendData(idxReceiver,this->sendBuffer[idxReceiver].getSize(),this->sendBuffer[idxReceiver].getData(),idxLevel);
this->sendBuffer[idxReceiver].clear();
}
this->sendBuffer[idxReceiver].addDataDown(currentLeft-idxLeafs,*iterArray[currentLeft-idxLeafs].getCurrentCell());
this->sendBuffer[idxReceiver].addDataDown(currentLeft-idxCell,*iterArray[currentLeft-idxCell].getCurrentCell());
}
const int rightOffset = -rightOffsets[idxLevel];
for(int idxLeafs = 1 ; idxLeafs <= rightOffset ; ++idxLeafs){
const int idxReceiver = getProc((currentRight+idxLeafs),numberOfCells);
if(!this->sendBuffer[idxReceiver].addEnoughSpace(iterArray[currentRight+idxLeafs].getCurrentCell()->bytesToSendDown())){
for(int idxCell = 1 ; idxCell <= rightOffset ; ++idxCell){
const int idxReceiver = getProc((currentRight+idxCell),numberOfCells);
if(!this->sendBuffer[idxReceiver].addEnoughSpace(iterArray[currentRight+idxCell].getCurrentCell()->bytesToSendDown())){
app.sendData(idxReceiver,this->sendBuffer[idxReceiver].getSize(),this->sendBuffer[idxReceiver].getData(),idxLevel);
this->sendBuffer[idxReceiver].clear();
}
this->sendBuffer[idxReceiver].addDataDown(currentRight+idxLeafs,*iterArray[currentRight+idxLeafs].getCurrentCell());
this->sendBuffer[idxReceiver].addDataDown(currentRight+idxCell,*iterArray[currentRight+idxCell].getCurrentCell());
}
for(int idxProc = 0 ; idxProc < this->nbProcess ; ++idxProc){
......@@ -765,8 +765,8 @@ public:
{
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);
for(int idxCell = startIdx ; idxCell < endIdx ; ++idxCell){
myThreadkernels->L2L( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel);
}
}
FDEBUG(computationCounter.tac());
......@@ -795,21 +795,21 @@ public:
FDEBUG(FTic counterTime);
const int LeafIndex = OctreeHeight - 1;
int numberOfCells = 0;
int leafs = 0;
{
OctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
// for each cells
do{
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
iterArray[leafs] = octreeIterator;
++leafs;
} while(octreeIterator.moveRight());
}
FDEBUG(FTic computationCounter);
const int startIdx = getLeft(numberOfCells);
const int endIdx = getRight(numberOfCells);
const int startIdx = getLeft(leafs);
const int endIdx = getRight(leafs);
#pragma omp parallel
{
......
......@@ -81,13 +81,13 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
// Count leaf
int leafs = 0;
int numberOfLeafs = 0;
OctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
do{
++leafs;
++numberOfLeafs;
} while(octreeIterator.moveRight());
iterArray = new OctreeIterator[leafs];
iterArray = new OctreeIterator[numberOfLeafs];
assert(iterArray, "iterArray bad alloc", __LINE__, __FILE__);
bottomPass();
......@@ -110,12 +110,12 @@ public:
FDEBUG( FTic counterTime );
OctreeIterator octreeIterator(tree);
int leafs = 0;
int numberOfLeafs = 0;
// Iterate on leafs
octreeIterator.gotoBottomLeft();
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfLeafs] = octreeIterator;
++numberOfLeafs;
} while(octreeIterator.moveRight());
FDEBUG(FTic computationCounter);
......@@ -123,7 +123,7 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
for(int idxLeafs = 0 ; idxLeafs < numberOfLeafs ; ++idxLeafs){
// We need the current cell that represent the leaf
// and the list of particles
FList<ParticleClass*>* const sources = iterArray[idxLeafs].getCurrentListSrc();
......@@ -159,11 +159,11 @@ public:
// for each levels
for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveUp();
octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft();
......@@ -173,12 +173,12 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
// We need the current cell and the child
// child is an array (of 8 child) that may be null
CellClass* potentialChild[8];
CellClass** const realChild = iterArray[idxLeafs].getCurrentChild();
CellClass* const currentCell = iterArray[idxLeafs].getCurrentCell();
CellClass** const realChild = iterArray[idxCell].getCurrentChild();
CellClass* const currentCell = iterArray[idxCell].getCurrentCell();
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild){
potentialChild[idxChild] = 0;
if(realChild[idxChild]){
......@@ -218,11 +218,11 @@ public:
// for each levels
for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
......@@ -233,10 +233,10 @@ public:
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
CellClass* neighbors[208];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
CellClass* const currentCell = iterArray[idxLeafs].getCurrentCell();
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
CellClass* const currentCell = iterArray[idxCell].getCurrentCell();
if(currentCell->hasTargetsChild()){
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxLeafs].getCurrentGlobalIndex(),idxLevel);
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalIndex(),idxLevel);
int offsetTargetNeighbors = 0;
for(int idxRealNeighbors = 0 ; idxRealNeighbors < counter ; ++idxRealNeighbors, ++offsetTargetNeighbors){
if(neighbors[idxRealNeighbors]->hasSrcChild()){
......@@ -273,11 +273,11 @@ public:
const int heightMinusOne = OctreeHeight - 1;
// for each levels exepted leaf level
for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
......@@ -287,10 +287,10 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
CellClass* potentialChild[8];
CellClass** const realChild = iterArray[idxLeafs].getCurrentChild();
CellClass* const currentCell = iterArray[idxLeafs].getCurrentCell();
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];
......@@ -317,14 +317,14 @@ public:
FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); );
FDEBUG(FTic counterTime);
int leafs = 0;
int numberOfLeafs = 0;
{
OctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
// for each leafs
// for each leaf
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfLeafs] = octreeIterator;
++numberOfLeafs;
} while(octreeIterator.moveRight());
}
......@@ -337,7 +337,7 @@ public:
FList<ParticleClass*>* neighbors[26];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
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].getCurrentGlobalIndex(),heightMinusOne);
......
......@@ -81,13 +81,13 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::FMM, __FUNCTION__ , __FILE__ , __LINE__) );
// Count leaf
int leafs = 0;
int numberOfLeafs = 0;
OctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
do{
++leafs;
++numberOfLeafs;
} while(octreeIterator.moveRight());
iterArray = new OctreeIterator[leafs];
iterArray = new OctreeIterator[numberOfLeafs];
assert(iterArray, "iterArray bad alloc", __LINE__, __FILE__);
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
......@@ -114,12 +114,12 @@ public:
FDEBUG(FTic counterTime);
OctreeIterator octreeIterator(tree);
int leafs = 0;
int numberOfLeafs = 0;
// Iterate on leafs
octreeIterator.gotoBottomLeft();
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfLeafs] = octreeIterator;
++numberOfLeafs;
} while(octreeIterator.moveRight());
FDEBUG(FTic computationCounter);
......@@ -127,7 +127,7 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
for(int idxLeafs = 0 ; idxLeafs < numberOfLeafs ; ++idxLeafs){
// We need the current cell that represent the leaf
// and the list of particles
myThreadkernels->P2M( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentListSrc());
......@@ -155,11 +155,11 @@ public:
// for each levels
for(int idxLevel = OctreeHeight - 2 ; idxLevel > 1 ; --idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveUp();
octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft();
......@@ -169,10 +169,10 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
// We need the current cell and the child
// child is an array (of 8 child) that may be null
myThreadkernels->M2M( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel);
myThreadkernels->M2M( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel);
}
}
FDEBUG(computationCounter.tac());
......@@ -198,11 +198,11 @@ public:
// for each levels
for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
......@@ -213,9 +213,9 @@ public:
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
CellClass* neighbors[208];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxLeafs].getCurrentGlobalIndex(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxLeafs].getCurrentCell() , neighbors, counter, idxLevel);
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalIndex(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, counter, idxLevel);
}
}
FDEBUG(computationCounter.tac());
......@@ -237,11 +237,11 @@ public:
const int heightMinusOne = OctreeHeight - 1;
// for each levels exepted leaf level
for(int idxLevel = 2 ; idxLevel < heightMinusOne ; ++idxLevel ){
int leafs = 0;
int numberOfCells = 0;
// for each cells
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfCells] = octreeIterator;
++numberOfCells;
} while(octreeIterator.moveRight());
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
......@@ -251,8 +251,8 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
myThreadkernels->L2L( iterArray[idxLeafs].getCurrentCell() , iterArray[idxLeafs].getCurrentChild(), idxLevel);
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
myThreadkernels->L2L( iterArray[idxCell].getCurrentCell() , iterArray[idxCell].getCurrentChild(), idxLevel);
}
}
FDEBUG(computationCounter.tac());
......@@ -270,14 +270,14 @@ public:
FDEBUG( FDebug::Controller.write("\tStart Direct Pass\n").write(FDebug::Flush); );
FDEBUG(FTic counterTime);
int leafs = 0;
int numberOfLeafs = 0;
{
OctreeIterator octreeIterator(tree);
octreeIterator.gotoBottomLeft();
// for each leafs
// for each numberOfLeafs
do{
iterArray[leafs] = octreeIterator;
++leafs;
iterArray[numberOfLeafs] = octreeIterator;
++numberOfLeafs;
} while(octreeIterator.moveRight());
}
......@@ -290,7 +290,7 @@ public:
FList<ParticleClass*>* neighbors[26];
#pragma omp for
for(int idxLeafs = 0 ; idxLeafs < leafs ; ++idxLeafs){
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].getCurrentGlobalIndex(),heightMinusOne);
......
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