Commit bc05cf97 authored by Quentin Khan's avatar Quentin Khan

FAdaptiveTask: inherit FAlgorithmInterface

parent 399b750e
......@@ -22,7 +22,7 @@
#include "FTimer.hpp"
template<class _Tree, class _Kernel>
class FAdaptiveTask {
class FAdaptiveTask : public FAlgorithmInterface {
public:
using tree_t = _Tree;
using kernel_t = _Kernel;
......@@ -166,15 +166,36 @@ public:
FAdaptiveTask(*tree, *kernel)
{}
~FAdaptiveTask() {
std::string name() const override {
return "Task adaptive algorithm";
}
void execute(int operations = FFmmNearAndFarFields) {
std::string description() const override {
int threads = 1;
#pragma omp parallel shared(threads)
{
#pragma omp single nowait
{
threads = omp_get_max_threads();
}
}
return std::string("threads: ") + std::to_string(threads);
}
using FAlgorithmInterface::execute;
/**
* \brief Run specific steps of the algorithm
*
* \param operations Specifies the algorithm operations to run, see
* FFmmOperations.
*/
void execute(const unsigned int operations) override {
this->run(operations);
}
void run(int operations = FFmmNearAndFarFields) {
void run(int operations) {
#pragma omp parallel
{
......
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