From da99b1713e3d79334466d280d541b2d675352b41 Mon Sep 17 00:00:00 2001 From: bramas <berenger.bramas@inria.fr> Date: Thu, 25 Dec 2014 18:18:39 +0100 Subject: [PATCH] Add test for the number of particles --- Tests/noDist/testBlockedMpiAlgorithm.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/noDist/testBlockedMpiAlgorithm.cpp b/Tests/noDist/testBlockedMpiAlgorithm.cpp index cc1e35cd9..daccf273d 100644 --- a/Tests/noDist/testBlockedMpiAlgorithm.cpp +++ b/Tests/noDist/testBlockedMpiAlgorithm.cpp @@ -81,6 +81,7 @@ int main(int argc, char* argv[]){ const int NbLevels = FParameters::getValue(argc,argv,FParameterDefinitions::OctreeHeight.options, 5); const int NbParticles = FParameters::getValue(argc,argv,FParameterDefinitions::NbParticles.options, 20); const int groupSize = FParameters::getValue(argc,argv,LocalOptionBlocSize.options, 250); + const int totalNbParticles = (NbParticles*mpiComm.global().processCount()); // Load the particles FRandomLoader loader(NbParticles, 1.0, FPoint(0,0,0), mpiComm.global().processId()); @@ -148,6 +149,16 @@ int main(int argc, char* argv[]){ GroupAlgorithm groupalgo(mpiComm.global(), &groupedTree,&groupkernel); 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; } -- GitLab