From 1001f6c73079e5498d438fecb8ff4a8b66c6772c Mon Sep 17 00:00:00 2001 From: berenger-bramas <berenger-bramas@2616d619-271b-44dc-8df4-d4a8f33a7222> Date: Fri, 26 Aug 2011 12:18:36 +0000 Subject: [PATCH] Update Proc FMM. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@180 2616d619-271b-44dc-8df4-d4a8f33a7222 --- Src/Core/FFmmAlgorithmThreadProc.hpp | 12 ++++++++---- Tests/testFmmAlgorithmProc.cpp | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Src/Core/FFmmAlgorithmThreadProc.hpp b/Src/Core/FFmmAlgorithmThreadProc.hpp index d85ba66f9..eb2aa122c 100644 --- a/Src/Core/FFmmAlgorithmThreadProc.hpp +++ b/Src/Core/FFmmAlgorithmThreadProc.hpp @@ -32,7 +32,9 @@ class FLightOctree { delete next[idxNext]; } } + /** Insert a cell */ void insert(const MortonIndex& index, const void* const cell, const int level){ + /** As long as the level is not 0 go downward */ if(level){ const int host = (index >> (3 * (level-1))) & 0x07; if(!next[host]){ @@ -44,6 +46,7 @@ class FLightOctree { data = cell; } } + /** Retreive data */ const void* getCell(const MortonIndex& index, const int level) const { if(level){ const int host = (index >> (3 * (level-1))) & 0x07; @@ -58,16 +61,19 @@ class FLightOctree { } }; + /** The tree root */ Node root; public: FLightOctree(){ } + /** Insert a cell into the light octree */ void insertCell(const MortonIndex& index, const void* const cell, const int level){ root.insert(index, cell, level); } + /** Get a cell or null if it does not exist */ const void* getCell(const MortonIndex& index, const int level) const{ return root.getCell(index, level); } @@ -97,8 +103,6 @@ public: template<class OctreeClass, class ParticleClass, class CellClass, class ContainerClass, class KernelClass, class LeafClass> class FFmmAlgorithmThreadProc : protected FAssertable { - FMpi& app; //< The app to communicate - OctreeClass* const tree; //< The octree to work on KernelClass** kernels; //< The kernels @@ -142,7 +146,7 @@ public: * An assert is launched if one of the arguments is null */ FFmmAlgorithmThreadProc(FMpi& inApp, OctreeClass* const inTree, KernelClass* const inKernels) - : app(inApp), tree(inTree) , kernels(0), numberOfLeafs(0), + : tree(inTree) , kernels(0), numberOfLeafs(0), MaxThreads(omp_get_max_threads()), nbProcess(inApp.processCount()), idProcess(inApp.processId()), OctreeHeight(tree->getHeight()),intervals(new Interval[inApp.processCount()]), realIntervalsPerLevel(new Interval[inApp.processCount() * tree->getHeight()]), @@ -513,7 +517,7 @@ public: leafsNeedOther[idxLevel] = new FBoolArray(numberOfCells); - // Which cell potentialy need other data and in the same time + // Which cells potentialy need other data and in the same time // are potentialy needed by other MortonIndex neighborsIndexes[208]; for(int idxCell = 0 ; idxCell < numberOfCells ; ++idxCell){ diff --git a/Tests/testFmmAlgorithmProc.cpp b/Tests/testFmmAlgorithmProc.cpp index cab80983b..72add1a9c 100644 --- a/Tests/testFmmAlgorithmProc.cpp +++ b/Tests/testFmmAlgorithmProc.cpp @@ -103,7 +103,7 @@ void ValidateTree(OctreeClass& realTree, -/** This function test the octree to be sure that the fmm algorithm +/** This function tests the octree to be sure that the fmm algorithm * has worked completly. */ template<class OctreeClass, class ContainerClass> @@ -292,6 +292,10 @@ public: } }; +///////////////////////////////////////////////////////////////////// +// Define the classes to use +///////////////////////////////////////////////////////////////////// + typedef TestParticle ParticleClass; typedef TestCell CellClass; typedef FVector<ParticleClass> ContainerClass; -- GitLab