Commit e5fb1841 authored by Martin Khannouz's avatar Martin Khannouz Committed by Berenger Bramas

Got something working on almoste all cases.

The implicit part reproducing explicit mapping works well.
But on the explicit side, it turn out that if all morton indexes ain't
used, it segfault.
Gotta investigate it.
parent 49284725
...@@ -287,8 +287,7 @@ public: ...@@ -287,8 +287,7 @@ public:
void syncData(){ void syncData(){
for(int idxLevel = 0 ; idxLevel < tree->getHeight() ; ++idxLevel){ for(int idxLevel = 0 ; idxLevel < tree->getHeight() ; ++idxLevel){
for(int idxHandle = 0 ; idxHandle < int(cellHandles[idxLevel].size()) ; ++idxHandle){ for(int idxHandle = 0 ; idxHandle < int(cellHandles[idxLevel].size()) ; ++idxHandle){
//if(isDataOwned(idxHandle, int(cellHandles[idxLevel].size()))) { if(isDataOwnedBerenger(tree->getCellGroup(idxLevel, idxHandle)->getStartingIndex(), idxLevel)) {//Clean only our data handle
if(isDataOwnedBerenger(tree->getCellGroup(idxLevel, idxHandle)->getStartingIndex()+1, idxLevel)) {//Clean only our data handle
starpu_data_acquire(cellHandles[idxLevel][idxHandle].symb, STARPU_R); starpu_data_acquire(cellHandles[idxLevel][idxHandle].symb, STARPU_R);
starpu_data_release(cellHandles[idxLevel][idxHandle].symb); starpu_data_release(cellHandles[idxLevel][idxHandle].symb);
starpu_data_acquire(cellHandles[idxLevel][idxHandle].up, STARPU_R); starpu_data_acquire(cellHandles[idxLevel][idxHandle].up, STARPU_R);
...@@ -300,8 +299,7 @@ public: ...@@ -300,8 +299,7 @@ public:
} }
{ {
for(int idxHandle = 0 ; idxHandle < int(particleHandles.size()) ; ++idxHandle){ for(int idxHandle = 0 ; idxHandle < int(particleHandles.size()) ; ++idxHandle){
//if(isDataOwned(idxHandle, int(particleHandles.size()))) { if(isDataOwnedBerenger(tree->getCellGroup(tree->getHeight()-1, idxHandle)->getStartingIndex(), tree->getHeight()-1)) {//Clean only our data handle
if(isDataOwnedBerenger(tree->getCellGroup(tree->getHeight()-1, idxHandle)->getStartingIndex()+1, tree->getHeight()-1)) {//Clean only our data handle
starpu_data_acquire(particleHandles[idxHandle].symb, STARPU_R); starpu_data_acquire(particleHandles[idxHandle].symb, STARPU_R);
starpu_data_release(particleHandles[idxHandle].symb); starpu_data_release(particleHandles[idxHandle].symb);
starpu_data_acquire(particleHandles[idxHandle].down, STARPU_R); starpu_data_acquire(particleHandles[idxHandle].down, STARPU_R);
...@@ -435,13 +433,6 @@ public: ...@@ -435,13 +433,6 @@ public:
nodeRepartition[idxLevel][node_id][1] = nodeRepartition[idxLevel+1][node_id][1] >> 3; nodeRepartition[idxLevel][node_id][1] = nodeRepartition[idxLevel+1][node_id][1] >> 3;
} }
} }
//for(int idxLevel = 0; idxLevel < tree->getHeight(); ++idxLevel){
//cout << "Level " << idxLevel << endl;
//for(int node_id = 0; node_id < nproc; ++node_id){
//cout << "\t" << nodeRepartition[idxLevel][node_id][0] << " " << nodeRepartition[idxLevel][node_id][0] << endl;
//}
//}
} }
protected: protected:
/** /**
...@@ -842,8 +833,7 @@ protected: ...@@ -842,8 +833,7 @@ protected:
void cleanHandle(){ void cleanHandle(){
for(int idxLevel = 0 ; idxLevel < tree->getHeight() ; ++idxLevel){ for(int idxLevel = 0 ; idxLevel < tree->getHeight() ; ++idxLevel){
for(int idxHandle = 0 ; idxHandle < int(cellHandles[idxLevel].size()) ; ++idxHandle){ for(int idxHandle = 0 ; idxHandle < int(cellHandles[idxLevel].size()) ; ++idxHandle){
//if(isDataOwned(idxHandle, int(cellHandles[idxLevel].size())))//Clean only our data handle if(isDataOwnedBerenger(tree->getCellGroup(idxLevel, idxHandle)->getStartingIndex(), idxLevel))//Clean only our data handle
if(isDataOwnedBerenger(tree->getCellGroup(idxLevel, idxHandle)->getStartingIndex()+1, idxLevel))//Clean only our data handle
{ {
starpu_data_unregister(cellHandles[idxLevel][idxHandle].symb); starpu_data_unregister(cellHandles[idxLevel][idxHandle].symb);
starpu_data_unregister(cellHandles[idxLevel][idxHandle].up); starpu_data_unregister(cellHandles[idxLevel][idxHandle].up);
...@@ -854,8 +844,7 @@ protected: ...@@ -854,8 +844,7 @@ protected:
} }
{ {
for(int idxHandle = 0 ; idxHandle < int(particleHandles.size()) ; ++idxHandle){ for(int idxHandle = 0 ; idxHandle < int(particleHandles.size()) ; ++idxHandle){
//if(isDataOwned(idxHandle, int(particleHandles.size()))) if(isDataOwnedBerenger(tree->getCellGroup(tree->getHeight()-1, idxHandle)->getStartingIndex(), tree->getHeight()-1))//Clean only our data handle
if(isDataOwnedBerenger(tree->getCellGroup(tree->getHeight()-1, idxHandle)->getStartingIndex()+1, tree->getHeight()-1))//Clean only our data handle
{ {
starpu_data_unregister(particleHandles[idxHandle].symb); starpu_data_unregister(particleHandles[idxHandle].symb);
starpu_data_unregister(particleHandles[idxHandle].down); starpu_data_unregister(particleHandles[idxHandle].down);
...@@ -875,10 +864,8 @@ protected: ...@@ -875,10 +864,8 @@ protected:
cellHandles[idxLevel].resize(tree->getNbCellGroupAtLevel(idxLevel)); cellHandles[idxLevel].resize(tree->getNbCellGroupAtLevel(idxLevel));
for(int idxGroup = 0 ; idxGroup < tree->getNbCellGroupAtLevel(idxLevel) ; ++idxGroup){ for(int idxGroup = 0 ; idxGroup < tree->getNbCellGroupAtLevel(idxLevel) ; ++idxGroup){
const CellContainerClass* currentCells = tree->getCellGroup(idxLevel, idxGroup); const CellContainerClass* currentCells = tree->getCellGroup(idxLevel, idxGroup);
int registeringNode = dataMappingBerenger(currentCells->getStartingIndex()+1, idxLevel); int registeringNode = dataMappingBerenger(currentCells->getStartingIndex(), idxLevel);
//int registeringNode = dataMapping(idxGroup, tree->getNbCellGroupAtLevel(idxLevel));
//cout << registeringNode << endl;
where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1; where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
starpu_variable_data_register(&cellHandles[idxLevel][idxGroup].symb, where, starpu_variable_data_register(&cellHandles[idxLevel][idxGroup].symb, where,
(uintptr_t)currentCells->getRawBuffer(), currentCells->getBufferSizeInByte()); (uintptr_t)currentCells->getRawBuffer(), currentCells->getBufferSizeInByte());
...@@ -900,8 +887,7 @@ protected: ...@@ -900,8 +887,7 @@ protected:
{ {
particleHandles.resize(tree->getNbParticleGroup()); particleHandles.resize(tree->getNbParticleGroup());
for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){ for(int idxGroup = 0 ; idxGroup < tree->getNbParticleGroup() ; ++idxGroup){
//int registeringNode = dataMapping(idxGroup, tree->getNbParticleGroup()); int registeringNode = dataMappingBerenger(tree->getCellGroup(tree->getHeight()-1, idxGroup)->getStartingIndex(), tree->getHeight()-1);
int registeringNode = dataMappingBerenger(tree->getCellGroup(tree->getHeight()-1, idxGroup)->getStartingIndex()+1, tree->getHeight()-1);
where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1; where = (registeringNode == mpi_rank) ? STARPU_MAIN_RAM : -1;
ParticleGroupClass* containers = tree->getParticleGroup(idxGroup); ParticleGroupClass* containers = tree->getParticleGroup(idxGroup);
starpu_variable_data_register(&particleHandles[idxGroup].symb, where, starpu_variable_data_register(&particleHandles[idxGroup].symb, where,
...@@ -924,12 +910,11 @@ protected: ...@@ -924,12 +910,11 @@ protected:
} }
} }
int dataMappingBerenger(MortonIndex const idx, int const idxLevel) const { int dataMappingBerenger(MortonIndex const idx, int const idxLevel) const {
//return idxLevel%4;
for(int i = 0; i < nproc; ++i) for(int i = 0; i < nproc; ++i)
if(nodeRepartition[idxLevel][i][0] <= nodeRepartition[idxLevel][i][1] && idx >= nodeRepartition[idxLevel][i][0] && idx <= nodeRepartition[idxLevel][i][1]) if(nodeRepartition[idxLevel][i][0] <= nodeRepartition[idxLevel][i][1] && idx >= nodeRepartition[idxLevel][i][0] && idx <= nodeRepartition[idxLevel][i][1])
return i; return i;
if(mpi_rank == 0) if(mpi_rank == 0)
cout << "Error !! [" << idx << "," << idxLevel << "]" << endl; cout << "[scalfmm][map error] idx " << idx << " on level " << idxLevel << " isn't mapped on any proccess." << endl;
return -1; return -1;
} }
/** /**
......
...@@ -317,8 +317,14 @@ public: ...@@ -317,8 +317,14 @@ public:
~FGroupTaskStarPUMpiAlgorithm(){ ~FGroupTaskStarPUMpiAlgorithm(){
starpu_resume(); starpu_resume();
std::cout << "Loutre " << comm.processId() << std::endl;
comm.barrier();
cleanHandle(); cleanHandle();
std::cout << "Canard " << comm.processId() << std::endl;
comm.barrier();
cleanHandleMpi(); cleanHandleMpi();
std::cout << "Suricate " << comm.processId() << std::endl;
comm.barrier();
delete[] cellHandles; delete[] cellHandles;
starpu_pthread_mutex_t releaseMutex; starpu_pthread_mutex_t releaseMutex;
...@@ -1344,12 +1350,16 @@ protected: ...@@ -1344,12 +1350,16 @@ protected:
for(int idxLevel = 0 ; idxLevel < int(remoteCellGroups.size()) ; ++idxLevel){ for(int idxLevel = 0 ; idxLevel < int(remoteCellGroups.size()) ; ++idxLevel){
for(int idxHandle = 0 ; idxHandle < int(remoteCellGroups[idxLevel].size()) ; ++idxHandle){ for(int idxHandle = 0 ; idxHandle < int(remoteCellGroups[idxLevel].size()) ; ++idxHandle){
if(remoteCellGroups[idxLevel][idxHandle].ptrSymb){ if(remoteCellGroups[idxLevel][idxHandle].ptrSymb){
if(comm.processId() == 4)
std::cout << "Narval " << idxLevel << " " << idxHandle << std::endl;
starpu_data_unregister(remoteCellGroups[idxLevel][idxHandle].handleSymb); starpu_data_unregister(remoteCellGroups[idxLevel][idxHandle].handleSymb);
starpu_data_unregister(remoteCellGroups[idxLevel][idxHandle].handleUp); starpu_data_unregister(remoteCellGroups[idxLevel][idxHandle].handleUp);
FAlignedMemory::DeallocBytes(remoteCellGroups[idxLevel][idxHandle].ptrSymb); FAlignedMemory::DeallocBytes(remoteCellGroups[idxLevel][idxHandle].ptrSymb);
FAlignedMemory::DeallocBytes(remoteCellGroups[idxLevel][idxHandle].ptrUp); FAlignedMemory::DeallocBytes(remoteCellGroups[idxLevel][idxHandle].ptrUp);
if(remoteCellGroups[idxLevel][idxHandle].ptrDown){ if(remoteCellGroups[idxLevel][idxHandle].ptrDown){
if(comm.processId() == 4)
std::cout << "Narval " << idxLevel << " " << idxHandle << std::endl;
starpu_data_unregister(remoteCellGroups[idxLevel][idxHandle].handleDown); starpu_data_unregister(remoteCellGroups[idxLevel][idxHandle].handleDown);
FAlignedMemory::DeallocBytes(remoteCellGroups[idxLevel][idxHandle].ptrDown); FAlignedMemory::DeallocBytes(remoteCellGroups[idxLevel][idxHandle].ptrDown);
} }
...@@ -1360,12 +1370,16 @@ protected: ...@@ -1360,12 +1370,16 @@ protected:
{ {
for(int idxHandle = 0 ; idxHandle < int(remoteParticleGroupss.size()) ; ++idxHandle){ for(int idxHandle = 0 ; idxHandle < int(remoteParticleGroupss.size()) ; ++idxHandle){
if(remoteParticleGroupss[idxHandle].ptrSymb){ if(remoteParticleGroupss[idxHandle].ptrSymb){
if(comm.processId() == 4)
std::cout << "Narval part " << idxHandle << std::endl;
starpu_data_unregister(remoteParticleGroupss[idxHandle].handleSymb); starpu_data_unregister(remoteParticleGroupss[idxHandle].handleSymb);
FAlignedMemory::DeallocBytes(remoteParticleGroupss[idxHandle].ptrSymb); FAlignedMemory::DeallocBytes(remoteParticleGroupss[idxHandle].ptrSymb);
} }
} }
remoteParticleGroupss.clear(); remoteParticleGroupss.clear();
} }
if(comm.processId() == 4)
std::cout << "Done" << std::endl;
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
......
...@@ -65,7 +65,7 @@ using namespace std; ...@@ -65,7 +65,7 @@ using namespace std;
// FFmmAlgorithmTask FFmmAlgorithmThread // FFmmAlgorithmTask FFmmAlgorithmThread
typedef FFmmAlgorithm<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass > FmmClass; typedef FFmmAlgorithm<OctreeClass, CellClass, ContainerClass, KernelClass, LeafClass > FmmClass;
//#define LOAD_FILE #define LOAD_FILE
#ifndef LOAD_FILE #ifndef LOAD_FILE
typedef FRandomLoader<FReal> LoaderClass; typedef FRandomLoader<FReal> LoaderClass;
#else #else
...@@ -100,8 +100,8 @@ int main(int argc, char* argv[]){ ...@@ -100,8 +100,8 @@ int main(int argc, char* argv[]){
cout << "Pas de mpi -_-\" " << endl; cout << "Pas de mpi -_-\" " << endl;
#endif #endif
#ifndef LOAD_FILE #ifndef LOAD_FILE
const FSize NbParticles = FParameters::getValue(argc,argv,FParameterDefinitions::NbParticles.options, FSize(100)); const FSize NbParticles = FParameters::getValue(argc,argv,FParameterDefinitions::NbParticles.options, FSize(10000));
LoaderClass loader(NbParticles, 1.0, FPoint<FReal>(0,0,0), 0); LoaderClass loader(NbParticles, 1.0, FPoint<FReal>(0,0,0), 0);
#else #else
// Load the particles // Load the particles
const char* const filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "../Data/test20k.fma"); const char* const filename = FParameters::getStr(argc,argv,FParameterDefinitions::InputFile.options, "../Data/test20k.fma");
...@@ -157,15 +157,6 @@ int main(int argc, char* argv[]){ ...@@ -157,15 +157,6 @@ int main(int argc, char* argv[]){
mpi_rank = groupalgo.getRank(); mpi_rank = groupalgo.getRank();
cout << "Executing time (implicit node " << mpi_rank << ") " << elapsedTime << "s\n"; cout << "Executing time (implicit node " << mpi_rank << ") " << elapsedTime << "s\n";
timeAverage(mpi_rank, nproc, elapsedTime); timeAverage(mpi_rank, nproc, elapsedTime);
//if( groupalgo.getRank() != 0)
//return 0;
//groupedTree.printInfoBlocks();
//for(int i = 0; i < NbLevels; ++i)
//{
//cout << "Level " << i << "(" << sizeForEachGroup[i].size() << ")" << endl;
//for(int j = 0; j < sizeForEachGroup[i].size(); ++j)
//cout << "\t" << sizeForEachGroup[i][j] << endl;
//}
// Usual algorithm // Usual algorithm
KernelClass kernels; // FTestKernels FBasicKernels KernelClass kernels; // FTestKernels FBasicKernels
...@@ -276,7 +267,7 @@ void sortParticle(FPoint<FReal> * allParticles, int treeHeight, int groupSize, v ...@@ -276,7 +267,7 @@ void sortParticle(FPoint<FReal> * allParticles, int treeHeight, int groupSize, v
} }
//Compte le nombre de feuilles //Compte le nombre de feuilles
sizeForEachGroup.resize(treeHeight+1);//Le +1 est pour les particules sizeForEachGroup.resize(treeHeight);
MortonIndex previousLeaf = -1; MortonIndex previousLeaf = -1;
int numberOfLeaf = 0; int numberOfLeaf = 0;
for(FSize idxPart = 0 ; idxPart < nbParticles ; ++idxPart) for(FSize idxPart = 0 ; idxPart < nbParticles ; ++idxPart)
...@@ -331,10 +322,6 @@ void sortParticle(FPoint<FReal> * allParticles, int treeHeight, int groupSize, v ...@@ -331,10 +322,6 @@ void sortParticle(FPoint<FReal> * allParticles, int treeHeight, int groupSize, v
std::vector<std::vector<std::vector<MortonIndex>>> nodeRepartition; std::vector<std::vector<std::vector<MortonIndex>>> nodeRepartition;
createNodeRepartition(distributedMortonIndex, nodeRepartition, nproc, treeHeight); createNodeRepartition(distributedMortonIndex, nodeRepartition, nproc, treeHeight);
//for(int i = 0; i < nproc; ++i)
//{
//cout << nodeRepartition[1][i][0] << " - " << nodeRepartition[1][i][1] << endl;
//}
//Pour chaque niveau calcul de la taille des groupe //Pour chaque niveau calcul de la taille des groupe
for(int idxLevel = treeHeight - 2; idxLevel >= 0; --idxLevel) for(int idxLevel = treeHeight - 2; idxLevel >= 0; --idxLevel)
{ {
......
...@@ -104,7 +104,7 @@ int main(int argc, char* argv[]){ ...@@ -104,7 +104,7 @@ int main(int argc, char* argv[]){
memset(particles.get(), 0, sizeof(TestParticle) * loader.getNumberOfParticles()); memset(particles.get(), 0, sizeof(TestParticle) * loader.getNumberOfParticles());
for(FSize idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){ for(FSize idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart){
loader.fillParticleAtMortonIndex(&(particles[idxPart].position), mpiComm.global().processId()*NbParticles + idxPart,NbLevels); loader.fillParticleAtMortonIndex(&(particles[idxPart].position), mpiComm.global().processId()*NbParticles + idxPart,NbLevels);
//loader.fillParticle(&(particles[idxPart].position)); //loader.fillParticle(&(particles[idxPart].position));
} }
// Sort in parallel // Sort in parallel
FVector<TestParticle> myParticles; FVector<TestParticle> myParticles;
...@@ -147,28 +147,20 @@ int main(int argc, char* argv[]){ ...@@ -147,28 +147,20 @@ int main(int argc, char* argv[]){
std::cout << "Exchange particle to create the file" << std::endl; std::cout << "Exchange particle to create the file" << std::endl;
std::vector<TestParticle*> particlesGathered; std::vector<TestParticle*> particlesGathered;
std::vector<int> sizeGathered; std::vector<int> sizeGathered;
std::vector<MortonIndex> mortonIndex;
//Ajout des mes particules //Ajout des mes particules
int sizeofParticle = sizeof(TestParticle)*myParticles.getSize(); int sizeofParticle = sizeof(TestParticle)*myParticles.getSize();
sizeGathered.push_back(sizeofParticle); sizeGathered.push_back(sizeofParticle);
particlesGathered.push_back(new TestParticle[sizeofParticle]); particlesGathered.push_back(new TestParticle[sizeofParticle]);
memcpy(particlesGathered.back(), myParticles.data(), sizeofParticle); memcpy(particlesGathered.back(), myParticles.data(), sizeofParticle);
mortonIndex.push_back(leftLimite);
mortonIndex.push_back(myLeftLimite);
//Recupération des particules des autres //Recupération des particules des autres
for(int i = 1; i < mpiComm.global().processCount(); ++i) for(int i = 1; i < mpiComm.global().processCount(); ++i)
{ {
int sizeReceive; int sizeReceive;
MortonIndex mortonStart, mortonEnd;
MPI_Recv(&sizeReceive, sizeof(sizeReceive), MPI_BYTE, i, 0, mpiComm.global().getComm(), MPI_STATUS_IGNORE); MPI_Recv(&sizeReceive, sizeof(sizeReceive), MPI_BYTE, i, 0, mpiComm.global().getComm(), MPI_STATUS_IGNORE);
sizeGathered.push_back(sizeReceive); sizeGathered.push_back(sizeReceive);
particlesGathered.push_back(new TestParticle[sizeReceive]); particlesGathered.push_back(new TestParticle[sizeReceive]);
MPI_Recv(particlesGathered.back(), sizeReceive, MPI_BYTE, i, 0, mpiComm.global().getComm(), MPI_STATUS_IGNORE); MPI_Recv(particlesGathered.back(), sizeReceive, MPI_BYTE, i, 0, mpiComm.global().getComm(), MPI_STATUS_IGNORE);
MPI_Recv(&mortonStart, sizeof(mortonStart), MPI_BYTE, i, 0, mpiComm.global().getComm(), MPI_STATUS_IGNORE);
MPI_Recv(&mortonEnd, sizeof(mortonEnd), MPI_BYTE, i, 0, mpiComm.global().getComm(), MPI_STATUS_IGNORE);
mortonIndex.push_back(mortonStart);
mortonIndex.push_back(mortonEnd);
} }
int sum = 0; int sum = 0;
for(int a : sizeGathered) for(int a : sizeGathered)
...@@ -180,10 +172,6 @@ int main(int argc, char* argv[]){ ...@@ -180,10 +172,6 @@ int main(int argc, char* argv[]){
writer.writeHeader(loader.getCenterOfBox(), loader.getBoxWidth(),totalNbParticles, particles[0]); writer.writeHeader(loader.getCenterOfBox(), loader.getBoxWidth(),totalNbParticles, particles[0]);
for(unsigned int i = 0; i < particlesGathered.size(); ++i) for(unsigned int i = 0; i < particlesGathered.size(); ++i)
writer.writeArrayOfParticles(particlesGathered[i], sizeGathered[i]/sizeof(TestParticle)); writer.writeArrayOfParticles(particlesGathered[i], sizeGathered[i]/sizeof(TestParticle));
std::ofstream fichier("mapping", std::ios::out | std::ios::trunc); //déclaration du flux et ouverture du fichier
fichier << mortonIndex.size()/2 << std::endl;
for(unsigned int i = 0; i < mortonIndex.size(); i+=2)
fichier << mortonIndex[i] << " " << mortonIndex[i+1] << std::endl;
for(TestParticle* ptr : particlesGathered) for(TestParticle* ptr : particlesGathered)
delete ptr; delete ptr;
std::cout << "Done exchanging !" << std::endl; std::cout << "Done exchanging !" << std::endl;
...@@ -221,6 +209,7 @@ int main(int argc, char* argv[]){ ...@@ -221,6 +209,7 @@ int main(int argc, char* argv[]){
}); });
mpiComm.global().barrier();
typedef FTestCell CellClass; typedef FTestCell CellClass;
typedef FTestParticleContainer<FReal> ContainerClass; typedef FTestParticleContainer<FReal> ContainerClass;
...@@ -236,7 +225,7 @@ int main(int argc, char* argv[]){ ...@@ -236,7 +225,7 @@ int main(int argc, char* argv[]){
FRandomLoader<FReal> loaderAll(NbParticles, 1.0, FPoint<FReal>(0,0,0), idxProc); FRandomLoader<FReal> loaderAll(NbParticles, 1.0, FPoint<FReal>(0,0,0), idxProc);
for(FSize idxPart = 0 ; idxPart < loaderAll.getNumberOfParticles() ; ++idxPart){ for(FSize idxPart = 0 ; idxPart < loaderAll.getNumberOfParticles() ; ++idxPart){
FPoint<FReal> pos; FPoint<FReal> pos;
//loaderAll.fillParticle(&pos); //loaderAll.fillParticle(&pos);
loaderAll.fillParticleAtMortonIndex(&pos, idxProc*NbParticles + idxPart,NbLevels); loaderAll.fillParticleAtMortonIndex(&pos, idxProc*NbParticles + idxPart,NbLevels);
tree.insert(pos); tree.insert(pos);
} }
......
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