Commit f2fbcaad authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files

Extarct works with duplicate tree and for the LET only the far field works. Bug in the near field

parent 062de8a6
......@@ -129,6 +129,7 @@ protected:
std::vector<CellHandles>* cellHandles; //< Pointer on the vector of cell handle
std::vector<ParticleHandles> particleHandles; //<
int nb_block; //< Number of block ??
int _tag ; //< incremental number used in data registration
starpu_codelet p2m_cl;
starpu_codelet m2m_cl;
starpu_codelet l2l_cl;
......@@ -245,7 +246,7 @@ public:
FGroupTaskStarPUImplicitAlgorithm(/*const FMpi& paralleManager, */OctreeClass*const inTree, KernelClass* inKernels,
std::vector<MortonIndex>& distributedMortonIndex,
const int nb_block_in = -1)
: tree(inTree), originalCpuKernel(inKernels), cellHandles(nullptr), nb_block(nb_block_in),
: tree(inTree), originalCpuKernel(inKernels), cellHandles(nullptr), nb_block(nb_block_in), _tag(0),
noCommuteAtLastLevel(FEnv::GetBool("SCALFMM_NO_COMMUTE_LAST_L2L", true)),
noCommuteBetweenLevel(FEnv::GetBool("SCALFMM_NO_COMMUTE_M2L_L2L", false)),
#ifdef STARPU_USE_CPU
......@@ -1202,7 +1203,6 @@ protected:
void buildHandles(){
// std::cout << " BEGIN buildHandles() " << std::endl;
cleanHandle();
int tag = 0;
int where;
for(int idxLevel = 2 ; idxLevel < tree->getHeight() ; ++idxLevel){
// std::cout << " Level " << idxLevel << std::endl;
......@@ -1221,9 +1221,9 @@ protected:
starpu_variable_data_register(&cellHandles[idxLevel][idxGroup].down, where,
(uintptr_t)currentCells->getRawLocalBuffer(), currentCells->getLocalBufferSizeInByte());
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].symb, tag++, registeringNode);
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].up, tag++, registeringNode);
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].down, tag++, registeringNode);
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].symb, _tag++, registeringNode);
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].up, _tag++, registeringNode);
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].down, _tag++, registeringNode);
cellHandles[idxLevel][idxGroup].intervalSize = int(currentCells->getNumberOfCellsInBlock());
cellHandles[idxLevel][idxGroup].groupID = idxGroup;
......@@ -1244,8 +1244,8 @@ protected:
starpu_variable_data_register(&particleHandles[idxGroup].down, where,
(uintptr_t)containers->getRawAttributesBuffer(), containers->getAttributesBufferSizeInByte());
starpu_mpi_data_register(particleHandles[idxGroup].symb, tag++, registeringNode);
starpu_mpi_data_register(particleHandles[idxGroup].down, tag++, registeringNode);
starpu_mpi_data_register(particleHandles[idxGroup].symb, _tag++, registeringNode);
starpu_mpi_data_register(particleHandles[idxGroup].down, _tag++, registeringNode);
#ifdef STARPU_USE_REDUX
starpu_data_set_reduction_methods(particleHandles[idxGroup].down, &p2p_redux_perform,
&p2p_redux_init);
......@@ -1291,13 +1291,16 @@ protected:
currentCells->getLocalBufferSizeInByte());
// std::cout <<" 3 " <<std::endl<<std::flush;
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].symb, idx_global, registeringNode);
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].symb, /*_tag++ */idx_global, registeringNode);
// std::cout <<" 4 " <<std::endl<<std::flush;
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].up, idx_global+this->nb_block, registeringNode);
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].up, /*_tag++ */ idx_global+this->nb_block, registeringNode);
// std::cout <<" 5 " <<std::endl<<std::flush;
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].down, idx_global+this->nb_block*2, registeringNode);
starpu_mpi_data_register(cellHandles[idxLevel][idxGroup].down, /*_tag++ */ idx_global+this->nb_block*2, registeringNode);
// std::cout <<" 6 " <<std::endl<<std::flush;
cellHandles[idxLevel][idxGroup].intervalSize = static_cast<int>(currentCells->getNumberOfCellsInBlock());
_tag = std::max(idx_global+2*this->nb_block +1 ,_tag) ;
std::cout << " _tag " << _tag <<std::endl;
#ifdef STARPU_SUPPORT_ARBITER
starpu_data_assign_arbiter(cellHandles[idxLevel][idxGroup].up, arbiterGlobal);
starpu_data_assign_arbiter(cellHandles[idxLevel][idxGroup].down, arbiterGlobal);
......@@ -1317,8 +1320,10 @@ protected:
starpu_variable_data_register(&particleHandles[idxGroup].down, where,
(uintptr_t)containers->getRawAttributesBuffer(), containers->getAttributesBufferSizeInByte());
starpu_mpi_data_register(particleHandles[idxGroup].symb, idx_global, registeringNode);
starpu_mpi_data_register(particleHandles[idxGroup].down, idx_global+this->nb_block, registeringNode);
starpu_mpi_data_register(particleHandles[idxGroup].symb, /*_tag++ */idx_global, registeringNode);
starpu_mpi_data_register(particleHandles[idxGroup].down, /*_tag++ */idx_global+this->nb_block, registeringNode);
_tag = std::max(idx_global+this->nb_block+1,_tag) ;
std::cout << " _tag " << _tag <<std::endl;
#ifdef STARPU_USE_REDUX
starpu_data_set_reduction_methods(particleHandles[idxGroup].down, &p2p_redux_perform,
&p2p_redux_init);
......@@ -1868,6 +1873,7 @@ protected:
void transferPass(const int fromLevel, const int toLevel, const bool inner, const bool outer){
FLOG( FTic timer; );
FLOG( FTic timerInBlock; FTic timerOutBlock; );
for(int idxLevel = fromLevel ; idxLevel < toLevel ; ++idxLevel){
if(inner){// compute the interactions inside a group
// we compute the interaction list for each element on the fly
......@@ -2016,7 +2022,7 @@ protected:
int where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&interactionBuffer.all, where,
(uintptr_t)interactionBuffer.data.get(), interactionBuffer.size);
starpu_mpi_data_register(interactionBuffer.all, tag++, registeringNode);
starpu_mpi_data_register(interactionBuffer.all, _tag++, registeringNode);
CellExtractedHandles* interactionBufferPtr = &interactionBuffer;
starpu_mpi_insert_task(MPI_COMM_WORLD,
......@@ -2047,10 +2053,10 @@ protected:
where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&duplicateB.symb, where,
(uintptr_t)duplicateB.dataSymbPtr.get(), duplicateB.sizeSymb);
starpu_mpi_data_register(duplicateB.symb, tag++, registeringNode);
starpu_mpi_data_register(duplicateB.symb, _tag++, registeringNode);
starpu_variable_data_register(&duplicateB.other, where,
(uintptr_t)duplicateB.dataOtherPtr.get(), duplicateB.sizeOther);
starpu_mpi_data_register(duplicateB.other, tag++, registeringNode);
starpu_mpi_data_register(duplicateB.other, _tag++, registeringNode);
const unsigned char* ptr1 = const_cast<unsigned char*>(tree->getCellGroup(idxLevel,interactionid)->getRawBuffer());
size_t size1 = duplicateB.sizeSymb;
......@@ -2126,7 +2132,7 @@ protected:
int where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&interactionBuffer.all, where,
(uintptr_t)interactionBuffer.data.get(), interactionBuffer.size);
starpu_mpi_data_register(interactionBuffer.all, tag++, registeringNode);
starpu_mpi_data_register(interactionBuffer.all, _tag++, registeringNode);
CellExtractedHandles* interactionBufferPtr = &interactionBuffer;
starpu_mpi_insert_task(MPI_COMM_WORLD,
......@@ -2159,10 +2165,10 @@ protected:
where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&duplicateB.symb, where,
(uintptr_t)duplicateB.dataSymbPtr.get(), duplicateB.sizeSymb);
starpu_mpi_data_register(duplicateB.symb, tag++, registeringNode);
starpu_mpi_data_register(duplicateB.symb, _tag++, registeringNode);
starpu_variable_data_register(&duplicateB.other, where,
(uintptr_t)duplicateB.dataOtherPtr.get(), duplicateB.sizeOther);
starpu_mpi_data_register(duplicateB.other, tag++, registeringNode);
starpu_mpi_data_register(duplicateB.other, _tag++, registeringNode);
const unsigned char* ptr1 = const_cast<unsigned char*>(tree->getCellGroup(idxLevel,idxGroup)->getRawBuffer());
size_t size1 = duplicateB.sizeSymb;
......@@ -2671,7 +2677,7 @@ protected:
int where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&interactionBuffer.symb, where,
(uintptr_t)interactionBuffer.data.get(), interactionBuffer.size);
starpu_mpi_data_register(interactionBuffer.symb, tag++, registeringNode);
starpu_mpi_data_register(interactionBuffer.symb, _tag++, registeringNode);
ParticleExtractedHandles* interactionBufferPtr = &interactionBuffer;
starpu_mpi_insert_task(MPI_COMM_WORLD,
......@@ -2700,7 +2706,7 @@ protected:
where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&duplicateB.symb, where,
(uintptr_t)duplicateB.data, duplicateB.size);
starpu_mpi_data_register(duplicateB.symb, tag++, registeringNode);
starpu_mpi_data_register(duplicateB.symb, _tag++, registeringNode);
const unsigned char* dataPtr = const_cast<unsigned char*>(tree->getParticleGroup(interactionid)->getRawBuffer());
size_t sizeData = duplicateB.size;
......@@ -2784,7 +2790,7 @@ protected:
int where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&interactionBuffer.symb, where,
(uintptr_t)interactionBuffer.data.get(), interactionBuffer.size);
starpu_mpi_data_register(interactionBuffer.symb, tag++, registeringNode);
starpu_mpi_data_register(interactionBuffer.symb, _tag++, registeringNode);
ParticleExtractedHandles* interactionBufferPtr = &interactionBuffer;
starpu_mpi_insert_task(MPI_COMM_WORLD,
......@@ -2813,7 +2819,7 @@ protected:
where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&duplicateA.symb, where,
(uintptr_t)duplicateA.data, duplicateA.size);
starpu_mpi_data_register(duplicateA.symb, tag++, registeringNode);
starpu_mpi_data_register(duplicateA.symb, _tag++, registeringNode);
const unsigned char* dataPtr = const_cast<unsigned char*>(tree->getParticleGroup(idxGroup)->getRawBuffer());
size_t sizeData = duplicateA.size;
......
Supports Markdown
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