Peano
Loading...
Searching...
No Matches
solvers.fv.EnclaveTasking.EnclaveTasking Class Reference

Enclave tasking variant of the Finite Volume scheme. More...

Inheritance diagram for solvers.fv.EnclaveTasking.EnclaveTasking:
Collaboration diagram for solvers.fv.EnclaveTasking.EnclaveTasking:

Public Member Functions

 __init__ (self, name, patch_size, overlap, unknowns, auxiliary_variables, min_volume_h, max_volume_h, plot_grid_properties, bool pde_terms_without_state, kernel_namespace)
 Not so nice.
 create_data_structures (self)
 This routine does not really add new data, but it heavily tailors when data are stored, exchanged, ... Each generator has some guard attributes, i.e., some guards, which control when data is stored, sent, received.
 create_action_sets (self)
 Adaptive mesh handing.
 set_implementation (self, boundary_conditions, refinement_criterion, initial_conditions, memory_location, use_split_loop, additional_action_set_includes, additional_user_includes)
 If you pass in User_Defined, then the generator will create C++ stubs that you have to befill manually.
 add_entries_to_text_replacement_dictionary (self, d)
 d: Dictionary of string to string in/out argument
 add_actions_to_create_grid (self, step, evaluate_refinement_criterion)
 The boundary information is set only once.
 add_actions_to_init_grid (self, step)
 Add all the action sets to init grid.
 add_actions_to_perform_time_step (self, step)
 Add enclave aspect to time stepping.
 add_implementation_files_to_project (self, namespace, output, dimensions, subdirectory="")
 The ExaHyPE project will call this operation when it sets up the overall environment.
 switch_storage_scheme (self, Storage cell_data_storage, Storage face_data_storage)
 By default, we hold all data on the heap using smart pointers.
Public Member Functions inherited from solvers.fv.FV.FV
 __init__ (self, name, patch_size, overlap, unknowns, auxiliary_variables, min_volume_h, max_volume_h, plot_grid_properties, bool pde_terms_without_state, kernel_namespace, baseline_action_set_descend_invocation_order=0)
 Create solver.
 __str__ (self)
 get_min_number_of_spacetree_levels (self, domain_size)
 get_max_number_of_spacetree_levels (self, domain_size)
 get_coarsest_number_of_patches (self, domain_size)
 get_finest_number_of_patches (self, domain_size)
 get_coarsest_number_of_finite_volumes (self, domain_size)
 get_finest_number_of_finite_volumes (self, domain_size)
 get_coarsest_volume_size (self, domain_size)
 get_finest_volume_size (self, domain_size)
 create_readme_descriptor (self, domain_offset, domain_size)
 user_action_set_includes (self)
 Add further includes to this property, if your action sets require some additional routines from other header files.
 user_solver_includes (self)
 Add further includes to this property, if your solver requires some additional routines from other header files.
 add_user_action_set_includes (self, value)
 Add further includes to this property, if your action sets require some additional routines from other header files.
 add_user_solver_includes (self, value)
 Add further includes to this property, if your solver requires some additional routines from other header files.
 get_name_of_global_instance (self)
 add_to_Peano4_datamodel (self, datamodel, verbose)
 Add all required data to the Peano project's datamodel so it is properly built up.
 add_use_data_statements_to_Peano4_solver_step (self, step)
 Tell Peano what data to move around.
 plot_description (self)
 plot_description (self, description)
 Add a proper description to the plots.
 add_actions_to_plot_solution (self, step, output_path, restart_from_checkpoint=False)
 Add action sets to plot solution step.
 add_actions_to_checkpoint_solution (self, step, output_path, restart_from_checkpoint=False)
 Add action sets to plot solution step.
 set_solver_constants (self, datastring)
 add_solver_constants (self, datastring)
 unknowns (self)
 patch_size (self)
 auxiliary_variables (self)
 patch_size (self, value)
 unknowns (self, value)
 auxiliary_variables (self, value)
 preprocess_reconstructed_patch (self)
 preprocess_reconstructed_patch (self, kernel)
 Set a new processing kernel.
 name (self)
 postprocess_updated_patch (self)
 postprocess_updated_patch (self, kernel)
 Define a postprocessing routine over the data.
 overlap (self)
 overlap (self, value)
 interpolation (self)
 interpolation (self, value)
 restriction (self)
 restriction (self, value)

Data Fields

str enclave_task_priority = "tarch::multicore::Task::DefaultPriority-1"
bool make_copy_of_enclave_task_data = False
Data Fields inherited from solvers.fv.FV.FV
 select_dofs_to_print = None

