Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 46a78bce authored by Quentin Khan's avatar Quentin Khan

FFmmAlgorithmSectionTask: change to new kernel interface

parent f51eda5f
......@@ -16,6 +16,9 @@
#ifndef FFMMALGORITHMSECTIONTASK_HPP
#define FFMMALGORITHMSECTIONTASK_HPP
#include <algorithm>
#include <array>
#include <omp.h>
#include "../Utils/FGlobal.hpp"
......@@ -172,7 +175,10 @@ protected:
// and the list of particles
#pragma omp task firstprivate(octreeIterator)
{
kernels[omp_get_thread_num()]->P2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentListSrc());
kernels[omp_get_thread_num()]->P2M(
&(octreeIterator.getCurrentCell()->getMultipoleData()),
octreeIterator.getCurrentCell(),
octreeIterator.getCurrentListSrc());
}
} while(octreeIterator.moveRight());
......@@ -211,7 +217,17 @@ protected:
// child is an array (of 8 child) that may be null
#pragma omp task firstprivate(octreeIterator,idxLevel)
{
kernels[omp_get_thread_num()]->M2M( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), idxLevel);
using multipole_t = typename CellClass::multipole_t;
std::array<multipole_t*, 8> children_multipoles;
CellClass** children = octreeIterator.getCurrentChildren();
std::transform(children, children+8, children_multipoles.begin(),
[](CellClass* c) {return (c == nullptr ? nullptr
: &(c->getMultipoleData()));
});
kernels[omp_get_thread_num()]->M2M(
&(octreeIterator.getCurrentCell()->getMultipoleData()),
children_multipoles.data(),
idxLevel);
}
} while(octreeIterator.moveRight());
......@@ -273,7 +289,19 @@ protected:
if(counter){
#pragma omp task firstprivate(octreeIterator, neighbors, neighborPositions, counter,idxLevel)
{
kernels[omp_get_thread_num()]->M2L( octreeIterator.getCurrentCell() , neighbors, neighborPositions, counter, idxLevel);
using multipole_t = typename CellClass::multipole_t;
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()));
});
kernels[omp_get_thread_num()]->M2L(
&(octreeIterator.getCurrentCell()->getLocalExpansionData()),
neighbor_multipoles.data(),
neighborPositions,
counter, idxLevel);
}
}
......@@ -324,7 +352,19 @@ protected:
if(counter){
#pragma omp task firstprivate(octreeIterator, neighbors, neighborPositions, counter,idxLevel)
{
kernels[omp_get_thread_num()]->M2L( octreeIterator.getCurrentCell() , neighbors, neighborPositions, counter, idxLevel);
using multipole_t = typename CellClass::multipole_t;
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()));
});
kernels[omp_get_thread_num()]->M2L(
&(octreeIterator.getCurrentCell()->getLocalExpansionData()),
neighbor_multipoles.data(),
neighborPositions,
counter, idxLevel);
}
}
......@@ -365,7 +405,18 @@ protected:
do{
#pragma omp task firstprivate(octreeIterator,idxLevel)
{
kernels[omp_get_thread_num()]->L2L( octreeIterator.getCurrentCell() , octreeIterator.getCurrentChild(), idxLevel);
using local_expansion_t = typename CellClass::local_expansion_t;
std::array<local_expansion_t*, 8> children_expansions;
CellClass** children = octreeIterator.getCurrentChildren();
std::transform(children, children+8, children_expansions.begin(),
[](CellClass* c) {
return (c == nullptr ? nullptr
: &(c->getLocalExpansionData()));
});
kernels[omp_get_thread_num()]->L2L(
&(octreeIterator.getCurrentCell()->getLocalExpansionData()),
children_expansions.data(),
idxLevel);
}
} while(octreeIterator.moveRight());
......@@ -449,7 +500,10 @@ protected:
do{
#pragma omp task firstprivate(octreeIterator)
{
kernels[omp_get_thread_num()]->L2P(octreeIterator.getCurrentCell(), octreeIterator.getCurrentListTargets());
kernels[omp_get_thread_num()]->L2P(
&(octreeIterator.getCurrentCell()->getLocalExpansionData()),
octreeIterator.getCurrentCell(),
octreeIterator.getCurrentListTargets());
}
} while(octreeIterator.moveRight());
......
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