|
Peano
|
Functions | |
| None | derive_load_store_compute_flag (List["peano4.api.solversteps.Step"] steps) |
| For every submodel used anywhere in steps, derive a peano4::grid::constructLoadStoreComputeFlag(...) expression from which of its using Steps are active, and assign it to that submodel's generator.load_store_compute_flag - the runtime counterpart to peano4.api.taskgraph.compiler.PropagateUseStatements.propagate_use_statements(), which has to run before whichever compiler produces these steps: it decides which tasks have to declare a submodel at all; this function decides, for every Step that does, what its generated Observer should actually do with the data once the submodel's stack storage puts it there (load a real value, or start from a fresh dummy; store the result back, or discard it) - by asking, at runtime, which Step is presently executing. | |
| str | _step_active_expression ("peano4.api.solversteps.Step" step) |
| _load_store_compute_flag_holder (submodel) | |
| The object holding the submodel's load_store_compute_flag: The peano4_mpi_and_storage_aspect for DaStGen2 data, the generator otherwise. | |
| None | _ensure_step_repository_includes (holder) |
| None | _derive_load_store_compute_flag_for_one_kind (List["peano4.api.solversteps.Step"] steps, str attribute_name, str access_attribute_name, str guard_routine_name) |
Variables | |
| tuple | _DEFAULT_LOAD_STORE_COMPUTE_FLAG |
| tuple | _STEP_REPOSITORY_INCLUDES |
|
protected |
Definition at line 228 of file DeriveLoadStoreComputeFlag.py.
References peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag._ensure_step_repository_includes(), peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag._load_store_compute_flag_holder(), and peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag._step_active_expression().
Referenced by peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag.derive_load_store_compute_flag().


|
protected |
Definition at line 221 of file DeriveLoadStoreComputeFlag.py.
Referenced by peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag._derive_load_store_compute_flag_for_one_kind().

|
protected |
The object holding the submodel's load_store_compute_flag: The peano4_mpi_and_storage_aspect for DaStGen2 data, the generator otherwise.
Definition at line 210 of file DeriveLoadStoreComputeFlag.py.
Referenced by peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag._derive_load_store_compute_flag_for_one_kind().

|
protected |
Definition at line 183 of file DeriveLoadStoreComputeFlag.py.
Referenced by peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag._derive_load_store_compute_flag_for_one_kind().

| None peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag.derive_load_store_compute_flag | ( | List["peano4.api.solversteps.Step"] | steps | ) |
For every submodel used anywhere in steps, derive a peano4::grid::constructLoadStoreComputeFlag(...) expression from which of its using Steps are active, and assign it to that submodel's generator.load_store_compute_flag - the runtime counterpart to peano4.api.taskgraph.compiler.PropagateUseStatements.propagate_use_statements(), which has to run before whichever compiler produces these steps: it decides which tasks have to declare a submodel at all; this function decides, for every Step that does, what its generated Observer should actually do with the data once the submodel's stack storage puts it there (load a real value, or start from a fresh dummy; store the result back, or discard it) - by asking, at runtime, which Step is presently executing.
This has to run after every algorithmic phase has actually been compiled (
Unlike propagate_use_statements(), this needs no notion of order, distance or edges between graphs - it only has to know, per submodel, which Steps touch it and how; a flat scan over every Step given is enough.
peano4::grid::constructLoadStoreComputeFlag(predicateToUseData, predicateForLoad, predicateForStore) takes three C++ boolean expressions and combines them into the 5-way peano4::grid::LoadStoreComputeFlag enum (
terms - one per Step that qualifies, <name> being that Step's own .name (exactly as the compiler set it -
TEMPORARY therefore only ever contributes to predicateToUseData -
If a submodel carries a grid_selector (
That is, data are only used, loaded or stored if the selector holds and the steps above conclude that they are needed. The guards are evaluated within the generated loadStoreComputeFlag(marker), i.e. they can query the marker.
Peano's stacks require that a datum stored in one mesh sweep is loaded in the next one. The store predicate hence uses the selector's store guard (createCellStoreGuard(), createFaceStoreGuard() or createVertexStoreGuard()). It anticipates the guard's value in the next sweep. For a selector which depends on the refinement state, such as peano4.api.toolbox.FineGridSelector, it differs from the guard if the mesh changes. This keeps stores and loads consistent on dynamically adaptive meshes.
This does not touch generator.send_condition/receive_and_merge_condition - those are a separate, MPI rank-boundary concern this function has nothing to say about.
Every submodel this function touches gets 'include "repositories/StepRepository.h"', 'include "repositories/SolverRepository.h"' and 'include "peano4/parallel/Node.h"' appended to its generator.includes (skipped if already present) - the generated constructLoadStoreComputeFlag(...) expression references repositories::StepRepository::toProgramStep/Steps (declared in the first header) and peano4::parallel::Node::getInstance() (declared in the third); the second is added alongside the first to match this codebase's existing convention of always pairing the two (
Submodels modelled via DaStGen2 (peano4.api.datamodel.DaStGen2.DaStGen2) do not hold the load/store/compute flag in their generator but in their peano4_mpi_and_storage_aspect (peano4.api.dastgen2.MPIAndStorageAspect.MPIAndStorageAspect). For these, the function writes the flag into the aspect, and appends the includes above to the aspect's implementation_file_includes, as the aspect evaluates the flag within the implementation file. Adding them to the header might yield cyclic includes.
If a submodel's generator.load_store_compute_flag already holds something other than its factory default (
| steps | [peano4.api.solversteps.Step] Every compiled Step to consider, across every algorithmic phase (e.g. setup_simulation_steps + time_step_steps + plot_steps) - has to be the full set the surrounding project will actually run, so every submodel's predicates see every Step that might touch it. |
Definition at line 20 of file DeriveLoadStoreComputeFlag.py.
References peano4.api.taskgraph.compiler.DeriveLoadStoreComputeFlag._derive_load_store_compute_flag_for_one_kind().

|
protected |
Definition at line 15 of file DeriveLoadStoreComputeFlag.py.
|
protected |
Definition at line 203 of file DeriveLoadStoreComputeFlag.py.