Protected Member Functions

 _create_guards (self)
 All the internal logic depends on guards, i.e., boolean predicates.
 _optimise_patch_storage_for_global_time_stepping (self)
 Make storage and loading more restrictive such that enclave data are not held in-between primary and secondary sweep.
 _enclave_task_name (self)
Protected Member Functions inherited from solvers.fv.FV.FV
 _provide_cell_data_to_compute_kernels_default_guard (self)
 Default logic when to create cell data or not.
 _provide_face_data_to_compute_kernels_default_guard (self)
 _store_cell_data_default_guard (self)
 Extend the guard via ands only.
 _load_cell_data_default_guard (self)
 Extend the guard via ands only.
 _store_face_data_default_guard (self)
 Extend the guard via ands only.
 _load_face_data_default_guard (self)
 Extend the guard via ands only.
 _unknown_identifier (self)
 _get_default_includes (self)
 _init_dictionary_with_default_parameters (self, d)
 This one is called by all algorithmic steps before I invoke add_entries_to_text_replacement_dictionary().

Protected Attributes

str _fused_compute_kernel_call_stateless_cpu = "#error Not yet defined"
str _fused_compute_kernel_call_stateless_gpu = "#error Not yet defined"
tuple _initialisation_sweep_guard
tuple _first_iteration_after_initialisation_guard
tuple _primary_sweep_guard
str _primary_sweep_or_plot_guard
str _primary_or_initialisation_sweep_guard
str _primary_or_grid_construction_or_initialisation_sweep_guard
tuple _secondary_sweep_guard
tuple _secondary_sweep_or_grid_construction_guard
tuple _secondary_sweep_or_grid_initialisation_guard
str _secondary_sweep_or_grid_initialisation_or_plot_guard
 _action_set_merge_enclave_task_outcome = MergeEnclaveTaskOutcome(self)
 _use_split_loop = use_split_loop
Protected Attributes inherited from solvers.fv.FV.FV
 _name = name
 _min_volume_h = min_volume_h
 _max_volume_h = max_volume_h
 _plot_grid_properties = plot_grid_properties
 _patch_size = patch_size
 _overlap = overlap
bool _use_var_shortcut = False
list _variable_names = []
list _variable_pos = [0]
 _unknowns = sum(unknowns.values())
 _auxiliary_variables = sum(auxiliary_variables.values())
str _solver_constants = ""
str _user_action_set_includes = ""
str _user_solver_includes = ""
tuple _reconstructed_array_memory_location
 _solver_template_file_class_name = None
str _plot_description = ""
tuple _action_set_initial_conditions = None
tuple _action_set_initial_conditions_for_grid_construction = None
 _action_set_AMR = None
 _action_set_AMR_throughout_grid_construction = None
tuple _action_set_AMR_commit_without_further_analysis = None
tuple _action_set_handle_boundary = None
tuple _action_set_project_patch_onto_faces = None
tuple _action_set_roll_over_update_of_faces = None
tuple _action_set_copy_new_faces_onto_old_faces = None
tuple _action_set_couple_resolution_transitions_and_handle_dynamic_mesh_refinement
tuple _action_set_postprocess_solution = None
tuple _action_set_preprocess_solution = None
str _compute_time_step_size = "#error Not yet defined"
str _compute_new_time_step_size = "#error Not yet defined"
str _preprocess_reconstructed_patch = ""
str _postprocess_updated_patch = ""
str _compute_kernel_call = "#error Not yet defined"
str _compute_kernel_call_stateless = "#error Not yet defined"
 _pde_terms_without_state = pde_terms_without_state
bool _compute_eigenvalue = False
str _abstract_solver_user_declarations = ""
str _abstract_solver_user_definitions = ""
str _solver_user_declarations = ""
str _solver_user_definitions = ""
str _start_time_step_implementation = ""
str _finish_time_step_implementation = ""
str _constructor_implementation = ""
 _boundary_conditions_implementation = None
 _refinement_criterion_implementation = None
 _initial_conditions_implementation = None
str _interpolation = "piecewise_constant"
str _restriction = "averaging"
 _kernel_namespace = kernel_namespace
 _baseline_action_set_descend_invocation_order = baseline_action_set_descend_invocation_order
 _patch
 _patch_overlap_old
 _patch_overlap_new
 _patch_overlap_update
 _cell_data_storage = Storage.CallStack:
 _face_data_storage = Storage.CallStack:
 _cell_label = exahype2.grid.create_cell_label(self._name)
 _face_label = exahype2.grid.create_face_label(self._name)
 _action_set_update_face_label = exahype2.grid.UpdateFaceLabel(self._name)
 _action_set_update_cell_label = exahype2.grid.UpdateCellLabel(self._name)
 _action_set_update_cell = None

