- simgrid::kernel::activity::ExecImpl::on_creation.connect(
- [this](simgrid::kernel::activity::ExecImpl const& activity) {
- if (activity.host_ == get_host())
- pre_task();
- });
- simgrid::kernel::activity::ExecImpl::on_completion.connect(
- [this](simgrid::kernel::activity::ExecImpl const& activity) {
- // For more than one host (not yet supported), we can access the host via
- // simcalls_.front()->issuer->iface()->get_host()
- if (activity.host_ == get_host() && iteration_running) {
- comp_timer += activity.surf_action_->get_finish_time() - activity.surf_action_->get_start_time();
- }
- });
+ simgrid::s4u::Exec::on_start_cb([this](simgrid::s4u::Exec const& activity) {
+ if (activity.get_host() == get_host())
+ pre_task();
+ });
+ simgrid::s4u::Activity::on_completion_cb([this](simgrid::s4u::Activity const& activity) {
+ const auto* exec = dynamic_cast<simgrid::s4u::Exec const*>(&activity);
+ if (exec == nullptr) // Only Execs are concerned here
+ return;
+ // For more than one host (not yet supported), we can access the host via
+ // simcalls_.front()->issuer->get_iface()->get_host()
+ if (exec->get_host() == get_host() && iteration_running) {
+ comp_timer += exec->get_finish_time() - exec->get_start_time();
+ }
+ });