static xbt::signal<void(Link const&)> on_bandwidth_change;
/** @brief Callback signal fired when a communication starts */
- static xbt::signal<void(kernel::resource::NetworkAction&, Host* src, Host* dst)> on_communicate;
+ static xbt::signal<void(kernel::resource::NetworkAction&)> on_communicate;
/** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
static xbt::signal<void(kernel::resource::NetworkAction&, kernel::resource::Action::State)>
});
// 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
- simgrid::s4u::Link::on_communicate.connect(
- [this](const kernel::resource::NetworkAction&, const s4u::Host* src, const s4u::Host* dst) {
- if ((get_host() == src || get_host() == dst) && iteration_running) {
- post_task();
- }
- });
+ simgrid::s4u::Link::on_communicate.connect([this](const kernel::resource::NetworkAction& act) {
+ if ((get_host() == &act.get_src() || get_host() == &act.get_dst()) && iteration_running) {
+ post_task();
+ }
+ });
}
std::string get_name() const override { return "Adagio"; }
using simgrid::plugin::LinkEnergy;
/* **************************** events callback *************************** */
-static void on_communicate(const simgrid::kernel::resource::NetworkAction& action, const simgrid::s4u::Host*,
- const simgrid::s4u::Host*)
+static void on_communicate(const simgrid::kernel::resource::NetworkAction& action)
{
XBT_DEBUG("onCommunicate is called");
for (simgrid::kernel::resource::LinkImpl* link : action.get_links()) {
xbt::signal<void(Link const&)> Link::on_destruction;
xbt::signal<void(Link const&)> Link::on_state_change;
xbt::signal<void(Link const&)> Link::on_bandwidth_change;
-xbt::signal<void(kernel::resource::NetworkAction&, Host* src, Host* dst)> Link::on_communicate;
+xbt::signal<void(kernel::resource::NetworkAction&)> Link::on_communicate;
xbt::signal<void(kernel::resource::NetworkAction&, kernel::resource::Action::State)>
Link::on_communication_state_change;
}
XBT_OUT();
- simgrid::s4u::Link::on_communicate(*action, src, dst);
+ simgrid::s4u::Link::on_communicate(*action);
return action;
}
{
auto* action = new NetworkConstantAction(this, *src, *dst, size, sg_latency_factor);
- s4u::Link::on_communicate(*action, src, dst);
+ s4u::Link::on_communicate(*action);
return action;
}
((NetworkIBModel*)surf_network_model)->active_comms.erase(&action);
}
-static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction& action, const simgrid::s4u::Host* src,
- const simgrid::s4u::Host* dst)
+static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction& action)
{
simgrid::kernel::resource::NetworkIBModel* ibModel = (simgrid::kernel::resource::NetworkIBModel*)surf_network_model;
- simgrid::kernel::resource::IBNode* act_src = &ibModel->active_nodes.at(src->get_name());
- simgrid::kernel::resource::IBNode* act_dst = &ibModel->active_nodes.at(dst->get_name());
+ simgrid::kernel::resource::IBNode* act_src = &ibModel->active_nodes.at(action.get_src().get_name());
+ simgrid::kernel::resource::IBNode* act_dst = &ibModel->active_nodes.at(action.get_dst().get_name());
ibModel->active_comms[&action] = std::make_pair(act_src, act_dst);
ibModel->updateIBfactors(&action, act_src, act_dst, 0);