Peano
Loading...
Searching...
No Matches
UpdateParticle_SingleLevelInteraction_ContiguousParticles.py
Go to the documentation of this file.
1# This file is part of the ExaParty project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
4
5
6from .TaskGraphKernelWrappers import (
7 construct_touch_vertex_first_time_call,
8 construct_touch_cell_first_time_call,
9 construct_touch_vertex_last_time_call,
10)
11
12
15):
16 """!
17
18 Wrapper around toolbox baseclass
19
20 Close to trivial wrapper which really only adds a tarch::multicore::waitForAllTasks()
21 iff the particles might move. The interesting stuff is actually happing in
22 TaskGarphKernelWrappers.py however.
23
24 """
26 self,
27 particle_set,
28 particle_cell_update_kernel,
29 touch_vertex_first_time_compute_particle_update_kernel,
30 touch_vertex_last_time_compute_particle_update_kernel,
31 prepare_traversal_kernel,
32 unprepare_traversal_kernel,
33 additional_includes,
34 active_particle_set,
35 alter_particle_position_or_interaction_radius,
36 wait_for_all_tasks_to_finish_after_traversal,
37 ):
38 """!
39
40 Construct
41
42
43 @param wait_for_all_tasks_to_finish_after_traversal: Boolean
44
45 @param alter_particle_position_or_interaction_radius: Boolean
46 Set if the underlying AlgorithmStep's effect might change a
47 particle's position or interaction radius.
48 @see exaparty.api.particle.AlgorithmStep.AlgorithmStep.may_trigger_rerun()
49
50 """
51 if wait_for_all_tasks_to_finish_after_traversal:
52 unprepare_traversal_kernel = (
53 unprepare_traversal_kernel + "tarch::multicore::waitForAllTasks();"
54 )
55
56 super(UpdateParticle_SingleLevelInteraction_ContiguousParticles, self).__init__(
57 particle_set,
58 particle_cell_update_kernel=construct_touch_cell_first_time_call(
59 particle_set,particle_cell_update_kernel,False
60 ),
61 touch_vertex_first_time_compute_particle_update_kernel=construct_touch_vertex_first_time_call(
62 particle_set,touch_vertex_first_time_compute_particle_update_kernel,False
63 ),
64 touch_vertex_last_time_compute_particle_update_kernel=construct_touch_vertex_last_time_call(
65 particle_set,touch_vertex_last_time_compute_particle_update_kernel,False,alter_particle_position_or_interaction_radius
66 ),
67 prepare_traversal_kernel=prepare_traversal_kernel,
68 unprepare_traversal_kernel=unprepare_traversal_kernel,
69 additional_includes=additional_includes
70 + """
71#include "tarch/multicore/Task.h"
72#include "exaparty/exaparty.h"
73#include "exaparty/TaskNumber.h"
74 """,
75 active_particle_set=active_particle_set,
76 )
77
78
80 return __name__.replace(".py", "").replace(".", "_")
__init__(self, particle_set, particle_cell_update_kernel, touch_vertex_first_time_compute_particle_update_kernel, touch_vertex_last_time_compute_particle_update_kernel, prepare_traversal_kernel, unprepare_traversal_kernel, additional_includes, active_particle_set, alter_particle_position_or_interaction_radius, wait_for_all_tasks_to_finish_after_traversal)
Construct.