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

Fix an error generating particles.

parent dec0649c
......@@ -113,12 +113,10 @@ int main(int argc, char* argv[]){
#ifndef LOAD_FILE
FReal boxWidth = 1.0;
{
FRandomLoader<FReal> loader(NbParticles, boxWidth, FPoint<FReal>(0,0,0), mpiComm.global().processId());
FAssertLF(loader.isOpen());
FSize idxPart = 0;
for(int i = 0; i < mpiComm.global().processCount(); ++i){
FSize NbParticlesPerNode = getNbParticlesPerNode(nproc, i, NbParticles);
setSeed(i);
FSize NbParticlesPerNode = getNbParticlesPerNode(mpiComm.global().processCount(), i, NbParticles);
setSeed(i+1);//Add +1 so the seed given is never 0 which correspond to random
FReal * tmpParticles = new FReal[4*NbParticlesPerNode];
if(FParameters::existParameter(argc, argv, "-ellipsoid")) {
nonunifRandonPointsOnElipsoid(NbParticlesPerNode, boxWidth/2, boxWidth/4, boxWidth/8, tmpParticles);
......@@ -156,7 +154,15 @@ int main(int argc, char* argv[]){
}
// Put the data into the tree
//GroupOctreeClass groupedTree(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(), groupSize, &allParticles, true);
for(int i =0; i<sizeForEachGroup.size(); ++i)
{
for(int j =0; j<sizeForEachGroup[i].size(); ++j)
cout << sizeForEachGroup[i][j] << " ";
cout << endl;
}
GroupOctreeClass groupedTree(NbLevels, loader.getBoxWidth(), loader.getCenterOfBox(), groupSize, &allParticles, sizeForEachGroup, true);
groupedTree.printInfoBlocks();
// Run the algorithm
int operationsToProceed = FFmmP2M | FFmmM2M | FFmmM2L | FFmmL2L | FFmmL2P | FFmmP2P;
......
......@@ -116,7 +116,7 @@ int main(int argc, char* argv[]){
FRandomLoader<FReal> loader(NbParticles, boxWidth, FPoint<FReal>(0,0,0), mpiComm.global().processId());
FAssertLF(loader.isOpen());
setSeed(mpiComm.global().processId());
setSeed(mpiComm.global().processId()+1);
TestParticle* allParticles = new TestParticle[loader.getNumberOfParticles()];
FReal * tmpParticles = new FReal[4*loader.getNumberOfParticles()];
memset(allParticles,0,(unsigned int) (sizeof(TestParticle)* loader.getNumberOfParticles()));
......
......@@ -92,7 +92,7 @@ int main(int argc, char* argv[]){
FRandomLoader<FReal> loader(NbParticles, boxWidth, FPoint<FReal>(0,0,0), mpiComm.global().processId());
FAssertLF(loader.isOpen());
setSeed(mpiComm.global().processId());
setSeed(mpiComm.global().processId()+1);
TestParticle* allParticles = new TestParticle[loader.getNumberOfParticles()];
FReal * tmpParticles = new FReal[4*loader.getNumberOfParticles()];
memset(allParticles,0,(unsigned int) (sizeof(TestParticle)* loader.getNumberOfParticles()));
......
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