Nous avons procédé ce jeudi matin 08 avril 2021 à une MAJ de sécurité urgente. Nous sommes passé de la version 13.9.3 à la version 13.9.5 les releases notes correspondantes sont ici:
https://about.gitlab.com/releases/2021/03/17/security-release-gitlab-13-9-4-released/
https://about.gitlab.com/releases/2021/03/31/security-release-gitlab-13-10-1-released/

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

Debug and test with tree coordinate on the cells.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@110 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 2e5564a4
......@@ -47,7 +47,7 @@ public:
* @param inLevel the current level of the computation
*/
virtual void M2L(CellClass* const FRestrict local, const CellClass* distantNeighbors[208],
const FTreeCoordinate& inCurrentPosition, FTreeCoordinate inNeighborsPosition[208], const int size, const int inLevel) = 0;
const int size, const int inLevel) = 0;
/**
* L2L
......
......@@ -35,7 +35,7 @@ public:
}
/** Print the morton index */
virtual void M2L(CellClass* const FRestrict , const CellClass* [], const FTreeCoordinate& , FTreeCoordinate [], const int , const int ) {
virtual void M2L(CellClass* const FRestrict , const CellClass* [], const int , const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
}
......
......@@ -48,7 +48,7 @@ public:
}
// Before Downward
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208], const FTreeCoordinate& , FTreeCoordinate [208], const int size, const int ) {
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208], const int size, const int ) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// The pole is impacted by what represent other poles
for(int idx = 0 ; idx < size ; ++idx){
......
......@@ -548,6 +548,13 @@ public:
return this->current.tree->cellsAt(this->currentLocalLevel)[this->currentLocalIndex]->getMortonIndex();
}
/** To get the tree coordinate of the current working cell
*
*/
const FTreeCoordinate& getCurrentGlobalCoordinate() const{
return this->current.tree->cellsAt(this->currentLocalLevel)[this->currentLocalIndex]->getCoordinate();
}
};
// To be able to access octree root & data
......@@ -676,16 +683,13 @@ public:
* @return the number of neighbors
*/
int getDistantNeighbors(const CellClass* inNeighbors[208],
FTreeCoordinate& inCurrentPosition, FTreeCoordinate inNeighborsPosition[208],
const MortonIndex inIndex, const int inLevel) const{
const FTreeCoordinate& workingCell,
const int inLevel) const{
// Then take each child of the parent's neighbors if not in directNeighbors
// Father coordinate
inCurrentPosition.setPositionFromMorton(inIndex,inLevel);
const FTreeCoordinate parentCell(inCurrentPosition.getX()>>1,inCurrentPosition.getY()>>1,inCurrentPosition.getZ()>>1);
// the current cell
FTreeCoordinate workingCell;
workingCell.setPositionFromMorton(inIndex, inLevel);
const FTreeCoordinate parentCell(workingCell.getX()>>1,workingCell.getY()>>1,workingCell.getZ()>>1);
// Limite at parent level number of box (split by 2 by level)
const long limite = FMath::pow(2,inLevel-1);
......@@ -713,8 +717,11 @@ public:
// For each child
for(int idxCousin = 0 ; idxCousin < 8 ; ++idxCousin){
if(cells[idxCousin]){
FTreeCoordinate potentialNeighbor;
potentialNeighbor.setPositionFromMorton(mortonOther | idxCousin, inLevel);
//FTreeCoordinate potentialNeighbor;
//potentialNeighbor.setPositionFromMorton(mortonOther | idxCousin, inLevel);
const FTreeCoordinate potentialNeighbor((other.getX()<<1) | (idxCousin>>2 & 1),
(other.getY()<<1) | (idxCousin>>1 & 1),
(other.getZ()<<1) | (idxCousin&1));
// Test if it is a direct neighbor
if(FMath::Abs(workingCell.getX() - potentialNeighbor.getX()) > 1 ||
......@@ -722,9 +729,6 @@ public:
FMath::Abs(workingCell.getZ() - potentialNeighbor.getZ()) > 1){
// add to neighbors
inNeighbors[idxNeighbors] = cells[idxCousin];
inNeighborsPosition[idxNeighbors] = FTreeCoordinate((other.getX()<<1) | (idxCousin>>2 & 1),
(other.getY()<<1) | (idxCousin>>1 & 1),
(other.getZ()<<1) | (idxCousin&1));
++idxNeighbors;
}
}
......
......@@ -324,12 +324,7 @@ public:
if( !this->leafs[arrayIndex] ){
this->leafs[arrayIndex] = new LeafClass<ParticleClass>();
const FTreeCoordinate hostAtLevel(
host.getX() >> (inTreeHeight - (this->subOctreeHeight + this->subOctreePosition) ),
host.getY() >> (inTreeHeight - (this->subOctreeHeight + this->subOctreePosition) ),
host.getZ() >> (inTreeHeight - (this->subOctreeHeight + this->subOctreePosition) ));
FAbstractSubOctree<ParticleClass,CellClass,LeafClass>::newLeafInserted( arrayIndex , index, hostAtLevel, inBoxWidthAtLevel);
FAbstractSubOctree<ParticleClass,CellClass,LeafClass>::newLeafInserted( arrayIndex , index, host, inBoxWidthAtLevel);
}
// add particle to leaf list
this->leafs[arrayIndex]->push(inParticle);
......@@ -451,8 +446,13 @@ public:
this->subleafs[arrayIndex] = new FSubOctreeWithLeafs<ParticleClass,CellClass,LeafClass>(this,arrayIndex,nextSubOctreeHeight,nextSubOctreePosition);
}
const FTreeCoordinate hostAtLevel(
host.getX() >> (inTreeHeight - nextSubOctreePosition ),
host.getY() >> (inTreeHeight - nextSubOctreePosition ),
host.getZ() >> (inTreeHeight - nextSubOctreePosition ));
// We need to inform parent class
FAbstractSubOctree<ParticleClass,CellClass,LeafClass>::newLeafInserted( arrayIndex, index >> (3 * (inTreeHeight-nextSubOctreePosition) ), host, inBoxWidthAtLevel);
FAbstractSubOctree<ParticleClass,CellClass,LeafClass>::newLeafInserted( arrayIndex, index >> (3 * (inTreeHeight-nextSubOctreePosition) ), hostAtLevel, inBoxWidthAtLevel);
}
// Ask next suboctree to insert the particle
this->subleafs[arrayIndex]->insert( index, host, inParticle, inTreeHeight, inBoxWidthAtLevel);
......
......@@ -176,9 +176,16 @@ public:
* @param other the coordinate to compare
* @return true if other & current object have same position
*/
bool operator==(const FTreeCoordinate& other){
bool operator==(const FTreeCoordinate& other) const {
return x == other.x && y == other.y && z == other.z;
}
/** To test difference
*
*/
bool operator!=(const FTreeCoordinate& other) const{
return x != other.x || y != other.y || z != other.z;
}
};
......
......@@ -156,16 +156,14 @@ public:
FOctreeIterator avoidGotoLeftIterator(octreeIterator);
const CellClass* neighbors[208];
FTreeCoordinate currentPosition;
FTreeCoordinate neighborsPosition[208];
// for each levels
for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){
// for each cells
do{
const int counter = tree->getDistantNeighbors(neighbors, currentPosition, neighborsPosition, octreeIterator.getCurrentGlobalIndex(),idxLevel);
const int counter = tree->getDistantNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(), idxLevel);
FDEBUG(computationCounter.tic());
if(counter) kernels->M2L( octreeIterator.getCurrentCell() , neighbors, currentPosition, neighborsPosition, counter, idxLevel);
if(counter) kernels->M2L( octreeIterator.getCurrentCell() , neighbors, counter, idxLevel);
FDEBUG(computationCounter.tac());
} while(octreeIterator.moveRight());
......
......@@ -237,13 +237,11 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
const CellClass* neighbors[208];
FTreeCoordinate currentPosition;
FTreeCoordinate neighborsPosition[208];
#pragma omp for
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
const int counter = tree->getDistantNeighbors(neighbors, currentPosition, neighborsPosition, iterArray[idxCell].getCurrentGlobalIndex(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, currentPosition, neighborsPosition, counter, idxLevel);
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalCoordinate(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, counter, idxLevel);
}
}
FDEBUG(computationCounter.tac());
......
......@@ -474,7 +474,7 @@ public:
FBoolArray* const indexToReceive = new FBoolArray(1 << (3*(OctreeHeight-1)));
struct LimitCell { int counter; const CellClass* neighbors[208]; FTreeCoordinate currentPosition; FTreeCoordinate neighborsPosition[208]; };
struct LimitCell { int counter; const CellClass* neighbors[208]; };
LimitCell ** const unfinishedCells = new LimitCell*[this->leafRight - this->leafLeft + 1];
FBoolArray* alreadySent[this->nbProcess];
......@@ -516,8 +516,6 @@ public:
#pragma omp parallel
{
const CellClass* neighbors[208];
FTreeCoordinate currentPosition;
FTreeCoordinate neighborsPosition[208];
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
......@@ -529,7 +527,7 @@ public:
#pragma omp for //schedule(dynamic)
for(int idxCell = startIdx ; idxCell < endIdx ; ++idxCell){
const int neighborsCounter = tree->getDistantNeighbors(neighbors, currentPosition, neighborsPosition, iterArray[idxCell].getCurrentGlobalIndex(),idxLevel);
const int neighborsCounter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalCoordinate(),idxLevel);
bool needData = false;
......@@ -592,18 +590,15 @@ public:
unfinishedCells[currentCell] = new LimitCell();
unfinishedCells[currentCell]->counter = neighborsCounter;
unfinishedCells[currentCell]->currentPosition = currentPosition;
memcpy(unfinishedCells[currentCell]->neighbors,neighbors,sizeof(CellClass*)*neighborsCounter);
memcpy(unfinishedCells[currentCell]->neighborsPosition,neighborsPosition,sizeof(FTreeCoordinate)*neighborsCounter);
alreadySent[idPorcess]->set(idxCell-startIdx,true);
}
// we can compute now !
else if(neighborsCounter){
FDEBUG(computationCounter.tic());
myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, currentPosition, neighborsPosition, neighborsCounter, idxLevel);
myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, neighborsCounter, idxLevel);
FDEBUG(computationCounter.tac());
}
FDEBUG(computationCounter.tic());
......@@ -660,7 +655,6 @@ public:
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]->currentPosition, unfinishedCells[idxCell-startIdx]->neighborsPosition,
unfinishedCells[idxCell-startIdx]->counter, idxLevel);
delete unfinishedCells[idxCell-startIdx];
}
......
......@@ -234,14 +234,12 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
const CellClass* neighbors[208];
FTreeCoordinate currentPosition;
FTreeCoordinate neighborsPosition[208];
#pragma omp for
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
CellClass* const currentCell = iterArray[idxCell].getCurrentCell();
if(currentCell->hasTargetsChild()){
const int counter = tree->getDistantNeighbors(neighbors, currentPosition, neighborsPosition, iterArray[idxCell].getCurrentGlobalIndex(),idxLevel);
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalCoordinate(),idxLevel);
int offsetTargetNeighbors = 0;
for(int idxRealNeighbors = 0 ; idxRealNeighbors < counter ; ++idxRealNeighbors, ++offsetTargetNeighbors){
if(neighbors[idxRealNeighbors]->hasSrcChild()){
......@@ -254,7 +252,7 @@ public:
}
}
if(offsetTargetNeighbors){
myThreadkernels->M2L( currentCell , neighbors, currentPosition, neighborsPosition, offsetTargetNeighbors, idxLevel);
myThreadkernels->M2L( currentCell , neighbors, offsetTargetNeighbors, idxLevel);
}
}
}
......
......@@ -214,13 +214,11 @@ public:
{
Kernel * const myThreadkernels = kernels[omp_get_thread_num()];
CellClass* neighbors[208];
FTreeCoordinate currentPosition;
FTreeCoordinate neighborsPosition[208];
#pragma omp for
for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){
const int counter = tree->getDistantNeighbors(neighbors, currentPosition, neighborsPosition, iterArray[idxCell].getCurrentGlobalIndex(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , currentPosition, neighborsPosition, neighbors, counter, idxLevel);
const int counter = tree->getDistantNeighbors(neighbors, iterArray[idxCell].getCurrentGlobalCoordinate(),idxLevel);
if(counter) myThreadkernels->M2L( iterArray[idxCell].getCurrentCell() , neighbors, counter, idxLevel);
}
}
FDEBUG(computationCounter.tac());
......
......@@ -174,8 +174,6 @@ public:
FOctreeIterator avoidGotoLeftIterator(octreeIterator);
CellClass* neighbors[208];
FTreeCoordinate currentPosition;
FTreeCoordinate neighborsPosition[208];
// for each levels
for(int idxLevel = 2 ; idxLevel < OctreeHeight ; ++idxLevel ){
......@@ -184,7 +182,7 @@ public:
FDEBUG(computationCounter.tic());
CellClass* const currentCell = octreeIterator.getCurrentCell();
if(currentCell->hasTargetsChild()){
const int counter = tree->getDistantNeighbors(neighbors, currentPosition, neighborsPosition, octreeIterator.getCurrentGlobalIndex(),idxLevel);
const int counter = tree->getDistantNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(),idxLevel);
int offsetTargetNeighbors = 0;
for(int idxRealNeighbors = 0 ; idxRealNeighbors < counter ; ++idxRealNeighbors, ++offsetTargetNeighbors){
if(neighbors[idxRealNeighbors]->hasSrcChild()){
......@@ -197,7 +195,7 @@ public:
}
}
if(offsetTargetNeighbors){
kernels->M2L( currentCell , neighbors, currentPosition, neighborsPosition, offsetTargetNeighbors, idxLevel);
kernels->M2L( currentCell , neighbors, offsetTargetNeighbors, idxLevel);
}
}
FDEBUG(computationCounter.tac());
......
......@@ -837,11 +837,12 @@ public:
*
*/
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208],
const FTreeCoordinate& coordCenter, FTreeCoordinate inNeighborsPosition[208], const int size, const int inLevel) {
const int size, const int inLevel) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
const FTreeCoordinate& coordCenter = pole->getCoordinate();
for(int idxSize = 0 ; idxSize < size ; ++idxSize){
const FTreeCoordinate& coordNeighbors = inNeighborsPosition[idxSize];
const FTreeCoordinate& coordNeighbors = distantNeighbors[idxSize]->getCoordinate();
// printf("Morton = %lld\n",pole->getMortonIndex());
//printf("\tMorton Neighbors = %lld\n",distantNeighbors[idxSize]->getMortonIndex());
......
......@@ -909,11 +909,12 @@ public:
*
*/
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208],
const FTreeCoordinate& coordCenter, FTreeCoordinate inNeighborsPosition[208], const int size, const int inLevel) {
const int size, const int inLevel) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
const FTreeCoordinate& coordCenter = pole->getCoordinate();
for(int idxSize = 0 ; idxSize < size ; ++idxSize){
const FTreeCoordinate& coordNeighbors = inNeighborsPosition[idxSize];
const FTreeCoordinate& coordNeighbors = distantNeighbors[idxSize]->getCoordinate();
///printf("Morton = %lld\n",pole->getMortonIndex());
///printf("\tMorton Neighbors = %lld\n",distantNeighbors[idxSize]->getMortonIndex());
......
......@@ -1213,11 +1213,12 @@ public:
*
*/
void M2L(CellClass* const FRestrict pole, const CellClass* distantNeighbors[208],
const FTreeCoordinate& coordCenter, FTreeCoordinate inNeighborsPosition[208], const int size, const int inLevel) {
const int size, const int inLevel) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
const FTreeCoordinate& coordCenter = pole->getCoordinate();
for(int idxSize = 0 ; idxSize < size ; ++idxSize){
const FTreeCoordinate& coordNeighbors = inNeighborsPosition[idxSize];
const FTreeCoordinate& coordNeighbors = distantNeighbors[idxSize]->getCoordinate();
//printf("Morton = %lld\n",pole->getMortonIndex());
//printf("\tMorton Neighbors = %lld\n",distantNeighbors[idxSize]->getMortonIndex());
......
#ifndef FGLOBAL_HPP
#define FGLOBAL_HPP
#include "ScalFmmConfig.h"
//#include "ScalFmmConfig.h"
#include <stdlib.h>
///////////////////////////////////////////////////////
......
......@@ -40,7 +40,7 @@ int main(int argc, char ** argv){
const int NbLevels = 6;//10;
const int SizeSubLevels = 3;//3
const long NbPart = 200000;//2000000
const long NbPart = 20000;//2000000
FTic counter;
......@@ -75,7 +75,7 @@ int main(int argc, char ** argv){
// FTestKernels FBasicKernels
FTestKernels<FTestParticle, FTestCell> kernels;
//FFmmAlgorithm FFmmAlgorithmThread
FFmmAlgorithmThread<FTestKernels, FTestParticle, FTestCell, FSimpleLeaf> algo(&tree,&kernels);
FFmmAlgorithm<FTestKernels, FTestParticle, FTestCell, FSimpleLeaf> algo(&tree,&kernels);
algo.execute();
counter.tac();
......
......@@ -205,10 +205,8 @@ int main(int argc, char ** argv){
}
const FBasicCell* neighbors[208];
FTreeCoordinate currentPosition;
FTreeCoordinate neighborsPosition[208];
M2LCalculusAtLevel[idxArray] += tree.getDistantNeighbors(neighbors, currentPosition, neighborsPosition, octreeIterator.getCurrentGlobalIndex(),idxLevel);
M2LCalculusAtLevel[idxArray] += tree.getDistantNeighbors(neighbors, octreeIterator.getCurrentGlobalCoordinate(),idxLevel);
} while(octreeIterator.moveRight());
......
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