X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/985cb4f936f5d78428b12093010b8a99a6c31187..f7c345a00e92ff915252ae30043dc90ca9a48686:/src/surf/network_ib.cpp diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index 3445c11bc8..d672a8df21 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -32,7 +32,7 @@ static void IB_action_state_changed_callback(simgrid::kernel::resource::NetworkA using simgrid::kernel::resource::IBNode; using simgrid::kernel::resource::NetworkIBModel; - if (action->get_state() != simgrid::kernel::resource::Action::State::done) + if (action->get_state() != simgrid::kernel::resource::Action::State::FINISHED) return; std::pair pair = ((NetworkIBModel*)surf_network_model)->active_comms[action]; XBT_DEBUG("IB callback - action %p finished", action); @@ -85,14 +85,13 @@ static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction* ac /* } */ void surf_network_model_init_IB() { - if (surf_network_model) - return; + xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice"); surf_network_model = new simgrid::kernel::resource::NetworkIBModel(); all_existing_models->push_back(surf_network_model); - simgrid::s4u::Link::onCommunicationStateChange.connect(IB_action_state_changed_callback); - simgrid::s4u::Link::onCommunicate.connect(IB_action_init_callback); - simgrid::s4u::Host::onCreation.connect(IB_create_host_callback); + simgrid::s4u::Link::on_communication_state_change.connect(IB_action_state_changed_callback); + simgrid::s4u::Link::on_communicate.connect(IB_action_init_callback); + simgrid::s4u::Host::on_creation.connect(IB_create_host_callback); simgrid::config::set_default("network/weight-S", 8775); }