sg4::Actor::create("worker", e.host_by_name("Fafard"), worker);
sg4::Exec::on_veto_cb([&e](sg4::Exec& exec) {
-
// First display the situation
XBT_INFO("Activity '%s' vetoed. Dependencies: %s; Ressources: %s", exec.get_cname(),
(exec.dependencies_solved() ? "solved" : "NOT solved"),
)
return parser.parse_args()
-def callback( t):
- print(f'[{Engine.clock}] { t} finished ({ t.count})')
+def callback(t):
+ print(f'[{Engine.clock}] {t} finished ({t.count})')
if __name__ == '__main__':
args = parse()
exec1.enqueue_execs(2)
# runs the simulation
- e.run()
\ No newline at end of file
+ e.run()
)
return parser.parse_args()
-def callback( t):
- print(f'[{Engine.clock}] { t} finished ({ t.count})')
+def callback(t):
+ print(f'[{Engine.clock}] {t} finished ({t.count})')
if __name__ == '__main__':
args = parse()
)
return parser.parse_args()
-def callback( t):
- print(f'[{Engine.clock}] { t} finished ({ t.count})')
+def callback(t):
+ print(f'[{Engine.clock}] {t} finished ({t.count})')
-def switch( t, hosts, execs):
- comm0.destination = hosts[ t.count % 2]
- comm0.remove_successor(execs[ t.count % 2 - 1])
- comm0.add_successor(execs[ t.count % 2])
+def switch(t, hosts, execs):
+ comm0.destination = hosts[t.count % 2]
+ comm0.remove_successor(execs[t.count % 2 - 1])
+ comm0.add_successor(execs[t.count % 2])
if __name__ == '__main__':
args = parse()
# Add a function to be called before each executions of comm0
# This function modifies the graph of tasks by adding or removing
# successors to comm0
- comm0.on_this_start(lambda t: switch( t, [jupiter, fafard], [exec1,exec2]))
+ comm0.on_this_start(lambda t: switch(t, [jupiter, fafard], [exec1,exec2]))
# Enqueue two executions for task exec1
comm0.enqueue_execs(4)
)
return parser.parse_args()
-def callback( t):
- print(f'[{Engine.clock}] { t} finished ({ t.count})')
+def callback(t):
+ print(f'[{Engine.clock}] {t} finished ({t.count})')
-def variable_load( t):
+def variable_load(t):
print('--- Small load ---')
for _ in range(3):
t.enqueue_execs(1)
XBT_ATTRIB_DEPRECATED_v337("Please use on_resume_cb() instead") static void on_resumed_cb(
const std::function<void(Activity const&)>& cb) { on_resume.connect(cb); }
-
AnyActivity* add_successor(ActivityPtr a)
{
Activity::add_successor(a);
simgrid::s4u::Engine::on_simulation_end_cb(&remove_remote_disks);
if (fire_on_platform_created_callback)
simgrid::s4u::Engine::on_platform_created();
-
}
void STag_simgrid_parse_prop()