Peano
Loading...
Searching...
No Matches
SeparateSweeps.EnclaveTask.template.h
Go to the documentation of this file.
1// **********************************************************************************************
2// *** !!!WARNING!!! ***
3// *** WARNING: AUTO GENERATED FILE! DO NOT MODIFY BY HAND! YOUR CHANGES WILL BE OVERWRITTEN! ***
4// *** !!!WARNING!!! ***
5// *** Generated by Peano's Python API: www.peano-framework.org ***
6// **********************************************************************************************
7#pragma once
8
9#include "repositories/SolverRepository.h"
10
12
14
17
18{{SOLVER_INCLUDES}}
19
20#include <vector>
21
22#ifdef UseSmartMPI
23#include "smartmpi.h"
24#endif
25
26{% for item in NAMESPACE -%}
27 namespace {{ item }} {
28
29{%- endfor %}
30 class {{CLASSNAME}};
31
32{% for item in NAMESPACE -%}
33 }
34{%- endfor %}
35
36
37
43class {{NAMESPACE | join("::")}}::{{CLASSNAME}}: public ::exahype2::EnclaveTask
44#ifdef UseSmartMPI
45, public smartmpi::Task
46#endif
47{
48 private:
50
51 #ifdef UseSmartMPI
52 /*
53 * This uniquely identifies an enclave task. Unlike _enclaveTaskTypeId it
54 * differentiates between tasks within a task type, not between task types.
55 *
56 * Crucially, the value of this ID is not necessarily the same as that of
57 * tarch::multicore::Task::_id . That is because _id is reset each time
58 * we move a task to another rank and reconstitute it there (see the constructor
59 * of tarch::multicore::Task). Instead, _remoteTaskId tracks the ID of
60 * the original task object (i.e. the task originally spawned and
61 * only then moved). In smartmpi we need to keep track of the task's
62 * ID so that it can be bookmarked correctly after being moved around.
63 *
64 * As such moveTask(...), sends _id if the task has not yet been
65 * moved and _remoteTaskId if it has already been moved. Similarly,
66 * _remoteTaskId is always sent when forwarding task outcomes since the
67 * task will already have been moved.
68 */
69 int _remoteTaskId = -1;
70 #endif
71
76 static int _enclaveTaskTypeId;
77
78 public:
79 static int getEnclaveTaskTypeId();
80
95 static double applyKernelToCell(
96 const ::peano4::datamanagement::CellMarker& marker,
97 double t,
98 double dt,
99 double* __restrict__ reconstructedPatch,
100 double* __restrict__ targetPatch
101 );
102
103
111 {{CLASSNAME}}(
112 const ::peano4::datamanagement::CellMarker& marker,
113 double t,
114 double dt,
115 double* __restrict__ reconstructedPatch,
116 double* __restrict__ output
117 );
118
119
120 #ifdef UseSmartMPI
121 virtual bool isSmartMPITask() const override;
122 virtual void runLocally() override;
123 virtual void moveTask(int rank, int tag, MPI_Comm communicator) override;
124 virtual void runLocallyAndSendTaskOutputToRank(int rank, int tag, MPI_Comm communicator) override;
125 virtual void forwardTaskOutputToRank(int rank, int tag, MPI_Comm communicator) override;
126
127 static smartmpi::Task* receiveTask(int rank, int tag, MPI_Comm communicator);
128 static smartmpi::Task* receiveOutcome(int rank, int tag, MPI_Comm communicator, const bool intentionToForward);
129 #endif
130
131 {% if STATELESS_PDE_TERMS %}
132 virtual void fuse( const std::list<Task*>& otherTasks, int targetDevice=Host ) override;
133 virtual bool canFuse() const override;
134 {% endif %}
135};
136
137
138
139
140
141{# Empty line here #}
142
Log Device.
Definition Log.h:516
tarch::logging::Log _log("exahype2::fv")
float dt
Definition DSL_test.py:5