|
Peano
|
Functions | |
| create_runner (peano_project, identifier, steps) | |
| Create the header/implementation file pair that represents one of a project's algorithmic phases represented by a sequence of steps. | |
Variables | |
| str | TEMPLATE_RUNNER_HEADER_FILE |
| str | TEMPLATE_RUNNER_CPP_FILE |
| peano4.api.taskgraph.Runner.create_runner | ( | peano_project, | |
| identifier, | |||
| steps | |||
| ) |
Create the header/implementation file pair that represents one of a project's algorithmic phases represented by a sequence of steps.
It yields one class of the classname identifier which is held in the project's runners subdirectory/namespace. This class holds exactly one method run() which toggles through the steps one by one.
Even though the runner seems to accept only a sequence of steps (which are members of peano4.api.solversteps), the runner belongs into the task graph repository, as it assumes that each step has a field has_to_repeat. This field is not defined within peano4.api.solversteps.Step. It is something graph compilers add to the data model. Consult the compiler description in peano4.api.taskgraph.compiler.
peano_project: peano4.api.Project The Peano 4 project to add the generated files to.
identifier: str Same identifier used for the phase's Observers, e.g. "SetupSimulation", "TimeStep", "Plot".
steps: [peano4.api.solversteps.Step] The sequence of Observers realising this algorithmic phase, in the order compiled from the phase's task graph (
Before every step but the first, run() also calls peano4::parallel::Node::getInstance().setNextProgramStep(...) with that step's own program step - whoever calls run() in the first place already had to set Node's program step to this phase's first step beforehand (
| str peano4.api.taskgraph.Runner.TEMPLATE_RUNNER_HEADER_FILE |