Commit 98cc61e5 authored by COULAUD Olivier's avatar COULAUD Olivier

Remove dead code, fix compilation error with OptiDis

parent 790b6440
......@@ -10,26 +10,32 @@
* @brief The FFmmOperations enum
* To chose which operation has to be performed.
*/
///
/// \brief The FFmmOperations enum
/// To chose which operation has to be performed in the methode execute of the Fmm algorithm.
///
enum FFmmOperations {
FFmmP2P = (1 << 0),
FFmmP2M = (1 << 1),
FFmmM2M = (1 << 2),
FFmmM2L = (1 << 3),
FFmmL2L = (1 << 4),
FFmmL2P = (1 << 5),
FFmmP2L = (1 << 6),
FFmmM2P = (1 << 7),
FFmmP2P = (1 << 0), ///< Particles to Particles operator (Near field)
FFmmP2M = (1 << 1), ///< Particles to Multipole operator (Far field)
FFmmM2M = (1 << 2), ///< Multipole to Multipole operator (Far field)
FFmmM2L = (1 << 3), ///< Multipole to Local operator (Far field)
FFmmL2L = (1 << 4), ///< Local to Local operator (Far field)
FFmmL2P = (1 << 5), ///< Local to Particles operator (Far field)
FFmmP2L = (1 << 6), ///< Particles to Local operator (Far field in Adaptive algorithm)
FFmmM2P = (1 << 7), ///< Multipole to Particles operator (Far field in Adaptive algorithm)
//
FFmmNearField = FFmmP2P,
FFmmFarField = (FFmmP2M|FFmmM2M|FFmmM2L|FFmmL2L|FFmmL2P|FFmmM2P|FFmmP2L),
FFmmNearField = FFmmP2P, ///< Near field operator
FFmmFarField = (FFmmP2M|FFmmM2M|FFmmM2L|FFmmL2L|FFmmL2P|FFmmM2P|FFmmP2L), ///< Only Far Field operators
//
FFmmNearAndFarFields = (FFmmNearField|FFmmFarField)
FFmmNearAndFarFields = (FFmmNearField|FFmmFarField) ///< Near and far field operators
};
std::string FFmmOperations_string(/*enum FFmmOperations*/ const unsigned int & value){
///
/// \brief FFmmOperations_string converts the FFmmOperations (enum) in string
/// \param value the FFmmOperations
/// \return the string corresponding to the FFmmOperations
///
inline std::string FFmmOperations_string(/*enum FFmmOperations*/ const unsigned int & value){
//if (value & FFmmNearAndFarFields) return std::string("FFmmNearAndFarFields") ;
//if (value & FFmmFarField) return std::string("FFmmFarField") ;
//if (value & FFmmNearField) return std::string("FFmmNearField" );
std::string op("");
if (value & FFmmP2P)
op += " FFmmP2P |";
......
......@@ -7,6 +7,7 @@
#include <algorithm>
#include <array>
#include <vector>
#include <memory>
#include "Utils/FAssert.hpp"
#include "Utils/FLog.hpp"
......@@ -36,7 +37,6 @@
#include "Utils/FAlgorithmTimers.hpp"
#include <memory>
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -861,37 +861,7 @@ protected:
counterProc += 1;
}
}
// }
#ifdef USEQALGO
// set the reecived
// std::copy(currentChild, currentChild+8,
// std::begin(child_symbolics));
typename OctreeClass::Iterator octreeIterator(tree);
octreeIterator.gotoLeft();
// multipole_t* const real_tree_root_multipole
// = &((&upperCells[offsetRealTree-1])->getMultipoleData());
// const symbolic_data_t* const real_tree_root_symbolic
// = &(upperCells[offsetRealTree-1]);
CellClass** children = octreeIterator.getCurrentBox();
std::transform(currentChild, currentChild + 8,
std::begin(children),
[](const CellClass* c) {
return (c == nullptr)
? nullptr
: &(c->getMultipoleData());
});
// std::copy(currentChild, currentChild+8,
// std::begin(child_symbolics));
// std::copy(currentChild, currentChild+8,
// std::begin(children));
this->processPeriodicLevelsSEQ();
#else
// Build expansion at the rootCellFromProc
multipole_t* parent_multipole = &(rootCellFromProc.getMultipoleData());
const symbolic_data_t* parent_symbolic = &(rootCellFromProc);
......@@ -927,7 +897,6 @@ protected:
/// Treat at root level the periodicity
///
this->processPeriodicLevels();
#endif
}
else {
// OTHER PROCESS (NOT 0)
......@@ -1708,14 +1677,13 @@ protected:
// set an other tree To store the result
//
OctreeClass otherP2Ptree( tree->getHeight(), tree->getSubHeight(),
tree->getBoxWidth(), tree->getBoxCenter() );
boxWidth, tree->getBoxCenter() );
// init
const int LeafIndex = OctreeHeight - 1;
const int SizeShape = P2PExclusionClass::SizeShape;
int shapeLeaf[SizeShape]{};
// memset(shapeLeaf,0,SizeShape*sizeof(int));
LeafData* const leafsDataArray = new LeafData[this->numberOfLeafs];
......@@ -1785,16 +1753,6 @@ protected:
if(needOther){ //means that something need to be sent (or received)
leafsNeedOther.set(idxLeaf,true);
++countNeedOther;
// std::cout << " Leaf "<< iterArray[idxLeaf].getCurrentGlobalCoordinate().getMortonIndex() << std::endl ;
// for(int i = 0 ; i < nbProcess ; ++i ){
// std::cout << " "<< i << " alreadySent " << alreadySent[i]<< " " << toSend[i].size() <<" : ";
// for(int j = 0 ; j < toSend[i].size() ; ++j ){
// std::cout << " " << toSend[i][j].getCurrentGlobalCoordinate().getMortonIndex() ;
// }
// std::cout << std::endl;
// }
}
}
}
......@@ -1901,18 +1859,6 @@ protected:
delete recvBuffer[idxProc];
}
delete[] globalReceiveMap;
// DEBUG
//
// Check the new tree
// std::cout <<"otherP2Ptree " << std::endl;
// otherP2Ptree.forEachCellLeaf([&](CellClass* LeafCell, LeafClass* leaf){
// std::cout << LeafCell->getMortonIndex() <<" leaf " << leaf << " source " <<leaf->getSrc() << std::endl;
// } );
// std::cout << std::endl;
}
// END MASTER
///////////////////////////////////////////////////
......@@ -1983,7 +1929,7 @@ protected:
for(int idxLeafs = previous ; idxLeafs < endAtThisShape ; idxLeafs += chunckSize){
const int nbLeavesInTask = FMath::Min(endAtThisShape-idxLeafs, chunckSize);
#pragma omp task default(none) firstprivate(nbLeavesInTask,idxLeafs) shared(std::cout)
#pragma omp task default(none) firstprivate(nbLeavesInTask,idxLeafs)
{
KernelClass* myThreadkernels = (kernels[omp_get_thread_num()]);
......@@ -1997,7 +1943,7 @@ protected:
// Compute L2P operator
if(l2pEnabled){
const local_expansion_t* leaf_local_expansion = &(currentIter.cell->getLocalExpansionData());
const symbolic_data_t* leaf_symbolic = currentIter.cell;
const symbolic_data_t* leaf_symbolic = currentIter.cell;
myThreadkernels->L2P(
leaf_local_expansion,
leaf_symbolic,
......@@ -2012,7 +1958,6 @@ protected:
hasPeriodicLeaves,
currentIter.coord, LeafIndex, AllDirs);
int periodicNeighborsCounter = 0;
auto nonPeriodicCounter = 0 ;
//
// First treat P2P interactions the classical interaction
// For Periodic cells
......@@ -2025,7 +1970,7 @@ protected:
constexpr int maxPeriodicNeighbors = 19;
ContainerClass* periodicNeighbors[maxPeriodicNeighbors]{};
int periodicNeighborPositions[maxPeriodicNeighbors];
// std::array<FTreeCoordinate,maxPeriodicNeighbors> periodicOffsets{} ;
//
// Move cells and particles
for(int idxNeig = 0 ; idxNeig < counter ; ++idxNeig){
if( !offsets[idxNeig].equals(0,0,0) ){ // We need to move the cell
......@@ -2040,25 +1985,18 @@ protected:
FReal yoffset= boxWidth * FReal(offsets[idxNeig].getY()) ;
FReal zoffset= boxWidth * FReal(offsets[idxNeig].getZ()) ;
for(FSize idxPart = 0; idxPart < periodicNeighbors[periodicNeighborsCounter]->getNbParticles() ; ++idxPart){
// std::cout << " Xo " << positionsX[idxPart] << " " << positionsY[idxPart] << " " << positionsZ[idxPart] <<std::endl;
// std::cout << " Offset " << xoffset << " " << yoffset << " " << zoffset <<std::endl;
positionsX[idxPart] += xoffset;
positionsY[idxPart] += yoffset;
positionsZ[idxPart] += zoffset;
// std::cout << " Xn " << positionsX[idxPart] << " " << positionsY[idxPart] << " " << positionsZ[idxPart] <<std::endl;
}
// periodicOffsets[periodicNeighborsCounter] = offsets[idxNeig];
periodicNeighborPositions[periodicNeighborsCounter] = neighborPositions[idxNeig];
++periodicNeighborsCounter;
}
else{ // set non periodic cells in neighbors and in neighborPositions
// nonPeriodicCounter versus idxNeig-periodicNeighborsCounter
// std::cout << nonPeriodicCounter <<" "<< idxNeig-periodicNeighborsCounter <<std::endl;
// nonPeriodicCounter versus idxNeig-periodicNeighborsCounter
//
neighbors[idxNeig-periodicNeighborsCounter] = neighbors[idxNeig];
neighborPositions[idxNeig-periodicNeighborsCounter] = neighborPositions[idxNeig];
++nonPeriodicCounter ;
}
}
//
......@@ -2115,7 +2053,7 @@ protected:
const int limitem1 = limite -1 ;
FAssertLF(leafsNeedOtherData.getSize() < std::numeric_limits<int>::max());
const int nbLeafToProceed = int(leafsNeedOtherData.getSize());
// std::cout << "Treat communications " << nbLeafToProceed <<std::endl;
#pragma omp for schedule(dynamic, userChunkSize)
for(int idxLeafs = 0 ; idxLeafs < nbLeafToProceed ; ++idxLeafs){
LeafData currentIter = leafsNeedOtherData[idxLeafs];
......@@ -2127,16 +2065,15 @@ protected:
// But we don't know if the is periodic cells
const int nbNeigh = this->getNeighborsIndexesPeriodic(currentIter.coord,limite,
indexesNeighbors,indexArray,AllDirs);
// std::cout << currentIter.coord.getMortonIndex() << " Cells comming from another process " << nbNeigh <<std::endl;
std::array<ContainerClass*,19> periodicNeighbors{};
int nbPeriodicCells=0 ;
// std::cout <<idProcess<< " LEAF " << currentIter.cell->getMortonIndex() << " " << currentIter.coord << " " << nbNeigh <<std::endl;
//
int nbPeriodicCells = 0 ;
//
for(int idxNeigh = 0 ; idxNeigh < nbNeigh ; ++idxNeigh){
if(indexesNeighbors[idxNeigh] < (intervals[idProcess].leftIndex) || (intervals[idProcess].rightIndex) < indexesNeighbors[idxNeigh]){
ContainerClass*const hypotheticNeighbor = otherP2Ptree.getLeafSrc(indexesNeighbors[idxNeigh]);
if(hypotheticNeighbor){
ContainerClass*const hypotheticNeighbor = otherP2Ptree.getLeafSrc(indexesNeighbors[idxNeigh]);
if(hypotheticNeighbor){
// we should check if the cells is periodic or not
neighbors[counter] = hypotheticNeighbor;
neighborPositions[counter] = indexArray[idxNeigh];
......@@ -2157,10 +2094,7 @@ protected:
movePos = true ;
}
// std::cout << " ( " << indexesNeighbors[idxNeigh] << " " << coord3d << " offset= "
// <<offSet[0] << "," << offSet[1] << "," <<offSet[2] <<" )" ;
if(movePos){
/// NEW NEW NEW NEW NEW NEW
// Put periodic cell into another cell (copy data)
periodicNeighbors[nbPeriodicCells] = new ContainerClass(*hypotheticNeighbor) ;
// newPos = pos + ofsset
......@@ -2172,50 +2106,28 @@ protected:
positionsY[idxPart] += offSet[1];
positionsZ[idxPart] += offSet[2];
}
#ifdef toto
std::cout << " MOVE CELL "<<idxNeigh<<std::endl;
FReal*const positionsXX = hypotheticNeighbor->getPositions()[0];
FReal*const positionsYX = hypotheticNeighbor->getPositions()[1];
FReal*const positionsZX = hypotheticNeighbor->getPositions()[2];
auto idxPart = 0 ;
std::cout <<idProcess << " ORI " << positionsXX[idxPart] << " "<< positionsYX[idxPart] << " "<< positionsZX[idxPart] <<std::endl;
std::cout <<idProcess << " OFSET " << offSet[0] << " "<< offSet[1] << " "<< offSet[2] <<std::endl;
std::cout <<idProcess << " Shift " << positionsX[idxPart] << " "<< positionsY[idxPart] << " "<< positionsZ[idxPart] <<std::endl;
#endif
neighbors[counter] = periodicNeighbors[nbPeriodicCells];
// std::cout << " hypotheticNeighbor " << hypotheticNeighbor << " " <<neighbors[counter] << " " << periodicNeighbors[nbPeriodicCells] <<std::endl;
++nbPeriodicCells;
}
else {
// std::cout << " NO MOVE CELL "<<idxNeigh<<std::endl;
}
++counter;
}
}
}
if(counter> 0){ // neighborPositions doesn't use)
// std::cout << " counter: "<< counter <<" nbPeriodicCells " << nbPeriodicCells<<std::endl << " --> P2PRemote" <<std::endl;;
// for (int i = 0 ; i < counter ; ++i){
// std::cout << " " << neighbors[i] ;
// }
// std::cout <<std::endl;
myThreadkernels.P2PRemote( currentIter.coord, currentIter.targets,
nullptr /*currentIter.sources*/, neighbors, neighborPositions, counter);
if(nbPeriodicCells >0){
//to Do
for(int i=0 ; i < nbPeriodicCells ; ++i){
delete periodicNeighbors[i] ;
}
}
}
} // end for loop
}
myThreadkernels.P2PRemote( currentIter.coord, currentIter.targets,
nullptr /*currentIter.sources*/, neighbors, neighborPositions, counter);
if(nbPeriodicCells >0){
//to Do
for(int i=0 ; i < nbPeriodicCells ; ++i){
delete periodicNeighbors[i] ;
}
}
}
} // end for loop
}
delete[] leafsDataArray;
FLOG(computation2Counter.tac());
......@@ -2466,6 +2378,7 @@ public:
void processPeriodicLevels(){
FLOG( FLog::Controller.write("\tStart Periodic Pass\n").write(FLog::Flush); );
FLOG(FTic counterTime);
// the root level of the octree in the virtual array of cells
const int rootLevel = offsetRealTree-1 ;
rootCellFromProc.setLevel(rootLevel+1);
......
......@@ -63,7 +63,7 @@ public:
using multipole_t = exp_impl<class multipole_tag, NRHS>;
using local_expansion_t = exp_impl<class local_expansion_tag, NLHS>;
multipole_t m_data {};
multipole_t m_data {};
local_expansion_t l_data {};
bool hasMultipoleData() const noexcept {
......
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