Detailed Description

Enclave tasking variant of the Finite Volume scheme.

The concept of (enclave) tasking within ExaHyPE solvers is described in detail in the generic enclave discussion of ExaHyPE. This class is a prototype realisation of this concept which other solvers then specialise for particular numerical schemes.

The class basically replaces the standard "update a cell" action set with an action set that might or might not spawn a task. In return, it adds a further action set which merges the arising task outcomes into the actual mesh structure. By default, we use peano4.datamanagement.CellMarker.willBeEnclaveCell() and peano4.datamanagement.CellMarker.hasBeenEnclaveCell() to guide the decision whether to spawn a task or not. You can overwrite this decision by redefining the corresponding entry in the dictionary befilled by add_entries_to_text_replacement_dictionary().

Task priorities

Use the attributes self.enclave_task_priority to change the priority of the task. This value can either be a string that C++ can evaluate into a priority or a plain numerical value. I set it to

   self.enclave_task_priority  = "tarch::multicore::Task::DefaultPriority-1"

by default.

Definition at line 300 of file EnclaveTasking.py.

Constructor & Destructor Documentation

◆ __init__()

solvers.fv.EnclaveTasking.EnclaveTasking.__init__ ( self,
name,
patch_size,
overlap,
unknowns,
auxiliary_variables,
min_volume_h,
max_volume_h,
plot_grid_properties,
bool pde_terms_without_state,
kernel_namespace )

Not so nice.

I have to store this field as I later rely on get_name_of_global_instance() which uses this field.

Definition at line 330 of file EnclaveTasking.py.

Member Function Documentation

◆ _create_guards()

solvers.fv.EnclaveTasking.EnclaveTasking._create_guards ( self)
protected

All the internal logic depends on guards, i.e., boolean predicates.

We want to be able to alter them in subclasses, but we need a certain baseline. It is defined in this routine.

Definition at line 375 of file EnclaveTasking.py.

Referenced by create_data_structures().

Here is the caller graph for this function:

◆ _enclave_task_name()

solvers.fv.EnclaveTasking.EnclaveTasking._enclave_task_name ( self)
protected

Definition at line 833 of file EnclaveTasking.py.

References api.solvers.Solver.Solver._name, api.Tree.Tree._name, dastgen2.attributes.Attribute.Attribute._name, dastgen2.attributes.BooleanArray.BooleanArray._name, dastgen2.attributes.Enumeration.Enumeration._name, exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling._name, exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling._name, exagrype.api.FOSOSolver.FOSOSolver._name, exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling._name, exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling._name, exahype2.api.AuxiliaryVariables.AuxiliaryVariables._name, exahype2.api.dslhype.SyntaxTree.Construction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromDotProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromExisting._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromFunction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromMatrixVectorProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromOperation._name, exahype2.api.dslhype.SyntaxTree.MemoryAllocation._name, exahype2.api.dslhype.SyntaxTree.MemoryDeallocation._name, exahype2.api.Solver.Solver._name, mghype::matrixfree::solvers::Solver._name, peano4.api.dastgen2.Peano4DoubleArray.Peano4DoubleArray._name, peano4.api.dastgen2.Peano4IntegerArray.Peano4IntegerArray._name, peano4.api.dastgen2.Peano4SmartPointerDoubleArray.Peano4SmartPointerDoubleArray._name, peano4::RunMultipleSteps._name, solvers.aderdg.ADERDG.ADERDG._name, solvers.api.Solver.Solver._name, solvers.elliptic.AMRMarker.AMRMarker._name, solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells._name, _name, and tarch::services::ServiceRepository::ServiceEntry._name.

Referenced by add_implementation_files_to_project().

Here is the caller graph for this function:

◆ _optimise_patch_storage_for_global_time_stepping()

solvers.fv.EnclaveTasking.EnclaveTasking._optimise_patch_storage_for_global_time_stepping ( self)
protected

Make storage and loading more restrictive such that enclave data are not held in-between primary and secondary sweep.

If you work with global time stepping, you know that each enclave cell will be updated per grid traversal duo. Consequently, every enclave cell's data doesn't have to be stored in-between two grid traversals - we know that it is currently outsourced to a task.

Things are different if we use local time stepping, as there will always be cells that are currently processed, and then there are cells which are not updated and which we consequently should keep.

If you want to have this optimisation, you have to call this routine explicitly in create_data_structures(). By default, we always store the patches all the time.

