From d10cc68456b92872786aa00dcf4dfaddccd4fb44 Mon Sep 17 00:00:00 2001 From: Fred Suter Date: Thu, 1 Jun 2023 18:05:18 -0400 Subject: [PATCH] react to the proper signals --- src/kernel/resource/models/network_ib.cpp | 6 +++--- src/kernel/resource/models/network_ib.hpp | 2 +- src/plugins/host_dvfs.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/kernel/resource/models/network_ib.cpp b/src/kernel/resource/models/network_ib.cpp index afec012147..df4abf17f1 100644 --- a/src/kernel/resource/models/network_ib.cpp +++ b/src/kernel/resource/models/network_ib.cpp @@ -41,7 +41,7 @@ SIMGRID_REGISTER_NETWORK_MODEL( engine->get_netzone_root()->set_network_model(net_model); simgrid::s4u::Link::on_communication_state_change_cb(NetworkIBModel::IB_action_state_changed_callback); - simgrid::kernel::activity::CommImpl::on_start.connect(NetworkIBModel::IB_comm_start_callback); + simgrid::s4u::Comm::on_start_cb(NetworkIBModel::IB_comm_start_callback); simgrid::s4u::Host::on_creation_cb(NetworkIBModel::IB_create_host_callback); simgrid::config::set_default("network/weight-S", 8775); }); @@ -68,9 +68,9 @@ void NetworkIBModel::IB_action_state_changed_callback(NetworkAction& action, Act ibModel->active_comms.erase(&action); } -void NetworkIBModel::IB_comm_start_callback(const activity::CommImpl& comm) +void NetworkIBModel::IB_comm_start_callback(const s4u::Comm& comm) { - auto* action = static_cast(comm.model_action_); + auto* action = static_cast(static_cast(comm.get_impl())->model_action_); auto* ibModel = static_cast(action->get_model()); auto* act_src = &ibModel->active_nodes.at(action->get_src().get_name()); auto* act_dst = &ibModel->active_nodes.at(action->get_dst().get_name()); diff --git a/src/kernel/resource/models/network_ib.hpp b/src/kernel/resource/models/network_ib.hpp index 572f18b27b..1400d8317b 100644 --- a/src/kernel/resource/models/network_ib.hpp +++ b/src/kernel/resource/models/network_ib.hpp @@ -51,7 +51,7 @@ public: static void IB_create_host_callback(s4u::Host const& host); static void IB_action_state_changed_callback(NetworkAction& action, Action::State /*previous*/); - static void IB_comm_start_callback(const activity::CommImpl& comm); + static void IB_comm_start_callback(const s4u::Comm& comm); }; } // namespace simgrid::kernel::resource #endif diff --git a/src/plugins/host_dvfs.cpp b/src/plugins/host_dvfs.cpp index 5e155812a0..138cdaee1b 100644 --- a/src/plugins/host_dvfs.cpp +++ b/src/plugins/host_dvfs.cpp @@ -298,9 +298,9 @@ public: }); // FIXME I think that this fires at the same time for all hosts, so when the src sends something, // the dst will be notified even though it didn't even arrive at the recv yet - kernel::activity::CommImpl::on_start.connect([this](const kernel::activity::CommImpl& comm) { - const auto* act = static_cast(comm.model_action_); - if ((get_host() == &act->get_src() || get_host() == &act->get_dst()) && iteration_running) { + simgrid::s4u::Comm::on_start_cb([this](const s4u::Comm& comm) { + if ((get_host() == comm.get_sender()->get_host() || get_host() == comm.get_receiver()->get_host()) && + iteration_running) { post_task(); } }); -- 2.20.1