xbt_assert(argc > 1, "Usage: %s platform_file\n\nExample: %s two_clusters.xml", argv[0], argv[0]);
e.load_platform(argv[1]);
- simgrid::s4u::Exec::on_completion.connect([](simgrid::s4u::Exec const& exec) {
- XBT_INFO("Exec '%s' start time: %f, finish time: %f", exec.get_cname(), exec.get_start_time(),
- exec.get_finish_time());
+ simgrid::s4u::Activity::on_completion_cb([](simgrid::s4u::Activity& activity) {
+ const auto* exec = dynamic_cast<simgrid::s4u::Exec*>(&activity);
+ if (exec == nullptr) // Only Execs are concerned here
+ return;
+ XBT_INFO("Exec '%s' start time: %f, finish time: %f", exec->get_cname(), exec->get_start_time(),
+ exec->get_finish_time());
});
/* creation of the activities and their dependencies */
try {
A->add_successor(A);
- ; /* shouldn't work and must raise an exception */
+ /* shouldn't work and must raise an exception */
xbt_die("Hey, I can add a dependency between A and A!");
} catch (const std::invalid_argument& e) {
XBT_INFO("Caught attempt to self-dependency creation: %s", e.what());