Peano
Loading...
Searching...
No Matches
EnclaveTask.h
Go to the documentation of this file.
1// This file is part of the ExaHyPE2 project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5
6#include <functional>
7
9#include "config.h"
11#include "tarch/Enumerator.h"
12
13
14namespace exahype2 {
15 class EnclaveTask;
16 class EnclaveBookkeeping;
17} // namespace exahype2
18
19
77public:
78 typedef std::function<void()> Functor;
79
80protected:
81 friend class EnclaveBookkeeping;
82
84
88 const int _taskNumber;
89 const ::peano4::datamanagement::CellMarker _marker;
90
97 const double _t;
98 const double _dt;
99 double* __restrict__ _inputValues;
100 double* __restrict__ _outputValues;
105
106public:
131 int enclaveTaskTypeId,
132 const ::peano4::datamanagement::CellMarker& marker,
133 double t,
134 double dt,
135 double* __restrict__ inputValues,
136 double* __restrict__ outputValues,
137 int numberOfInputValues,
138 int numberOfResultValues,
139 Functor functor
140 );
141
142 EnclaveTask(const EnclaveTask& other) = delete;
143 EnclaveTask(const EnclaveTask&& other) = delete;
144
145 virtual ~EnclaveTask() = default;
146
150 virtual void run() override;
151
161 void computeTask();
162
166 int getTaskId() const;
167
168 static int getNumberOfActiveTasks();
169
170 static void releaseTaskNumber(int number);
171
182 static int reserveTaskNumber();
183private:
185};
Base class for all enclave tasks.
Definition EnclaveTask.h:76
EnclaveTask(const EnclaveTask &other)=delete
std::function< void()> Functor
Definition EnclaveTask.h:78
virtual void run() override
Computes a task and bookmarks the outcome.
static tarch::logging::Log _log
Definition EnclaveTask.h:83
EnclaveTask(const EnclaveTask &&other)=delete
static int getNumberOfActiveTasks()
virtual ~EnclaveTask()=default
double *__restrict__ _inputValues
Definition EnclaveTask.h:99
static int reserveTaskNumber()
Reserve a new enclave task number.
static tarch::Enumerator _enumerator
const int _taskNumber
Each task needs a unique number, so we can look up its output.
Definition EnclaveTask.h:88
EnclaveTask(int enclaveTaskTypeId, const ::peano4::datamanagement::CellMarker &marker, double t, double dt, double *__restrict__ inputValues, double *__restrict__ outputValues, int numberOfInputValues, int numberOfResultValues, Functor functor)
Create plain enclave task.
void computeTask()
Compute the task.
double *__restrict__ _outputValues
static void releaseTaskNumber(int number)
const double _t
These are the reconstructed values in the Finite Volume sense and the linear combination in the DG so...
Definition EnclaveTask.h:97
const ::peano4::datamanagement::CellMarker _marker
Definition EnclaveTask.h:89
int getTaskId() const
Return _taskNumber.
Simple rank-global enumerator.
Definition Enumerator.h:24
Log Device.
Definition Log.h:516
Abstract super class for a job.
Definition Task.h:21
For the generic kernels that I use here most of the time.
Definition CellAccess.h:13