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 = name
 dependencies = dependencies
 effect = effect
 cell_kernel = cell_kernel
 touch_vertex_first_time_kernel = touch_vertex_first_time_kernel
 touch_vertex_last_time_kernel = touch_vertex_last_time_kernel
 prepare_traversal_kernel = prepare_traversal_kernel
 unprepare_traversal_kernel = unprepare_traversal_kernel
 input_particles = input_particles
tuple includes
 cell_kernel_dependency_policy = cell_kernel_dependency_policy
tuple touch_vertex_first_time_dependency_policy
tuple 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,
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__()

◆ 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 = cell_kernel

Definition at line 229 of file AlgorithmStep.py.

◆ cell_kernel_dependency_policy

exaparty.api.particle.AlgorithmStep.AlgorithmStep.cell_kernel_dependency_policy = cell_kernel_dependency_policy

Definition at line 253 of file AlgorithmStep.py.

◆ dependencies

exaparty.api.particle.AlgorithmStep.AlgorithmStep.dependencies = dependencies

Definition at line 226 of file AlgorithmStep.py.

Referenced by __str__(), and peano4.api.taskgraph.Task.Task.add_dependency().

◆ effect

exaparty.api.particle.AlgorithmStep.AlgorithmStep.effect = effect

Definition at line 227 of file AlgorithmStep.py.

Referenced by __str__().

◆ includes

tuple exaparty.api.particle.AlgorithmStep.AlgorithmStep.includes
Initial value:
= (
+ includes +
# Since the extended LLVM compiler inlines particle iterator callbacks,
# callback definitions must appear before the iterators.
# Moving the include as far down as possible tries to guarantee this.
)

Definition at line 236 of file AlgorithmStep.py.

Referenced by peano4.api.datamodel.PatchToDoubleArray.PatchToDoubleArray._get_dictionary_for_output(), peano4.api.dastgen2.MPIAndStorageAspect.MPIAndStorageAspect.get_include(), and peano4.api.actionsets.ConstructRegularGrid.ConstructRegularGrid.get_includes().

◆ input_particles

exaparty.api.particle.AlgorithmStep.AlgorithmStep.input_particles = input_particles

Definition at line 235 of file AlgorithmStep.py.

◆ name

exaparty.api.particle.AlgorithmStep.AlgorithmStep.name = name

Definition at line 225 of file AlgorithmStep.py.

Referenced by solvers.aderdg.kernels.Gemms.Gemms.__init__(), 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(), __str__(), exaparty.api.particle.Particle.Particle._dependency_checks_modify_steps(), exagrype.api.CCZ4SolverBase.CCZ4SolverBase._insert_constraint_enforcement(), exaparty.api.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_algorithm_steps_dict(), exagrype.api.CCZ4SolverBase.CCZ4SolverBase._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(), exaparty.api.particle.tests.DisappearingParticleTest.DisappearingParticleTest.algorithm_steps(), exaparty.api.particle.tests.testLeapfrogFixedTimeStepSize.testLeapfrogFixedTimeStepSize.algorithm_steps(), exagrype.api.FOSOReconstructionSolver.FOSOReconstructionSolver.create_task_graph(), 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 = prepare_traversal_kernel

Definition at line 232 of file AlgorithmStep.py.

◆ touch_vertex_first_time_dependency_policy

tuple exaparty.api.particle.AlgorithmStep.AlgorithmStep.touch_vertex_first_time_dependency_policy
Initial value:
= (
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 = touch_vertex_first_time_kernel

Definition at line 230 of file AlgorithmStep.py.

◆ touch_vertex_last_time_dependency_policy

tuple exaparty.api.particle.AlgorithmStep.AlgorithmStep.touch_vertex_last_time_dependency_policy
Initial value:
= (
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 = touch_vertex_last_time_kernel

Definition at line 231 of file AlgorithmStep.py.

◆ unprepare_traversal_kernel

exaparty.api.particle.AlgorithmStep.AlgorithmStep.unprepare_traversal_kernel = unprepare_traversal_kernel

Definition at line 233 of file AlgorithmStep.py.


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