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
10#include "config.h"
12
13
14namespace exahype2 {
15 class EnclaveTask;
16 class EnclaveBookkeeping;
17} // namespace exahype2
18
19
90public:
91 typedef std::function<void()> Functor;
92
93protected:
94 friend class EnclaveBookkeeping;
95
97
101 const int _taskNumber;
102 const ::peano4::datamanagement::CellMarker _marker;
103
110 const double _t;
111 const double _dt;
112 double* __restrict__ _inputValues;
113 double* __restrict__ _outputValues;
118
119public:
146 int enclaveTaskTypeId,
147 const ::peano4::datamanagement::CellMarker& marker,
148 double t,
149 double dt,
150 double* __restrict__ inputValues,
151 double* __restrict__ outputValues,
152 int numberOfInputValues,
153 int numberOfResultValues,
154 Functor functor
155 );
156
157 EnclaveTask(const EnclaveTask& other) = delete;
158 EnclaveTask(const EnclaveTask&& other) = delete;
159
160 virtual ~EnclaveTask() = default;
161
165 virtual void run() override;
166
177
181 int getTaskId() const;
182
184
185 static void releaseTaskNumber(int number);
186
197 static int reserveTaskNumber();
198private:
200};
Base class for all enclave tasks.
Definition EnclaveTask.h:89
EnclaveTask(const EnclaveTask &other)=delete
std::function< void()> Functor
Definition EnclaveTask.h:91
static tarch::logging::Log _log
Definition EnclaveTask.h:96
virtual void run() override
Computes a task and bookmarks the outcome.
EnclaveTask(const EnclaveTask &&other)=delete
virtual ~EnclaveTask()=default
double *__restrict__ _inputValues
const int _taskNumber
Each task needs a unique number, so we can look up its output.
static int getNumberOfActiveTasks()
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 int reserveTaskNumber()
Reserve a new enclave task number.
const double _t
These are the reconstructed values in the Finite Volume sense and the linear combination in the DG so...
const ::peano4::datamanagement::CellMarker _marker
static void releaseTaskNumber(int number)
int getTaskId() const
Return _taskNumber.
static tarch::multicore::TaskEnumerator _enumerator
Log Device.
Definition Log.h:516
Rank-global enumerator for tasks.
Abstract super class for a job.
Definition Task.h:21
This file is part of the multigrid project within Peano 4.
Definition __init__.py:1