Peano
Loading...
Searching...
No Matches
exaparty.api.particle.AlgorithmStep.AlgorithmStep Class Reference

Defines the meta data around one algorithmic step per particle. More...

Inheritance diagram for exaparty.api.particle.AlgorithmStep.AlgorithmStep:
Collaboration diagram for exaparty.api.particle.AlgorithmStep.AlgorithmStep:

Data Structures

class  Dependencies
 An algorithmic step for one particle can depend on different pre-conditions: More...
 
class  Effect
 What happens in this algorithmic step per particle: More...
 
class  PeanoEventUsedBySwift
 Enumeration of different Peano events during a grid traversal into which ExaParty plugs in. More...
 

Public Member Functions

 __init__ (self, name, Dependencies dependencies, Effect effect, cell_kernel=None, touch_vertex_first_time_kernel=None, touch_vertex_last_time_kernel=None, prepare_traversal_kernel="", unprepare_traversal_kernel="", input_particles=None, includes="", cell_kernel_dependency_policy=None, touch_vertex_first_time_dependency_policy=None, touch_vertex_last_time_dependency_policy=None)
 The algorithmic step description is a meta data object, i.e.
 
 __str__ (self)
 

Static Public Member Functions

 may_trigger_rerun (Effect effect)
 Return True if the effect object may trigger a rerun.
 
 get_event_name (PeanoEventUsedBySwift stage)
 Get the name as a string of a sweep stage for a given PeanoEventUsedBySwift enum.
 

Data Fields

 name
 
 dependencies
 
 effect
 
 cell_kernel
 
 touch_vertex_first_time_kernel
 
 touch_vertex_last_time_kernel
 
 prepare_traversal_kernel
 
 unprepare_traversal_kernel
 
 input_particles
 
 includes
 
 cell_kernel_dependency_policy
 
 touch_vertex_first_time_dependency_policy
 
 touch_vertex_last_time_dependency_policy
 

Detailed Description

Defines the meta data around one algorithmic step per particle.

A sequence of these steps describes the particle lifecycle per time step. It is Peano's/ExaParty's responsibility to arrange these steps in grid sweeps and to identify concurrency.

Definition at line 11 of file AlgorithmStep.py.

Constructor & Destructor Documentation

◆ __init__()

exaparty.api.particle.AlgorithmStep.AlgorithmStep.__init__ (   self,
  name,
Dependencies  dependencies,
Effect  effect,
  cell_kernel = None,
  touch_vertex_first_time_kernel = None,
  touch_vertex_last_time_kernel = None,
  prepare_traversal_kernel = "",
  unprepare_traversal_kernel = "",
  input_particles = None,
  includes = "",
  cell_kernel_dependency_policy = None,
  touch_vertex_first_time_dependency_policy = None,
  touch_vertex_last_time_dependency_policy = None 
)

The algorithmic step description is a meta data object, i.e.

it only holds properties.

Parameters/attributes

Parameters
cell_kernelC++ code (string) Kernel invocation what happens in a cell. Set to None if nothing is to be done per cell.
touch_vertex_first_time_kernelC++ code (string) Kernel invocation what happens when we read a vertex and its particles for the first time. Set to None if nothing is to be done.
touch_vertex_last_time_kernelC++ code (string) Kernel invocation what happens when we read a vertex and its particles for the last time. Set to None if nothing is to be done.
input_particlesParticleSet Switch to None in most cases. This fragment gives you the opportunity to couple the particles of one step with another particle species. If you hand in None, then we assume that the algorithm step updates the particles as input function from the particles.
includesString Additional include statements

prepare_traversals_kernel = None,

