Mentions légales du service

Skip to content
Snippets Groups Projects
Commit da99b171 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

Add test for the number of particles

parent 06ce2d76
Branches
Tags
No related merge requests found
...@@ -81,6 +81,7 @@ int main(int argc, char* argv[]){ ...@@ -81,6 +81,7 @@ int main(int argc, char* argv[]){
const int NbLevels = FParameters::getValue(argc,argv,FParameterDefinitions::OctreeHeight.options, 5); const int NbLevels = FParameters::getValue(argc,argv,FParameterDefinitions::OctreeHeight.options, 5);
const int NbParticles = FParameters::getValue(argc,argv,FParameterDefinitions::NbParticles.options, 20); const int NbParticles = FParameters::getValue(argc,argv,FParameterDefinitions::NbParticles.options, 20);
const int groupSize = FParameters::getValue(argc,argv,LocalOptionBlocSize.options, 250); const int groupSize = FParameters::getValue(argc,argv,LocalOptionBlocSize.options, 250);
const int totalNbParticles = (NbParticles*mpiComm.global().processCount());
// Load the particles // Load the particles
FRandomLoader loader(NbParticles, 1.0, FPoint(0,0,0), mpiComm.global().processId()); FRandomLoader loader(NbParticles, 1.0, FPoint(0,0,0), mpiComm.global().processId());
...@@ -148,6 +149,16 @@ int main(int argc, char* argv[]){ ...@@ -148,6 +149,16 @@ int main(int argc, char* argv[]){
GroupAlgorithm groupalgo(mpiComm.global(), &groupedTree,&groupkernel); GroupAlgorithm groupalgo(mpiComm.global(), &groupedTree,&groupkernel);
groupalgo.execute(); groupalgo.execute();
groupedTree.forEachCellLeaf<FGroupTestParticleContainer>([&](GroupCellClass* cell, FGroupTestParticleContainer* leaf){
const int nbPartsInLeaf = leaf->getNbParticles();
const long long int* dataDown = leaf->getDataDown();
for(int idxPart = 0 ; idxPart < nbPartsInLeaf ; ++idxPart){
if(dataDown[idxPart] != totalNbParticles-1){
std::cout << "[Full] Error a particle has " << dataDown[idxPart] << " (it should be " << (NbParticles-1) << ") at index " << cell->getMortonIndex() << "\n";
}
}
});
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment