X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e22da6010c6499813ff88c76041cf499ffbf2b67..f1de7d514aa820a44a5a0d5dfedb678480189c9c:/src/surf/network_smpi.cpp diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index 0b03bd9d4e..54772d2b74 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -4,6 +4,8 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "network_smpi.hpp" +#include "simgrid/kernel/routing/NetZoneImpl.hpp" +#include "simgrid/s4u/Engine.hpp" #include "simgrid/sg_config.hpp" #include "smpi_utils.hpp" #include "src/kernel/EngineImpl.hpp" @@ -12,9 +14,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network); -std::vector smpi_bw_factor; -std::vector smpi_lat_factor; - /********* * Model * *********/ @@ -33,9 +32,9 @@ std::vector smpi_lat_factor; /* } */ void surf_network_model_init_SMPI() { - auto net_model = std::make_unique(); - simgrid::kernel::EngineImpl::get_instance()->add_model(simgrid::kernel::resource::Model::Type::NETWORK, - std::move(net_model), true); + auto net_model = std::make_shared("Network_SMPI"); + simgrid::kernel::EngineImpl::get_instance()->add_model(net_model); + simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->set_network_model(net_model); simgrid::config::set_default("network/weight-S", 8775); } @@ -44,14 +43,11 @@ namespace simgrid { namespace kernel { namespace resource { -NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model() -{ -} - double NetworkSmpiModel::get_bandwidth_factor(double size) { + static std::vector smpi_bw_factor; if (smpi_bw_factor.empty()) - smpi_bw_factor = parse_factor(config::get_value("smpi/bw-factor")); + smpi_bw_factor = smpi::utils::parse_factor(config::get_value("smpi/bw-factor")); double current = 1.0; for (auto const& fact : smpi_bw_factor) { @@ -68,8 +64,9 @@ double NetworkSmpiModel::get_bandwidth_factor(double size) double NetworkSmpiModel::get_latency_factor(double size) { + static std::vector smpi_lat_factor; if (smpi_lat_factor.empty()) - smpi_lat_factor = parse_factor(config::get_value("smpi/lat-factor")); + smpi_lat_factor = smpi::utils::parse_factor(config::get_value("smpi/lat-factor")); double current = 1.0; for (auto const& fact : smpi_lat_factor) {