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( taskNumber, QOut, maxEigenvalue );
40 fineGridCell{{LABEL_NAME}}.setSemaphoreNumber( ::exahype2::EnclaveBookkeeping::NoEnclaveTaskNumber );
48 super(MergeEnclaveTaskOutcome, self).
__init__(solver)
49 self.
label_name = exahype2.grid.UpdateCellLabel.get_attribute_name(solver._name)
56 == peano4.solversteps.ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME
59 self.
_solver._init_dictionary_with_default_parameters(d)
60 self.
_solver.add_entries_to_text_replacement_dictionary(d)
62 d[
"PREDICATES"] = self.
_solver._secondary_sweeps_of_Runge_Kutta_step_on_cell
63 result = jinja2.Template(self.
Template).render(**d)
70 __name__.replace(
".py",
"").replace(
".",
"_") +
"_MergeEnclaveTaskOutcome"
78#include "exahype2/EnclaveBookkeeping.h"
85 Two separate sweeps per Runge-Kutta sweep where volumetric operations
86 are outsourced into dedicated tasks.
91 Use the attributes self.enclave_task_priority to change the priority of the
92 task. This value can either be a string that C++ can evaluate into a
93 priority or a plain numerical value. I set it to
95 self.enclave_task_priority = "tarch::multicore::Task::DefaultPriority-1"
106 number_of_face_projections,
111 plot_grid_properties,
112 pde_terms_without_state,
115 See superclass constructor for all the interesting info.
117 It is important to notice that we still use the separate sweep template classes
120 super(SeparateSweepsWithEnclaveTasking, self).
__init__(
124 number_of_face_projections,
129 plot_grid_properties,
130 pde_terms_without_state,
149 First, call the superclass' create_data_structures() to ensure that all
150 the data structures are in place.
152 The linear combination is to be computed if and only if
159 Call superclass routine and then reconfigure the update cell call.
160 Only the UpdateCell action set is specific to an enclave solver.
162 This operation is implicitly called via the superconstructor.
164 It is important that we add the action set at the right point. See
165 add_actions_to_perform_time_step() for a discussion.
179 SeparateSweepsWithEnclaveTasking, self
181 templatefile_prefix = os.path.join(
182 os.path.dirname(os.path.realpath(__file__)),
183 "SolveVolumeIntegral.EnclaveTask.template",
189 implementationDictionary = {}
199 generated_solver_files = (
201 "{}.h".format(templatefile_prefix),
202 "{}.cpp".format(templatefile_prefix),
204 namespace + [
"tasks"],
205 subdirectory +
"tasks",
206 implementationDictionary,
211 output.add(generated_solver_files)
212 output.makefile.add_cpp_file(subdirectory +
"tasks/" + task_name +
".cpp", generated=
True)
221 Add enclave aspect to time stepping. If you study the superclass'
222 routine add_actions_to_perform_time_step() and consider that this action
223 set is invoked in the secondary grid sweep, then it becomes clear that
224 this merger has to come first, i.e. we first add the action set and then
225 we call the superclass' add_action_set().
227 We need the result of the volumetric operation before we sum up this
228 volumetric solution and the Riemann solution.
239 d[
"FUSED_VOLUMETRIC_COMPUTE_KERNEL_CALL_STATELESS_CPU"] = jinja2.Template(
242 d[
"FUSED_VOLUMETRIC_COMPUTE_KERNEL_CALL_STATELESS_GPU"] = jinja2.Template(
245 d[
"FUSED_RIEMANN_COMPUTE_KERNEL_CALL_STATELESS_CPU"] = jinja2.Template(
248 d[
"FUSED_RIEMANN_COMPUTE_KERNEL_CALL_STATELESS_GPU"] = jinja2.Template(
252 d[
"SEMAPHORE_LABEL"] = exahype2.grid.UpdateCellLabel.get_attribute_name(
261 cell_data_storage: Storage,
262 face_data_storage: Storage,
264 if cell_data_storage == Storage.SmartPointers:
add_entries_to_text_replacement_dictionary(self, d)
_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.
__init__(self, solver)
solver: ADERDG Reference to creating class
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.
_solver_template_file_class_name
_fused_Riemann_compute_kernel_call_stateless_cpu
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.
_fused_volumetric_compute_kernel_call_stateless_gpu
_volumetric_solver_enclave_task_name(self)
_fused_Riemann_compute_kernel_call_stateless_gpu
add_entries_to_text_replacement_dictionary(self, d)
_action_set_merge_enclave_task_outcome
_fused_volumetric_compute_kernel_call_stateless_cpu
make_copy_of_enclave_task_data
__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...
create_action_sets(self)
Call superclass routine and then reconfigure the update cell call.
Probably the simplest solver you could think off.
_solver_template_file_class_name
create_data_structures(self)
First, call the superclass' create_data_structures() to ensure that all the data structures are in pl...
create_action_sets(self)
We invoke the superclass which creates all the action sets, and then we set the appropriate guards.