Parameters
prepare_traversal_kernelString (C++ code snippet) Whenever Peano runs through the mesh, it creates one instance of the mesh observer and then runs through all subpartitions (trees) in parallel. Each replica of the observer issues its own touchVertexFirstTime(), touchCellLastTime(), ... events, and each replica starts its traversal with a call to beginTraversal() and endTraversal(). If you want to plug into the phase such before these parallel instances are created, you can use prepareTraversal() - the C++ code snippet passed to this attribute is copied into prepareTraversal(). The overview over action sets provides more details. Note that no action set (or observer object) is created at this point, i.e. the C++ code snippet will be injected into a static routine and can therefore only access static information. Often, this routine is used for some MPI communication (global data exchange), e.g., or to update some other static properties for whole sets of objects.
unprepare_traversal_kernelString (C++ code snippet) Counterpart of prepare_traversal_kernel. Consult action sets for more context.
cell_kernel_dependency_policyString or None If it is a string, it should identify one of the variants of exaparty::dependencychecks::Invariant. If you pick None, ExaParty will add default dependencies. They might be too strict.
touch_vertex_first_time_dependency_policyString or None If it is a string, it should identify one of the variants of exaparty::dependencychecks::Invariant. If you pick None, ExaParty will add default dependencies. They might be too strict.
touch_vertex_last_time_dependency_policyString or None If it is a string, it should identify one of the variants of exaparty::dependencychecks::Invariant. If you pick None, ExaParty will add default dependencies. They might be too strict.

Definition at line 143 of file AlgorithmStep.py.

Member Function Documentation

◆ __str__()

exaparty.api.particle.AlgorithmStep.AlgorithmStep.__str__ (   self)

Definition at line 261 of file AlgorithmStep.py.

References exaparty.api.particle.AlgorithmStep.AlgorithmStep.dependencies, exaparty.api.particle.AlgorithmStep.AlgorithmStep.effect, solvers.aderdg.kernels.Gemms.Gemms.name, solvers.elliptic.ConstrainedPoissonEquationForMarkerOnCells.ConstrainedPoissonEquationForMarkerOnCells.name(), solvers.fv.FV.FV.name(), convert::data::Variable.name, dastgen2.attributes.Attribute.Attribute.name(), dastgen2.DataModel.DataModel.name(), exagrype.api.CCZ4Solver.CCZ4Solver.name, exahype2.api.PDETerm.PDETerm.name, exahype2.api.Solver.Solver.Plotter.name, exahype2.api.Solver.Solver.name(), exaparty.api.particle.AlgorithmStep.AlgorithmStep.name, exaparty.api.particle.Particle.Particle.name, exaparty.api.particle.tests.DisappearingParticleTest.DisappearingParticleTest.name, exaparty.api.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.name, solvers.api.Solver.Solver.name(), api.solvers.Solver.Solver.name(), peano4.api.datamodel.DoF.DoF.name, peano4.api.solversteps.Step.Step.name, peano4.api.solversteps.UserActionSet.UserActionSet.name, peano4.api.taskgraph.compiler.fuse-steps-illustrations._IllustrationActionSet.name, peano4.api.taskgraph.compiler.fuse-steps-illustrations._IllustrationSubmodel.name, peano4.api.taskgraph.Task.Task.name, peano4.api.toolbox.particles.Particle.Particle.name, test_derive_load_store_compute_flag._FakeSubmodel.name, test_fuse_steps._FakeActionSet.name, test_fuse_steps._FakeSubmodel.name, test_propagate_use_statements._FakeSubmodel.name, and test_task_groups._FakeActionSet.name.

Referenced by peano4.api.toolbox.particles.postprocessing.ParticleVTUReader.VTUParticleSet.__repr__().

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

◆ get_event_name()

exaparty.api.particle.AlgorithmStep.AlgorithmStep.get_event_name ( PeanoEventUsedBySwift  stage)
static

Get the name as a string of a sweep stage for a given PeanoEventUsedBySwift enum.

Definition at line 129 of file AlgorithmStep.py.

◆ may_trigger_rerun()

exaparty.api.particle.AlgorithmStep.AlgorithmStep.may_trigger_rerun ( Effect  effect)
static

Return True if the effect object may trigger a rerun.

If an algorithm step can trigger a rerun, this implies that any graph compiler, i.e. any translation into a sequence of Peano observers, has to be aware that the step might be executed multiple times. Hence,it cannot fuse it with other steps arbitrarily.

Technically, the possibility of a rerun has to be captured in the runner of an ExaParty project. After each step, it queries repositories::rerunPreviousGridSweep() to find out if we should stick with the current observer.

