|
Peano
|
Producer-side wrapper around an action set, which spawns touchCellFirstTime() as a task. More...


Public Member Functions | |
| __init__ (self, ActionSet action_set, str task_labels_name, str task_number_attribute_name, str previous_task_number_attribute_name, list face_enumerators=[], list vertex_enumerators=[]) | |
| get_constructor_body (self) | |
| Define a tailored constructor body. | |
| get_destructor_body (self) | |
| get_static_initialisations (self, full_qualified_classname) | |
| get_body_of_createGridControlEventsForNextTraversal (self) | |
| Return the grid control events that this action set wants to trigger. | |
| get_body_of_prepareTraversal (self) | |
| get_body_of_unprepareTraversal (self) | |
| get_body_of_operation (self, operation_name) | |
| Return actual C++ code snippets to be inserted into C++ code. | |
| get_implementation_of_operation (self, operation_name) | |
| Delegate to the wrapped action set besides the events listed in the class description. | |
| get_action_set_name (self) | |
| Return unique action set name. | |
| user_should_modify_template (self) | |
| Is the user allowed to modify the output. | |
| get_attributes (self) | |
| Return attributes as copied and pasted into the generated class. | |
| get_includes (self) | |
| Return include statements that you need. | |
Public Member Functions inherited from peano4.api.solversteps.ActionSet.ActionSet | |
| get_implementation_of_createGridControlEventsForNextTraversal (self) | |
| Return the C++ implementation of createGridControlEventsForNextTraversal() | |
| get_implementation_of_prepareTraversal (self) | |
| Return the C++ implementation of prepareTraversal() | |
| get_implementation_of_unprepareTraversal (self) | |
| Return the C++ implementation of unprepareTraversal() | |
| get_guard_of_operation (self, operation_name) | |
| Return the guard of an operation. | |
| bool | may_run_in_background_task (self) |
| May a task graph compiler move touchCellFirstTime() into a task. | |
Data Fields | |
| action_set | |
Data Fields inherited from peano4.api.solversteps.ActionSet.ActionSet | |
| descend_invocation_order | |
| parallel | |
Protected Member Functions | |
| str | _lambda_captures (self) |
| Capture list of the spawned task's lambda: Everything by value, and the vertex and face enumerators as copies of their data under the same name. | |
| str | _accessor (self, str attribute_name) |
Protected Attributes | |
| _task_labels_name | |
| _task_number_attribute_name | |
| _previous_task_number_attribute_name | |
| _face_enumerators | |
| _vertex_enumerators | |
Producer-side wrapper around an action set, which spawns touchCellFirstTime() as a task.
The wrapper delegates all events to the wrapped action set with the following exceptions:
The task enumerator is a static attribute of the task labels, i.e. it is shared by all producers and consumers which use these labels.
The spawned task captures its environment by value ([=]). Cell data managed via smart pointers (e.g. peano4.api.datamodel.PatchToDoubleArrayWithSmartPointer) is copied shallowly, i.e. the task writes into the cell's data. Plain arrays are copied deeply, i.e. writes are lost.
Enumerators over vertices and faces hold pointers into Peano's stacks, which are invalid once touchCellFirstTime() has terminated. The task therefore captures each enumerator which its body might use as peano4::datamanagement::FaceHeapDataEnumerator or peano4::datamanagement::VertexHeapDataEnumerator under the same name. These enumerators hold copies of the faces or vertices. The copies are shallow if the data is managed via smart pointers.
peano4.api.taskgraph.compiler.CellTaskProducerConsumer warns about data which is not managed via smart pointers.
All other events, including unprepareTraversal(), endTraversal() and the touch...LastTime() events, remain within the producer. They are hence invoked before the spawned tasks have necessarily terminated. peano4.api.taskgraph.compiler.CellTaskProducerConsumer therefore only splits tasks whose action sets do not realise these events, unless the task explicitly allows it (peano4.api.taskgraph.Task.Task.may_spawn_background_tasks).
Definition at line 6 of file SpawnCellTaskActionSet.py.
| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.__init__ | ( | self, | |
| ActionSet | action_set, | ||
| str | task_labels_name, | ||
| str | task_number_attribute_name, | ||
| str | previous_task_number_attribute_name, | ||
| list | face_enumerators = [], |
||
| list | vertex_enumerators = [] |
||
| ) |
| action_set | peano4.api.solversteps.ActionSet The wrapped action set. |
| task_labels_name | str Name of the DaStGen2 cell data type holding the task labels. The generated observer passes it into the event as fineGridCell<name>. |
| task_number_attribute_name | str Name of the attribute within the task labels which holds the task number. |
| previous_task_number_attribute_name | str or None Name of the attribute holding the task number of the task spawned by the previous action set of the same producer. The spawned task depends on this task, so the action sets' bodies are executed in their original order. If None, the task has no incoming dependencies. |
| face_enumerators | [str] Names of the face enumerators, e.g. fineGridFacesQ, which the task captures as peano4::datamanagement::FaceHeapDataEnumerator. |
| vertex_enumerators | [str] Names of the vertex enumerators, e.g. fineGridVerticesQ, which the task captures as peano4::datamanagement::VertexHeapDataEnumerator. |
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 52 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.__init__().
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.__init__().


