Commit 3200d22e authored by BRAMAS Berenger's avatar BRAMAS Berenger

Make it work for the cheb starpu

parent baea627b
......@@ -285,7 +285,7 @@ public:
ParticlesAttachedClass leaf(leafHeader[id].nbParticles,
particlePosition[0] + leafHeader[id].offSet,
blockHeader->positionOffset,
particleAttributes[0] + leafHeader[id].offSet,
particleAttributes[NbSymbAttributes] + leafHeader[id].offSet,
blockHeader->attributeOffset);
function(&leaf);
}
......@@ -301,7 +301,7 @@ public:
return ParticlesAttachedClass(leafHeader[id].nbParticles,
particlePosition[0] + leafHeader[id].offSet,
blockHeader->positionOffset,
particleAttributes[0] + leafHeader[id].offSet,
particleAttributes[NbSymbAttributes] + leafHeader[id].offSet,
blockHeader->attributeOffset);
}
return ParticlesAttachedClass();
......
......@@ -150,7 +150,7 @@ public:
return ParticlesAttachedClass(leafHeader[id].nbParticles,
particlePosition[0] + leafHeader[id].offSet,
blockHeader->positionOffset,
particleAttributes[0] + leafHeader[id].offSet,
particleAttributes[NbSymbAttributes] + leafHeader[id].offSet,
blockHeader->attributeOffset);
}
return ParticlesAttachedClass();
......
......@@ -15,9 +15,10 @@
#include "../../Src/Kernels/P2P/FP2PParticleContainer.hpp"
#include "../../Src/Kernels/Chebyshev/FChebSymKernel.hpp"
#include "../../Src/Kernels/Chebyshev/FChebCell.hpp"
#include "Kernels/Interpolation/FInterpMatrixKernel.hpp"
#include "../../Src/GroupTree/Chebyshev/FChebCellPOD.hpp"
#include "../../Src/Utils/FMath.hpp"
#include "../../Src/Utils/FMemUtils.hpp"
#include "../../Src/Utils/FParameters.hpp"
......@@ -38,12 +39,6 @@
#include "../../Src/Utils/FParameterNames.hpp"
#include "../../Src/Components/FTestParticleContainer.hpp"
#include "../../Src/Components/FTestCell.hpp"
#include "../../Src/Components/FTestKernels.hpp"
#include "../../Src/Core/FFmmAlgorithm.hpp"
#include <memory>
......@@ -65,12 +60,19 @@ int main(int argc, char* argv[]){
// Initialize the types
static const int ORDER = 6;
typedef FInterpMatrixKernelR MatrixKernelClass;
typedef FChebCell<ORDER> GroupCellClass;
typedef FChebCellPODCore GroupCellSymbClass;
typedef FChebCellPODPole<ORDER> GroupCellUpClass;
typedef FChebCellPODLocal<ORDER> GroupCellDownClass;
typedef FChebCellPOD<ORDER> GroupCellClass;
typedef FP2PGroupParticleContainer<> GroupContainerClass;
typedef FGroupTree< GroupCellClass, GroupContainerClass, 5, FReal> GroupOctreeClass;
typedef FGroupTree< GroupCellClass, GroupCellSymbClass, GroupCellUpClass, GroupCellDownClass, GroupContainerClass, 1, 4, FReal> GroupOctreeClass;
#ifdef ScalFMM_USE_STARPU
typedef FStarPUAllYesCapacities<FChebSymKernel<GroupCellClass,GroupContainerClass,MatrixKernelClass,ORDER>> GroupKernelClass;
typedef FGroupTaskStarPUAlgorithm<GroupOctreeClass, typename GroupOctreeClass::CellGroupClass, GroupCellClass, GroupKernelClass, typename GroupOctreeClass::ParticleGroupClass, GroupContainerClass > GroupAlgorithm;
typedef FStarPUCpuWrapper<typename GroupOctreeClass::CellGroupClass, GroupCellClass, GroupKernelClass, typename GroupOctreeClass::ParticleGroupClass, GroupContainerClass> GroupCpuWrapper;
typedef FGroupTaskStarPUAlgorithm<GroupOctreeClass, typename GroupOctreeClass::CellGroupClass, GroupKernelClass, typename GroupOctreeClass::ParticleGroupClass, GroupCpuWrapper > GroupAlgorithm;
#elif defined(ScalFMM_USE_OMP4)
typedef FChebSymKernel<GroupCellClass,GroupContainerClass,MatrixKernelClass,ORDER> GroupKernelClass;
// Set the number of threads
......@@ -81,7 +83,6 @@ int main(int argc, char* argv[]){
//typedef FGroupSeqAlgorithm<GroupOctreeClass, typename GroupOctreeClass::CellGroupClass, GroupCellClass, GroupKernelClass, typename GroupOctreeClass::ParticleGroupClass, GroupContainerClass > GroupAlgorithm;
typedef FGroupTaskAlgorithm<GroupOctreeClass, typename GroupOctreeClass::CellGroupClass, GroupCellClass, GroupKernelClass, typename GroupOctreeClass::ParticleGroupClass, GroupContainerClass > GroupAlgorithm;
#endif
// Get params
const int NbLevels = FParameters::getValue(argc,argv,FParameterDefinitions::OctreeHeight.options, 5);
const int groupSize = FParameters::getValue(argc,argv,LocalOptionBlocSize.options, 250);
......@@ -133,7 +134,7 @@ int main(int argc, char* argv[]){
FReal*const allPosY = const_cast<FReal*>( allParticles.getPositions()[1]);
FReal*const allPosZ = const_cast<FReal*>( allParticles.getPositions()[2]);
groupedTree.forEachCellLeaf<FP2PGroupParticleContainer<> >([&](GroupCellClass* cellTarget, FP2PGroupParticleContainer<> * leafTarget){
groupedTree.forEachCellLeaf<FP2PGroupParticleContainer<> >([&](GroupCellClass cellTarget, FP2PGroupParticleContainer<> * leafTarget){
const FReal*const physicalValues = leafTarget->getPhysicalValues();
const FReal*const posX = leafTarget->getPositions()[0];
const FReal*const posY = leafTarget->getPositions()[1];
......@@ -171,7 +172,7 @@ int main(int argc, char* argv[]){
FMath::FAccurater potentialDiff;
FMath::FAccurater fx, fy, fz;
offsetParticles = 0;
groupedTree.forEachCellLeaf<FP2PGroupParticleContainer<> >([&](GroupCellClass* cellTarget, FP2PGroupParticleContainer<> * leafTarget){
groupedTree.forEachCellLeaf<FP2PGroupParticleContainer<> >([&](GroupCellClass cellTarget, FP2PGroupParticleContainer<> * leafTarget){
const FReal*const potentials = leafTarget->getPotentials();
const FReal*const forcesX = leafTarget->getForcesX();
const FReal*const forcesY = leafTarget->getForcesY();
......
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