16 Ensure that touchVertexLastTime() on vertex terminates prior to subsequent touchVertexLastTime()
18 This action set is used by MultisweepTaskGraph, where we run through
19 the mesh, spawn graphs and immediately switch to the next mesh traversal.
20 This way, we produce the whole task graph of multiple logical steps
21 on-the-fly. To make the whole thing work, we have to ensure that the
22 task of touchVertexLastTime() of one traversal finishes before the one
23 spawned by touchVertexFirstTime() is activated.
25 In prinicple, we can embed this into the task creation by creating
26 the corresponding in-dependency. I tried this in the TaskGraphKernelWrapper.
27 However, when we write the touchVertexFirstTime() task, we really do not
28 know if there has been another touchVertexFirstTime() task before. So
29 instead of having complicated logic, I use an empty task to create that
30 dependency once and for all.
35 self.
d[
"PARTICLE"] = particle_set.particle_model.name
36 self.
d[
"PARTICLES_CONTAINER"] = particle_set.name
48 __Template_TouchVertexFirstTime = jinja2.Template(
50 const std::set<::swift2::TaskNumber> inTaskNumber{ ::swift2::TaskNumber(
51 fineGridVertex{{MARKER_NAME}}.getNumber(),
52 ::swift2::TaskNumber::TaskAssociation::TouchVertexLastTime
55 const ::swift2::TaskNumber outTaskNumber{
56 fineGridVertex{{MARKER_NAME}}.getNumber(),
57 ::swift2::TaskNumber::TaskAssociation::TouchVertexFirstTime
60 tarch::multicore::Task* newTask = new tarch::multicore::EmptyTask(
61 tarch::multicore::Task::DefaultPriority
64 tarch::multicore::spawnTask( newTask, ::swift2::flatten(inTaskNumber), ::swift2::flatten(outTaskNumber) );
70 if operation_name == ActionSet.OPERATION_TOUCH_VERTEX_FIRST_TIME:
75 return __name__.replace(
".py",
"").replace(
".",
"_")
78 result = jinja2.Template(
80#include "tarch/multicore/Task.h"
81#include "swift2/swift2.h"
82#include "swift2/TaskNumber.h"
84#include "vertexdata/{{PARTICLES_CONTAINER}}.h"
85#include "globaldata/{{PARTICLE}}.h"
88 return result.render(**self.
d)
Action set (reactions to events)
get_body_of_operation(self, operation_name)
Return actual C++ code snippets to be inserted into C++ code.
get_includes(self)
Return include statements that you need.
__init__(self, particle_set)
Ensure that touchVertexLastTime() on vertex terminates prior to subsequent touchVertexLastTime()
user_should_modify_template(self)
Is the user allowed to modify the output.
get_action_set_name(self)
Return unique action set name.
__Template_TouchVertexFirstTime