If we work with smart pointers, it is a bad idea to call this routine, as the enclave framework does not(!) use smart pointers. So we rely on the fact that someone holds the raw pointers alive. If we don't store data here, we run risk that the smart pointer becomes zero and the underlying memory is freed while the enclave task still works against it.

As I don't know what storage scheme we employ, I decided to disable this routine. Notably as I don't think storing makes much of a difference if data are held on the heap anyway.

Definition at line 539 of file EnclaveTasking.py.

Referenced by solvers.fv.rusanov.GlobalAdaptiveTimeStepWithEnclaveTasking.GlobalAdaptiveTimeStepWithEnclaveTasking.create_data_structures(), and solvers.fv.rusanov.GlobalFixedTimeStepWithEnclaveTasking.GlobalFixedTimeStepWithEnclaveTasking.create_data_structures().

Here is the caller graph for this function:

◆ add_actions_to_create_grid()

solvers.fv.EnclaveTasking.EnclaveTasking.add_actions_to_create_grid ( self,
step,
evaluate_refinement_criterion )

The boundary information is set only once.

It is therefore important that we ues the face label and initialise it properly.

Reimplemented from solvers.fv.FV.FV.

Definition at line 760 of file EnclaveTasking.py.

References api.solvers.Solver.Solver._name, api.Tree.Tree._name, dastgen2.attributes.Attribute.Attribute._name, dastgen2.attributes.BooleanArray.BooleanArray._name, dastgen2.attributes.Enumeration.Enumeration._name, exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling._name, exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling._name, exagrype.api.FOSOSolver.FOSOSolver._name, exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling._name, exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling._name, exahype2.api.AuxiliaryVariables.AuxiliaryVariables._name, exahype2.api.dslhype.SyntaxTree.Construction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromDotProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromExisting._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromFunction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromMatrixVectorProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromOperation._name, exahype2.api.dslhype.SyntaxTree.MemoryAllocation._name, exahype2.api.dslhype.SyntaxTree.MemoryDeallocation._name, exahype2.api.Solver.Solver._name, mghype::matrixfree::solvers::Solver._name, peano4.api.dastgen2.Peano4DoubleArray.Peano4DoubleArray._name, peano4.api.dastgen2.Peano4IntegerArray.Peano4IntegerArray._name, peano4.api.dastgen2.Peano4SmartPointerDoubleArray.Peano4SmartPointerDoubleArray._name, peano4::RunMultipleSteps._name, solvers.aderdg.ADERDG.ADERDG._name, solvers.api.Solver.Solver._name, solvers.elliptic.AMRMarker.AMRMarker._name, solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells._name, _name, tarch::services::ServiceRepository::ServiceEntry._name, and add_actions_to_create_grid().

Referenced by add_actions_to_create_grid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_actions_to_init_grid()

solvers.fv.EnclaveTasking.EnclaveTasking.add_actions_to_init_grid ( self,
step )

Add all the action sets to init grid.

The AMR stuff has to be the very first thing. Actually, the AMR routines' interpolation doesn't play any role here. But the restriction indeed is very important, as we have to get the face data for BCs et al. The action set order is inverted while we ascend within the tree again. Therefore, we add the AMR action set first which means it will be called last when we go from fine to coarse levels within the tree.

Ordering

The order of the action sets is preserved throughout the steps down within the tree hierarchy. It is inverted throughout the backrolling.

This is what we want to achieve:

  • Project solution onto faces. This happens in touchCellLastTime(). See exahype2.solvers.fv.actionsets.ProjectPatchOntoFaces for comments. The project will end up in QUpdate.
  • Roll updates over on the faces from QUpdate into Q_new. This is done by RollOverUpdateFace, which requires in turn that the getUpdated() flag is set. As the roll-over plugs into touchFaceLastTime(), it will always be called after the projection, since the latter is a cell operation.
  • Copy new face data Q_new into old face data Q_old, as this is the initial sweep, i.e. the old face data otherwise might hold rubbish. This is a backup operation realised through the action set BackupPatchOverlap. This one plugs into touchFaceLastTime() too. Therefore, it is important that its priority is smaller than the one of the roll-over, since we invert the call order for the touch-last events.
  • Restrict the data to the coarser level if we are on a hanging face.
  • The postprocessing is the very last thing. It does not matter if it plugs into touchCellFirstTime() or touchCellLastTime(). As we invert the order when we backtrace, the postprocessing will have completed before we invoke _action_set_project_patch_onto_faces, i.e. any update will be projected onto the faces.

Reimplemented from solvers.fv.FV.FV.

Definition at line 767 of file EnclaveTasking.py.

