X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c0f3756528127131a1947179f56871657a084259..2b3790827a15510aa6b18146bc01597a568b332b:/src/surf/network_ib.cpp diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index a6335848b3..7d5efb2b61 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -27,7 +27,8 @@ static void IB_create_host_callback(simgrid::s4u::Host& host){ ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.get_name(), act}); } -static void IB_action_state_changed_callback(simgrid::kernel::resource::NetworkAction* action) +static void IB_action_state_changed_callback(simgrid::kernel::resource::NetworkAction* action, + simgrid::kernel::resource::Action::State /*previous*/) { using simgrid::kernel::resource::IBNode; using simgrid::kernel::resource::NetworkIBModel; @@ -85,11 +86,9 @@ 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::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); @@ -102,6 +101,8 @@ namespace resource { NetworkIBModel::NetworkIBModel() : NetworkSmpiModel() { + /* Do not add this into all_existing_models: our ancestor already does so */ + std::string IB_factors_string = simgrid::config::get_value("smpi/IB-penalty-factors"); std::vector radical_elements; boost::split(radical_elements, IB_factors_string, boost::is_any_of(";"));