auto fafard = e.host_by_name("Fafard");
// Display the details on vetoed activities
- simgrid::s4u::Activity::on_veto.connect([&e](simgrid::s4u::Activity& a) {
+ simgrid::s4u::Activity::on_veto.connect([](simgrid::s4u::Activity& a) {
auto& exec = static_cast<simgrid::s4u::Exec&>(a); // all activities are execs in this example
XBT_INFO("Activity '%s' vetoed. Dependencies: %s; Ressources: %s", exec.get_cname(),
(exec.is_assigned() ? "assigned" : "NOT assigned"));
});
+ simgrid::s4u::Exec::on_completion.connect([](simgrid::s4u::Exec const& exec) {
+ XBT_INFO("Activity '%s' is complete (start time: %f, finish time: %f)", exec.get_cname(), exec.get_start_time(),
+ exec.get_finish_time());
+ });
+
// Define an amount of work that should take 1 second to execute.
double computation_amount = fafard->get_speed();
first_parent->add_successor(child);
second_parent->add_successor(child);
- /*
- std::vector<simgrid::s4u::ExecPtr> pending_execs;
- pending_execs.push_back(first_parent);
- pending_execs.push_back(second_parent);
- pending_execs.push_back(child);
- */
-
// Set the parameters (the name is for logging purposes only)
// + First parent ends after 1 second and the Second parent after 2 seconds.
first_parent->set_name("parent 1")->set_flops_amount(computation_amount);