References api.solvers.Solver.Solver._name, api.Tree.Tree._name, dastgen2.attributes.Attribute.Attribute._name, dastgen2.attributes.BooleanArray.BooleanArray._name, dastgen2.attributes.Enumeration.Enumeration._name, exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling._name, exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling._name, exagrype.api.FOSOSolver.FOSOSolver._name, exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling._name, exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling._name, exahype2.api.AuxiliaryVariables.AuxiliaryVariables._name, exahype2.api.dslhype.SyntaxTree.Construction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromDotProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromExisting._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromFunction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromMatrixVectorProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromOperation._name, exahype2.api.dslhype.SyntaxTree.MemoryAllocation._name, exahype2.api.dslhype.SyntaxTree.MemoryDeallocation._name, exahype2.api.Solver.Solver._name, mghype::matrixfree::solvers::Solver._name, peano4.api.dastgen2.Peano4DoubleArray.Peano4DoubleArray._name, peano4.api.dastgen2.Peano4IntegerArray.Peano4IntegerArray._name, peano4.api.dastgen2.Peano4SmartPointerDoubleArray.Peano4SmartPointerDoubleArray._name, peano4::RunMultipleSteps._name, solvers.aderdg.ADERDG.ADERDG._name, solvers.api.Solver.Solver._name, solvers.elliptic.AMRMarker.AMRMarker._name, solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells._name, _name, tarch::services::ServiceRepository::ServiceEntry._name, and add_actions_to_init_grid().

Referenced by add_actions_to_init_grid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_actions_to_perform_time_step()

solvers.fv.EnclaveTasking.EnclaveTasking.add_actions_to_perform_time_step ( self,
step )

Add enclave aspect to time stepping.

There's a bunch of different things to do to extend my standard solver into an enclave solver. In this operation, we add the runtime logic, i.e., what happens at which point.

We need additional action sets that are triggered throughout the traversal in every second time step. I call this one task_based_implementation_primary_iteration or secondary, respectively. One wraps the implementation of _HandleCellTemplate into a task, the other communicates with the task bookkeeping only. Both rely on additional labels within the cell. We therefore end up with three new action sets: reconstruct_patch_and_apply_FV_kernel, exahype2.grid.UpdateCellLabel and roll_over_enclave_task_results.

Reimplemented from solvers.fv.FV.FV.

Definition at line 772 of file EnclaveTasking.py.

References _action_set_merge_enclave_task_outcome, and add_actions_to_perform_time_step().

Referenced by add_actions_to_perform_time_step().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_entries_to_text_replacement_dictionary()

solvers.fv.EnclaveTasking.EnclaveTasking.add_entries_to_text_replacement_dictionary ( self,
d )

d: Dictionary of string to string in/out argument

Reimplemented from solvers.fv.FV.FV.

Definition at line 717 of file EnclaveTasking.py.

References _fused_compute_kernel_call_stateless_cpu, _fused_compute_kernel_call_stateless_gpu, api.solvers.Solver.Solver._name, api.Tree.Tree._name, dastgen2.attributes.Attribute.Attribute._name, dastgen2.attributes.BooleanArray.BooleanArray._name, dastgen2.attributes.Enumeration.Enumeration._name, exagrype.api.euler.CCZ4WithEuler_OuterAdditiveCoupling.CCZ4WithEuler_OuterAdditiveCoupling._name, exagrype.api.euler.CCZ4WithEuler_OuterMultiplicativeCoupling.CCZ4WithEuler_OuterMultiplicativeCoupling._name, exagrype.api.FOSOSolver.FOSOSolver._name, exagrype.api.scalarfield.CCZ4WithScalarField_InnerCoupling.CCZ4WithScalarField_InnerCoupling._name, exagrype.api.scalarfield.CCZ4WithScalarField_OuterMultiplicativeCoupling.CCZ4WithScalarField_OuterMultiplicativeCoupling._name, exahype2.api.AuxiliaryVariables.AuxiliaryVariables._name, exahype2.api.dslhype.SyntaxTree.Construction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromDotProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromExisting._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromFunction._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromMatrixVectorProduct._name, exahype2.api.dslhype.SyntaxTree.DataBlockConstructionFromOperation._name, exahype2.api.dslhype.SyntaxTree.MemoryAllocation._name, exahype2.api.dslhype.SyntaxTree.MemoryDeallocation._name, exahype2.api.Solver.Solver._name, mghype::matrixfree::solvers::Solver._name, peano4.api.dastgen2.Peano4DoubleArray.Peano4DoubleArray._name, peano4.api.dastgen2.Peano4IntegerArray.Peano4IntegerArray._name, peano4.api.dastgen2.Peano4SmartPointerDoubleArray.Peano4SmartPointerDoubleArray._name, peano4::RunMultipleSteps._name, solvers.aderdg.ADERDG.ADERDG._name, solvers.api.Solver.Solver._name, solvers.elliptic.AMRMarker.AMRMarker._name, solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells._name, _name, tarch::services::ServiceRepository::ServiceEntry._name, enclave_task_priority, and make_copy_of_enclave_task_data.

