5from .SpawnCellTaskActionSet
import SpawnCellTaskActionSet
11 Consumer-side cousin of a @ref peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet
13 The cousin realises the following events:
15 - touchCellFirstTime() checks if the cell's task label holds a valid
16 task number. If so, it waits for this task, returns the number to
17 the task enumerator, and resets the label to
18 tarch::multicore::TaskEnumerator::NoNumber.
19 - createCell() initialises the task label with NoNumber.
21 All other events are empty. The task enumerator is a static attribute of
22 the task labels, i.e. the cousin returns the number to the enumerator
23 from which the producer took it.
29 producer_action_set: SpawnCellTaskActionSet,
33 @param producer_action_set: peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet
34 The producer-side action set this cousin belongs to.
38 descend_invocation_order=producer_action_set.descend_invocation_order,
39 parallel=producer_action_set.parallel,
46 f
"fineGridCell{self._producer_action_set._task_labels_name}",
47 attribute_name[0].capitalize() + attribute_name[1:],
57 return " return std::vector< peano4::grid::GridControlEvent >();\n"
71 if operation_name == ActionSet.OPERATION_CREATE_CELL:
72 return f
"\n {task_label}.set{accessor}( tarch::multicore::TaskEnumerator::NoNumber );\n"
73 elif operation_name == ActionSet.OPERATION_TOUCH_CELL_FIRST_TIME:
75 if ( {task_label}.get{accessor}()>=0 ) {{
76 tarch::multicore::waitForTask( {task_label}.get{accessor}() );
77 {task_label}.getTaskEnumerator().releaseNumber( {task_label}.get{accessor}() );
78 {task_label}.set{accessor}( tarch::multicore::TaskEnumerator::NoNumber );
95#include "tarch/multicore/multicore.h"
96#include "tarch/multicore/TaskEnumerator.h"
Action set (reactions to events)
Consumer-side cousin of a peano4.api.taskgraph.compiler.SpawnCellTaskActionSet.SpawnCellTaskActionSet...
get_destructor_body(self)
get_constructor_body(self)
Define a tailored constructor body.
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
tuple _task_label_accessor(self)
get_includes(self)
Return include statements that you need.
__init__(self, SpawnCellTaskActionSet producer_action_set)
user_should_modify_template(self)
Is the user allowed to modify the output.
get_body_of_unprepareTraversal(self)
get_implementation_of_operation(self, operation_name)
Return the C++ implementation of an operation.
get_body_of_prepareTraversal(self)
get_body_of_createGridControlEventsForNextTraversal(self)
Return the grid control events that this action set wants to trigger.
get_attributes(self)
Return attributes as copied and pasted into the generated class.
get_action_set_name(self)
Return unique action set name.