See also
ExaPartyMain.template.cpp

The decision of a rerun is tied to the species, so each species has a flag and this flag is reduced by repositories::rerunPreviousGridSweep().

Parameters
effectEffect The effect of an AlgorithmStep to check.
Returns
may_trigger_rerun: Bool True if effect is one of the *_AND_MIGHT_RERUN variants of Effect.

Definition at line 72 of file AlgorithmStep.py.

Field Documentation

◆ cell_kernel

exaparty.api.particle.AlgorithmStep.AlgorithmStep.cell_kernel

Definition at line 229 of file AlgorithmStep.py.

◆ cell_kernel_dependency_policy

exaparty.api.particle.AlgorithmStep.AlgorithmStep.cell_kernel_dependency_policy

Definition at line 253 of file AlgorithmStep.py.

◆ dependencies

exaparty.api.particle.AlgorithmStep.AlgorithmStep.dependencies

◆ effect

exaparty.api.particle.AlgorithmStep.AlgorithmStep.effect

◆ includes

◆ input_particles

exaparty.api.particle.AlgorithmStep.AlgorithmStep.input_particles

Definition at line 235 of file AlgorithmStep.py.

◆ name

exaparty.api.particle.AlgorithmStep.AlgorithmStep.name

Definition at line 225 of file AlgorithmStep.py.

Referenced by solvers.aderdg.kernels.Gemms.Gemms.__repr__(), test_derive_load_store_compute_flag._FakeSubmodel.__repr__(), test_propagate_use_statements._FakeSubmodel.__repr__(), exaparty.api.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.__setup_algorithm_steps(), exaparty.api.particle.AlgorithmStep.AlgorithmStep.__str__(), exahype2.api.Solver.Solver.Plotter._add_time_interval_bookkeeping_to_solver(), exaparty.api.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_algorithm_steps_dict(), exagrype.api.CCZ4Solver.CCZ4Solver._tasks_of_this_solver(), peano4.api.datamodel.DoF.DoF.additional_load_and_store_arguments_for_other_dof(), exaparty.api.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.algorithm_steps(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.algorithm_steps(), exahype2.api.Solver.Solver.Plotter.create_finish_call(), exahype2.api.Solver.Solver.Plotter.create_is_active_predicate(), peano4.api.solversteps.UserActionSet.UserActionSet.get_action_set_name(), peano4.api.taskgraph.compiler.fuse-steps-illustrations._IllustrationActionSet.get_action_set_name(), test_fuse_steps._FakeActionSet.get_action_set_name(), peano4.api.datamodel.DoF.DoF.get_full_qualified_type(), peano4.api.datamodel.DoF.DoF.get_logical_type_name(), peano4.api.solversteps.Step.Step.get_observer_class_name(), dastgen2.attributes.Enumeration.Enumeration.get_to_string(), and exaparty.api.particle.Particle.Particle.readme_descriptor().

◆ prepare_traversal_kernel

exaparty.api.particle.AlgorithmStep.AlgorithmStep.prepare_traversal_kernel

Definition at line 232 of file AlgorithmStep.py.

◆ touch_vertex_first_time_dependency_policy

exaparty.api.particle.AlgorithmStep.AlgorithmStep.touch_vertex_first_time_dependency_policy

Definition at line 254 of file AlgorithmStep.py.

◆ touch_vertex_first_time_kernel

exaparty.api.particle.AlgorithmStep.AlgorithmStep.touch_vertex_first_time_kernel

Definition at line 230 of file AlgorithmStep.py.

◆ touch_vertex_last_time_dependency_policy

exaparty.api.particle.AlgorithmStep.AlgorithmStep.touch_vertex_last_time_dependency_policy

Definition at line 257 of file AlgorithmStep.py.

◆ touch_vertex_last_time_kernel

exaparty.api.particle.AlgorithmStep.AlgorithmStep.touch_vertex_last_time_kernel

Definition at line 231 of file AlgorithmStep.py.

◆ unprepare_traversal_kernel

exaparty.api.particle.AlgorithmStep.AlgorithmStep.unprepare_traversal_kernel

Definition at line 233 of file AlgorithmStep.py.


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