Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
react to the proper signals
authorFred Suter <suterf@ornl.gov>
Thu, 1 Jun 2023 22:05:18 +0000 (18:05 -0400)
committerFred Suter <suterf@ornl.gov>
Thu, 1 Jun 2023 22:05:18 +0000 (18:05 -0400)
src/kernel/resource/models/network_ib.cpp
src/kernel/resource/models/network_ib.hpp
src/plugins/host_dvfs.cpp

index afec012..df4abf1 100644 (file)
@@ -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<double>("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<NetworkAction*>(comm.model_action_);
+  auto* action  = static_cast<NetworkAction*>(static_cast<activity::CommImpl*>(comm.get_impl())->model_action_);
   auto* ibModel = static_cast<NetworkIBModel*>(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());
index 572f18b..1400d83 100644 (file)
@@ -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
index 5e15581..138cdae 100644 (file)
@@ -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<kernel::resource::NetworkAction*>(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();
       }
     });