Referenced by solvers.fv.FV.FV.add_actions_to_checkpoint_solution(), solvers.fv.FV.FV.add_actions_to_perform_time_step(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.add_actions_to_perform_time_step(), solvers.fv.FV.FV.add_actions_to_plot_solution(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.add_actions_to_plot_solution(), add_implementation_files_to_project(), and solvers.rkdg.SeparateSweepsWithEnclaveTasking.SeparateSweepsWithEnclaveTasking.add_implementation_files_to_project().

Here is the caller graph for this function:

◆ add_implementation_files_to_project()

solvers.fv.EnclaveTasking.EnclaveTasking.add_implementation_files_to_project ( self,
namespace,
output,
dimensions,
subdirectory = "" )

The ExaHyPE project will call this operation when it sets up the overall environment.

This routine is typically not invoked by a user.

output: peano4.api.output.Output

Reimplemented from solvers.fv.FV.FV.

Definition at line 793 of file EnclaveTasking.py.

References _enclave_task_name(), solvers.aderdg.ADERDG.ADERDG._init_dictionary_with_default_parameters(), solvers.aderdg.SingleSweep.SingleSweep._init_dictionary_with_default_parameters(), solvers.fv.FV.FV._init_dictionary_with_default_parameters(), solvers.aderdg.ADERDG.ADERDG.add_entries_to_text_replacement_dictionary(), solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.add_entries_to_text_replacement_dictionary(), add_entries_to_text_replacement_dictionary(), add_implementation_files_to_project(), solvers.aderdg.ADERDG.ADERDG.user_action_set_includes, solvers.fv.FV.FV.user_action_set_includes(), solvers.limiting.PosterioriLimiting.PosterioriLimiting.user_action_set_includes, solvers.limiting.StaticLimiting.StaticLimiting.user_action_set_includes, exagrype.api.CCZ4SolverBase.CCZ4SolverBase.user_solver_includes, exahype2.api.Solver.Solver.user_solver_includes(), solvers.aderdg.ADERDG.ADERDG.user_solver_includes, solvers.fv.FV.FV.user_solver_includes(), solvers.limiting.PosterioriLimiting.PosterioriLimiting.user_solver_includes, and solvers.limiting.StaticLimiting.StaticLimiting.user_solver_includes.

Referenced by add_implementation_files_to_project().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_action_sets()

solvers.fv.EnclaveTasking.EnclaveTasking.create_action_sets ( self)

Adaptive mesh handing.

Adaptive meshes require us to clear the patch overlaps and to restrict/interpolate. Obviously, there's no need to do this for a refined faces. So we can eliminate these cases a priori. Furthermore, we clear faces only in the primary sweep. We know that either the primary sweep (for skeleton) or the secondary sweep (for enclaves) will write in proper data into anything that's cleared, and we know that restriction only has to happen after the primary sweep, as all cells next to an adaptivity boundary are skeleton cells.

As pointed out, both interpolation and restriction are to be active for the first sweep only. We interpolate into hanging faces, and we have to restrict immediately again as they are non-persistent. The projection onto the (hanging) faces is also happening directly in the primary sweep, as the cells adjacent to the hanging face are skeleton cells.

AMR and adjust cell have to be there always, i.e., also throughout the grid construction. But the criterion is something that we only evaluate in the secondary sweep. That's when we have an updated/changed time step. If we identify coarsening and refinement instructions in the secondary sweep, the next primary one will actually see them and trigger the update. That is, the subsequent secondary switch will actually implement the grid changes, and we can evaluate the criteria again.

For dynamic AMR, this implies that we have to ensure that all changed grid parts are labelled as skeleton cells. This way, we can implement the AMR properly, we ensure that all the enclaves run in parallel, and we know that all data is held persistently on the stacks.

Reimplemented from solvers.fv.FV.FV.

Definition at line 580 of file EnclaveTasking.py.

References create_action_sets().

Referenced by solvers.fv.FV.FV.auxiliary_variables(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.auxiliary_variables(), create_action_sets(), solvers.fv.FV.FV.interpolation(), solvers.fv.FV.FV.overlap(), solvers.fv.FV.FV.patch_size(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.postprocess_updated_cell_after_final_linear_combination(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.postprocess_updated_cell_after_Runge_Kutta_step(), solvers.fv.FV.FV.postprocess_updated_patch(), solvers.fv.FV.FV.preprocess_reconstructed_patch(), solvers.fv.FV.FV.restriction(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.set_implementation(), solvers.fv.FV.FV.switch_storage_scheme(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.switch_storage_scheme(), solvers.fv.FV.FV.unknowns(), and solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_data_structures()

solvers.fv.EnclaveTasking.EnclaveTasking.create_data_structures ( self)

This routine does not really add new data, but it heavily tailors when data are stored, exchanged, ... Each generator has some guard attributes, i.e., some guards, which control when data is stored, sent, received.

The routine takes these guards and rewires them to the local guards of this object. If you alter these guards further, you have to alter them before you invoke this class' create_data_structures().

Reimplemented from solvers.fv.FV.FV.

Definition at line 512 of file EnclaveTasking.py.

References _create_guards(), _first_iteration_after_initialisation_guard, _initialisation_sweep_guard, solvers.fv.FV.FV._patch_overlap_new, solvers.fv.FV.FV._patch_overlap_old, _primary_sweep_or_plot_guard, _secondary_sweep_or_grid_initialisation_or_plot_guard, and create_data_structures().

Referenced by solvers.fv.FV.FV.auxiliary_variables(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.auxiliary_variables(), create_data_structures(), solvers.fv.FV.FV.interpolation(), solvers.fv.FV.FV.overlap(), solvers.fv.FV.FV.patch_size(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.postprocess_updated_cell_after_final_linear_combination(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.postprocess_updated_cell_after_Runge_Kutta_step(), solvers.fv.FV.FV.postprocess_updated_patch(), solvers.fv.FV.FV.preprocess_reconstructed_patch(), solvers.fv.FV.FV.restriction(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.set_implementation(), solvers.fv.FV.FV.switch_storage_scheme(), solvers.rkdg.RungeKuttaDG.RungeKuttaDG.switch_storage_scheme(), solvers.fv.FV.FV.unknowns(), and solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_implementation()

solvers.fv.EnclaveTasking.EnclaveTasking.set_implementation ( self,
boundary_conditions,
refinement_criterion,
initial_conditions,
memory_location,
use_split_loop,
additional_action_set_includes,
additional_user_includes )

If you pass in User_Defined, then the generator will create C++ stubs that you have to befill manually.

If you pass in None_Implementation, it will create nop, i.e., no implementation or defaults. Any other string is copied 1:1 into the implementation. If you pass in None, then the set value so far won't be overwritten.

Definition at line 671 of file EnclaveTasking.py.

◆ switch_storage_scheme()

solvers.fv.EnclaveTasking.EnclaveTasking.switch_storage_scheme ( self,
Storage cell_data_storage,
Storage face_data_storage )

By default, we hold all data on the heap using smart pointers.

You can explicitly switch to storage on the call stack or heap using raw pointers.

See also
create_data_structures()

Reimplemented from solvers.fv.FV.FV.

Definition at line 837 of file EnclaveTasking.py.

Field Documentation

◆ _action_set_merge_enclave_task_outcome

◆ _first_iteration_after_initialisation_guard

tuple solvers.fv.EnclaveTasking.EnclaveTasking._first_iteration_after_initialisation_guard
protected
Initial value:
= (
"("
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::PrimaryAfterGridInitialisation or "
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::PlottingInitialCondition"
+ ")"
)

Definition at line 391 of file EnclaveTasking.py.

Referenced by create_data_structures().

◆ _fused_compute_kernel_call_stateless_cpu

str solvers.fv.EnclaveTasking.EnclaveTasking._fused_compute_kernel_call_stateless_cpu = "#error Not yet defined"
protected

Definition at line 349 of file EnclaveTasking.py.

Referenced by add_entries_to_text_replacement_dictionary().

◆ _fused_compute_kernel_call_stateless_gpu

str solvers.fv.EnclaveTasking.EnclaveTasking._fused_compute_kernel_call_stateless_gpu = "#error Not yet defined"
protected

Definition at line 350 of file EnclaveTasking.py.

Referenced by add_entries_to_text_replacement_dictionary().

◆ _initialisation_sweep_guard

tuple solvers.fv.EnclaveTasking.EnclaveTasking._initialisation_sweep_guard
protected
Initial value:
= (
"("
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::GridInitialisation"
+ ")"
)

Definition at line 381 of file EnclaveTasking.py.

Referenced by create_data_structures().

◆ _primary_or_grid_construction_or_initialisation_sweep_guard

str solvers.fv.EnclaveTasking.EnclaveTasking._primary_or_grid_construction_or_initialisation_sweep_guard
protected
Initial value:
= """(
repositories::{}.getSolverState()=={}::SolverState::GridInitialisation
or repositories::{}.getSolverState()=={}::SolverState::Primary
or repositories::{}.getSolverState()=={}::SolverState::PrimaryAfterGridInitialisation
or repositories::{}.getSolverState()=={}::SolverState::GridConstruction
)""".format(
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
)

Definition at line 445 of file EnclaveTasking.py.

◆ _primary_or_initialisation_sweep_guard

str solvers.fv.EnclaveTasking.EnclaveTasking._primary_or_initialisation_sweep_guard
protected
Initial value:
= """(
repositories::{}.getSolverState()=={}::SolverState::GridInitialisation
or repositories::{}.getSolverState()=={}::SolverState::Primary
or repositories::{}.getSolverState()=={}::SolverState::PrimaryAfterGridInitialisation
)""".format(
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
)

Definition at line 435 of file EnclaveTasking.py.

◆ _primary_sweep_guard

tuple solvers.fv.EnclaveTasking.EnclaveTasking._primary_sweep_guard
protected
Initial value:
= (
"("
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::Primary or "
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::PrimaryAfterGridInitialisation"
+ ")"
)

Definition at line 406 of file EnclaveTasking.py.

◆ _primary_sweep_or_plot_guard

str solvers.fv.EnclaveTasking.EnclaveTasking._primary_sweep_or_plot_guard
protected
Initial value:
= """(
repositories::{}.getSolverState()=={}::SolverState::Primary
or repositories::{}.getSolverState()=={}::SolverState::PrimaryAfterGridInitialisation
or repositories::{}.getSolverState()=={}::SolverState::Plotting
or repositories::{}.getSolverState()=={}::SolverState::PlottingInitialCondition
or repositories::{}.getSolverState()=={}::SolverState::Suspended
)""".format(
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
)

Definition at line 421 of file EnclaveTasking.py.

Referenced by create_data_structures().

◆ _secondary_sweep_guard

tuple solvers.fv.EnclaveTasking.EnclaveTasking._secondary_sweep_guard
protected
Initial value:
= (
"("
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::Secondary"
+ ")"
)

Definition at line 457 of file EnclaveTasking.py.

◆ _secondary_sweep_or_grid_construction_guard

tuple solvers.fv.EnclaveTasking.EnclaveTasking._secondary_sweep_or_grid_construction_guard
protected
Initial value:
= (
"("
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::Secondary or "
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::GridConstruction"
+ ")"
)

Definition at line 467 of file EnclaveTasking.py.

◆ _secondary_sweep_or_grid_initialisation_guard

tuple solvers.fv.EnclaveTasking.EnclaveTasking._secondary_sweep_or_grid_initialisation_guard
protected
Initial value:
= (
"("
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::Secondary or "
+ "repositories::"
+ self.get_name_of_global_instance()
+ ".getSolverState()=="
+ self._name
+ "::SolverState::GridInitialisation"
+ ")"
)

Definition at line 482 of file EnclaveTasking.py.

◆ _secondary_sweep_or_grid_initialisation_or_plot_guard

str solvers.fv.EnclaveTasking.EnclaveTasking._secondary_sweep_or_grid_initialisation_or_plot_guard
protected
Initial value:
= """(
repositories::{}.getSolverState()=={}::SolverState::Secondary
or repositories::{}.getSolverState()=={}::SolverState::GridInitialisation
or repositories::{}.getSolverState()=={}::SolverState::PlottingInitialCondition
or repositories::{}.getSolverState()=={}::SolverState::Plotting
or repositories::{}.getSolverState()=={}::SolverState::Suspended
)""".format(
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
self.get_name_of_global_instance(), self._name,
)

Definition at line 497 of file EnclaveTasking.py.

Referenced by create_data_structures().

◆ _use_split_loop

solvers.fv.EnclaveTasking.EnclaveTasking._use_split_loop = use_split_loop
protected

Definition at line 697 of file EnclaveTasking.py.

◆ enclave_task_priority

str solvers.fv.EnclaveTasking.EnclaveTasking.enclave_task_priority = "tarch::multicore::Task::DefaultPriority-1"

◆ make_copy_of_enclave_task_data

bool solvers.fv.EnclaveTasking.EnclaveTasking.make_copy_of_enclave_task_data = False

The documentation for this class was generated from the following file: