3from .RungeKuttaDG
import RungeKuttaDG
4from .SeparateSweeps
import SeparateSweeps
22 {% for PREDICATE_NO in range(0,PREDICATES|length) %}
24 not marker.hasBeenRefined()
26 marker.hasBeenEnclaveCell()
28 {{PREDICATES[PREDICATE_NO]}}
31 double* QOut = fineGridCell{{UNKNOWN_IDENTIFIER}}RhsEstimates.value + {{PREDICATE_NO}} * {{NUMBER_OF_DOFS_PER_CELL_2D}} * {{NUMBER_OF_UNKNOWNS}};
33 double* QOut = fineGridCell{{UNKNOWN_IDENTIFIER}}RhsEstimates.value + {{PREDICATE_NO}} * {{NUMBER_OF_DOFS_PER_CELL_3D}} * {{NUMBER_OF_UNKNOWNS}};
36 const int taskNumber = fineGridCell{{LABEL_NAME}}.getSemaphoreNumber();
37 if ( taskNumber>=0 ) {
38 double maxEigenvalue; // not used here
39 ::exahype2::EnclaveBookkeeping::getInstance().waitForTaskToTerminateAndCopyResultOver(
46 fineGridCell{{LABEL_NAME}}.setSemaphoreNumber( ::exahype2::EnclaveBookkeeping::NoEnclaveTaskNumber );
54 super(MergeEnclaveTaskOutcome, self).
__init__(solver)
55 self.
label_name = exahype2.grid.UpdateCellLabel.get_attribute_name(solver._name)
62 == peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
65 self.
_solver._init_dictionary_with_default_parameters(d)
66 self.
_solver.add_entries_to_text_replacement_dictionary(d)
68 d[
"PREDICATES"] = self.
_solver._secondary_sweeps_of_Runge_Kutta_step_on_cell
69 result = jinja2.Template(self.
Template).render(**d)
76 __name__.replace(
".py",
"").replace(
".",
"_") +
"_MergeEnclaveTaskOutcome"
84#include "exahype2/EnclaveBookkeeping.h"
91 Two separate sweeps per Runge-Kutta sweep where volumetric operations
92 are outsourced into dedicated tasks.
97 Use the attributes self.enclave_task_priority to change the priority of the
98 task. This value can either be a string that C++ can evaluate into a
99 priority or a plain numerical value. I set it to
101 self.enclave_task_priority = "tarch::multicore::Task::DefaultPriority-1"
112 number_of_face_projections,
117 plot_grid_properties,
118 pde_terms_without_state,
121 See superclass constructor for all the interesting info.
123 It is important to notice that we still use the separate sweep template classes
126 super(SeparateSweepsWithEnclaveTasking, self).
__init__(
130 number_of_face_projections,
135 plot_grid_properties,
136 pde_terms_without_state,
155 First, call the superclass' create_data_structures() to ensure that all
156 the data structures are in place.
158 The linear combination is to be computed if and only if
165 Call superclass routine and then reconfigure the update cell call.
166 Only the UpdateCell action set is specific to an enclave solver.
168 This operation is implicitly called via the superconstructor.
170 It is important that we add the action set at the right point. See
171 add_actions_to_perform_time_step() for a discussion.
185 SeparateSweepsWithEnclaveTasking, self
187 templatefile_prefix = os.path.join(
188 os.path.dirname(os.path.realpath(__file__)),
189 "SolveVolumeIntegral.EnclaveTask.template",
195 implementationDictionary = {}
205 generated_solver_files = (
207 "{}.h".format(templatefile_prefix),
208 "{}.cpp".format(templatefile_prefix),
210 namespace + [
"tasks"],
211 subdirectory +
"tasks",
212 implementationDictionary,
217 output.add(generated_solver_files)
218 output.makefile.add_cpp_file(subdirectory +
"tasks/" + task_name +
".cpp", generated=
True)
222 return "{}_VolumetricSolverEnclaveTask".format(self.
_name)
227 Add enclave aspect to time stepping. If you study the superclass'
228 routine add_actions_to_perform_time_step() and consider that this action
229 set is invoked in the secondary grid sweep, then it becomes clear that
230 this merger has to come first, i.e. we first add the action set and then
231 we call the superclass' add_action_set().
233 We need the result of the volumetric operation before we sum up this
234 volumetric solution and the Riemann solution.
245 d[
"FUSED_VOLUMETRIC_COMPUTE_KERNEL_CALL_STATELESS_CPU"] = jinja2.Template(
248 d[
"FUSED_VOLUMETRIC_COMPUTE_KERNEL_CALL_STATELESS_GPU"] = jinja2.Template(
251 d[
"FUSED_RIEMANN_COMPUTE_KERNEL_CALL_STATELESS_CPU"] = jinja2.Template(
254 d[
"FUSED_RIEMANN_COMPUTE_KERNEL_CALL_STATELESS_GPU"] = jinja2.Template(
258 d[
"SEMAPHORE_LABEL"] = exahype2.grid.UpdateCellLabel.get_attribute_name(
267 cell_data_storage: Storage,
268 face_data_storage: Storage,
270 if cell_data_storage == Storage.SmartPointers:
add_entries_to_text_replacement_dictionary(self, d)
tuple _action_set_solve_volume_integral
create_data_structures(self)
Recall in subclasses if you wanna change the number of unknowns or auxiliary variables.
create_action_sets(self)
Overwrite in subclasses if you wanna create different action sets.
user_action_set_includes(self)
Add further includes to this property, if your action sets require some additional routines from othe...
user_solver_includes(self)
Add further includes to this property, if your solver requires some additional routines from other he...
_init_dictionary_with_default_parameters(self, d)
This one is called by all algorithmic steps before I invoke add_entries_to_text_replacement_dictionar...
_baseline_action_set_descend_invocation_order
_solver_template_file_class_name
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_action_set_name(self)
You should replicate this function in each subclass, so you get meaningful action set names (otherwis...
get_includes(self)
Return include statements that you need.
Two separate sweeps per Runge-Kutta sweep where volumetric operations are outsourced into dedicated t...
add_actions_to_perform_time_step(self, step)
Add enclave aspect to time stepping.
switch_storage_scheme(self, Storage cell_data_storage, Storage face_data_storage)
By default, we hold all data on the call stacks.
add_implementation_files_to_project(self, namespace, output, dimensions, subdirectory="")
The ExaHyPE project will call this operation when it sets up the overall environment.
_volumetric_solver_enclave_task_name(self)
str enclave_task_priority
add_entries_to_text_replacement_dictionary(self, d)
str _fused_Riemann_compute_kernel_call_stateless_cpu
bool make_copy_of_enclave_task_data
str _fused_volumetric_compute_kernel_call_stateless_gpu
_action_set_merge_enclave_task_outcome
str _fused_volumetric_compute_kernel_call_stateless_cpu
__init__(self, name, rk_order, polynomial_basis, number_of_face_projections, unknowns, auxiliary_variables, min_cell_h, max_cell_h, plot_grid_properties, pde_terms_without_state)
See superclass constructor for all the interesting info.
create_data_structures(self)
First, call the superclass' create_data_structures() to ensure that all the data structures are in pl...
str _fused_Riemann_compute_kernel_call_stateless_gpu
create_action_sets(self)
Call superclass routine and then reconfigure the update cell call.
Probably the simplest solver you could think off.