9 Switch the load balancing on or off
11 Calls enable(true) or enable(false) on the strategy that is currently
12 installed in toolbox::loadbalancing::LoadBalancingService, either in
13 prepareTraversal(), i.e. before the grid sweep, or in
14 unprepareTraversal(), i.e. after the grid sweep. Both routines are
15 invoked once per traversal per rank (and not per tree).
17 The action set does not install a strategy itself. If no strategy is
18 installed, i.e. getLoadBalancing() returns nullptr, the action set does
23 def __init__(self, enable_load_balancing: bool, plug_into_prepare_traversal: bool):
26 @param enable_load_balancing: bool
27 Switch the load balancing on (True) or off (False).
29 @param plug_into_prepare_traversal: bool
30 Toggle the load balancing in prepareTraversal() (True), i.e.
31 before the grid sweep, or in unprepareTraversal() (False), i.e.
35 super(ToggleLoadBalancing, self).
__init__(descend_invocation_order=0, parallel=
False)
41 if (::toolbox::loadbalancing::LoadBalancingService::getInstance().getLoadBalancing() != nullptr) {{
42 ::toolbox::loadbalancing::LoadBalancingService::getInstance().getLoadBalancing()->enable({"true" if self.enable_load_balancing else "false"});
62 return __name__.replace(
".py",
"").replace(
".",
"_")
72#include "toolbox/loadbalancing/AbstractLoadBalancing.h"
73#include "toolbox/loadbalancing/LoadBalancingService.h"
Switch the load balancing on or off.
get_constructor_body(self)
Define a tailored constructor body.
get_attributes(self)
Return attributes as copied and pasted into the generated class.
plug_into_prepare_traversal
get_body_of_prepareTraversal(self)
get_destructor_body(self)
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.
get_body_of_unprepareTraversal(self)
__init__(self, bool enable_load_balancing, bool plug_into_prepare_traversal)
user_should_modify_template(self)
Is the user allowed to modify the output.
get_action_set_name(self)
Return unique action set name.
Action set (reactions to events)