|
protected |
Definition at line 115 of file SpawnCellTaskActionSet.py.
|
protected |
Capture list of the spawned task's lambda: Everything by value, and the vertex and face enumerators as copies of their data under the same name.
Definition at line 98 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet._face_enumerators, and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet._vertex_enumerators.
| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_action_set_name | ( | self | ) |
Return unique action set name.
Returns a description (word) for the mapping which is also used as class name for the generated type. As a consequence, the result should be one word (if possible) and uppercase. Also, every subclass should overwrite this routine.
The generator will take the result and construct eventually classes similar to MyStep2Dummy.h and MyStep2Dummy.cpp or similar for the example below, where we return Dummy.
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 182 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_action_set_name().
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_action_set_name().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_attributes | ( | self | ) |
Return attributes as copied and pasted into the generated class.
Please note that action sets are not persistent, i.e. there is one object creation per grid sweep per tree.
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 188 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_attributes().
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_attributes().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_body_of_createGridControlEventsForNextTraversal | ( | self | ) |
Return the grid control events that this action set wants to trigger.
Please consult the documentation of grid control events for details on what these events are and how they are used.
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 127 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.solversteps.ActionSet.ActionSet.get_implementation_of_createGridControlEventsForNextTraversal().
Referenced by peano4.api.solversteps.ActionSet.ActionSet.get_implementation_of_createGridControlEventsForNextTraversal().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_body_of_operation | ( | self, | |
| operation_name | |||
| ) |
Return actual C++ code snippets to be inserted into C++ code.
See class' string constants starting with OPERATION_ for possible values of operation_name. The snippet is executed if and only if the guard returned by get_guard_of_operation() holds, i.e. the body should not evaluate the guard itself. See the section "Guard and body" in the class documentation.
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 136 of file SpawnCellTaskActionSet.py.
Referenced by peano4.api.solversteps.ActionSet.ActionSet.get_implementation_of_operation().

| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_body_of_prepareTraversal | ( | self | ) |
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 130 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.solversteps.ActionSet.ActionSet.get_implementation_of_prepareTraversal().
Referenced by peano4.api.solversteps.ActionSet.ActionSet.get_implementation_of_prepareTraversal().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_body_of_unprepareTraversal | ( | self | ) |
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 133 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.solversteps.ActionSet.ActionSet.get_implementation_of_unprepareTraversal().
Referenced by peano4.api.solversteps.ActionSet.ActionSet.get_implementation_of_unprepareTraversal().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_constructor_body | ( | self | ) |
Define a tailored constructor body.
By default, the constructor of an action set is empty. If you you assign attributes to your action set, you however might want to initialise them here. We do not support initialisation lists, to all has to be done via setters unless you create attributes on the heap.
The constructor's signature will look similar to
EnumerateAndInitSolution2petsc_actionsets_InitVertexDoFs0(int treeNumber);
where the treeNumber is -1 if this is the global instance of the action set owned by a rank, or a number greater or equal 0 if this action set is a clone of the glocal action set that's used by one tree traversal.
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 118 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_constructor_body().
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_constructor_body().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_destructor_body | ( | self | ) |
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 121 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_destructor_body().
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_destructor_body().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_implementation_of_operation | ( | self, | |
| operation_name | |||
| ) |
Delegate to the wrapped action set besides the events listed in the class description.
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 140 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet._previous_task_number_attribute_name, peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_implementation_of_operation().
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_implementation_of_operation().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_includes | ( | self | ) |
Return include statements that you need.
All of these includes will eventually end up in the header of the generated C++ code.
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 191 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_includes().
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_includes().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_static_initialisations | ( | self, | |
| full_qualified_classname | |||
| ) |
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 124 of file SpawnCellTaskActionSet.py.
References peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set, and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_static_initialisations().
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_static_initialisations().


| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.user_should_modify_template | ( | self | ) |
Is the user allowed to modify the output.
Return whether you expect the user to modify the generated code. If this is the case, then the API places the generated output in the directory actions. Otherwise, it goes into the observer directory and will be overwritten in each and every Python run.
Reimplemented from peano4.api.solversteps.ActionSet.ActionSet.
Definition at line 185 of file SpawnCellTaskActionSet.py.
|
protected |
Definition at line 95 of file SpawnCellTaskActionSet.py.
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet._lambda_captures().
|
protected |
Definition at line 94 of file SpawnCellTaskActionSet.py.
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_implementation_of_operation().
|
protected |
Definition at line 92 of file SpawnCellTaskActionSet.py.
|
protected |
Definition at line 93 of file SpawnCellTaskActionSet.py.
|
protected |
Definition at line 96 of file SpawnCellTaskActionSet.py.
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet._lambda_captures().
| peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.action_set |
Definition at line 91 of file SpawnCellTaskActionSet.py.
Referenced by peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_action_set_name(), peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_attributes(), peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_body_of_createGridControlEventsForNextTraversal(), peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_body_of_prepareTraversal(), peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_body_of_unprepareTraversal(), peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_constructor_body(), peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_destructor_body(), peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_implementation_of_operation(), peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_includes(), and peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet.get_static_initialisations().