double computation_amount = sg_host_get_speed(sg_host_self());
XBT_INFO("Execute %g flops, should take 1 second.", computation_amount);
- sg_exec_t activity = sg_actor_exec_init(computation_amount);
- sg_exec_start(activity);
+ sg_exec_t activity = sg_actor_exec_async(computation_amount);
sg_actor_sleep_for(0.5);
XBT_INFO("I changed my mind, cancel!");
sg_exec_cancel(activity);
def __call__(self):
computation_amount = this_actor.get_host().speed
this_actor.info("Canceller executes {:.0f} flops, should take 1 second.".format(computation_amount))
- activity = this_actor.exec_init(computation_amount).start()
+ activity = this_actor.exec_async(computation_amount)
this_actor.sleep_for(0.5)
this_actor.info("I changed my mind, cancel!")
py::arg("priority") = 1)
.def("exec_init", py::overload_cast<double>(&simgrid::s4u::this_actor::exec_init),
py::call_guard<py::gil_scoped_release>())
+ .def("exec_async", py::overload_cast<double>(&simgrid::s4u::this_actor::exec_async),
+ py::call_guard<py::gil_scoped_release>())
.def("get_host", &simgrid::s4u::this_actor::get_host, "Retrieves host on which the current actor is located")
.def("set_host", &simgrid::s4u::this_actor::set_host, py::call_guard<py::gil_scoped_release>(),
"Moves the current actor to another host.", py::arg("dest"))