diff --git a/Src/Core/FFmmAlgorithmNewTask.hpp b/Src/Core/FFmmAlgorithmNewTask.hpp index de10cf1be7ef8388ecd7b14be937b4018c162df9..3914b3c1d2375edaa54b6fb97ca0c542bc1623ad 100644 --- a/Src/Core/FFmmAlgorithmNewTask.hpp +++ b/Src/Core/FFmmAlgorithmNewTask.hpp @@ -7,18 +7,20 @@ #include <omp.h> -#include "Utils/FGlobal.hpp" +#include "Utils/FAlgorithmTimers.hpp" #include "Utils/FAssert.hpp" -#include "Utils/FLog.hpp" #include "Utils/FEnv.hpp" -#include "Utils/FAlgorithmTimers.hpp" + +#include "Utils/FGlobal.hpp" +#include "Utils/FLog.hpp" #include "Utils/FTic.hpp" -#include "Utils/FAlgorithmTimers.hpp" #include "Containers/FOctree.hpp" #include "Containers/FVector.hpp" +#include "Components/FBasicCell.hpp" + #include "FCoreCommon.hpp" #include "FP2PExclusion.hpp" @@ -356,6 +358,12 @@ protected: } typename OctreeClass::Iterator avoidGotoLeftIterator(octreeIterator); + // FIXME: hack around a clang bug + // it apparently can't manage a firstprivate const member + // such as 'tree', but can manage a local copy... + // getting the height first, or making 'tree' shared both + // workaround it. + OctreeClass * const treeAlias = tree; // for each levels for(int idxLevel = FAbstractAlgorithm::upperWorkingLevel ; idxLevel < FAbstractAlgorithm::lowerWorkingLevel ; ++idxLevel ){ @@ -363,11 +371,11 @@ protected: const int separationCriteria = (idxLevel != FAbstractAlgorithm::lowerWorkingLevel-1 ? 1 : leafLevelSeparationCriteria); // for each cells do{ - #pragma omp task default(none) firstprivate(octreeIterator,separationCriteria,idxLevel) untied + #pragma omp task default(none) firstprivate(octreeIterator,separationCriteria,idxLevel,treeAlias,kernels) untied { const CellClass* neighbors[342]; int neighborPositions[342]; - const int counter = tree->getInteractionNeighbors( + const int counter = treeAlias->getInteractionNeighbors( neighbors, neighborPositions, octreeIterator.getCurrentGlobalCoordinate(), idxLevel, separationCriteria); @@ -381,13 +389,11 @@ protected: = octreeIterator.getCurrentCell(); std::array<const multipole_t*, 342> neighbor_multipoles; std::transform(neighbors, neighbors+counter, neighbor_multipoles.begin(), - [](const CellClass* c) { - return (c == nullptr ? nullptr - : &(c->getMultipoleData())); - }); + FBasicCell::getMultipoleDataFromCell<const CellClass, const multipole_t>); + std::array<const symbolic_data_t*, 342> neighbor_symbolics; std::transform(neighbors, neighbors+counter, neighbor_symbolics.begin(), - [](const CellClass* c) {return c;}); + FBasicCell::identity<const CellClass>); kernels[omp_get_thread_num()]->M2L( target_local_exp,