X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f9a7157127fceed4adb9d099a823d3e16c40c93f..371d168e21b83e2364c2ac2dbff3847588769c2b:/src/kernel/resource/NetworkModel.cpp?ds=sidebyside diff --git a/src/kernel/resource/NetworkModel.cpp b/src/kernel/resource/NetworkModel.cpp index 0e5aa79569..0d34f48797 100644 --- a/src/kernel/resource/NetworkModel.cpp +++ b/src/kernel/resource/NetworkModel.cpp @@ -1,21 +1,17 @@ -/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2023. 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. */ #include -#include "simgrid/sg_config.hpp" +#include "src/kernel/resource/FactorSet.hpp" #include "src/kernel/resource/NetworkModel.hpp" #include "src/kernel/resource/profile/Profile.hpp" -#include "src/smpi/include/smpi_utils.hpp" -#include "src/surf/surf_interface.hpp" +#include "src/simgrid/sg_config.hpp" #include -#ifndef NETWORK_INTERFACE_CPP_ -#define NETWORK_INTERFACE_CPP_ - XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_network, ker_resource, "Network resources, that fuel communications"); /********* @@ -23,30 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_network, ker_resource, "Network resources, t *********/ namespace simgrid::kernel::resource { -static smpi::utils::FactorSet cfg_latency_factor("network/latency-factor"); -static smpi::utils::FactorSet cfg_bandwidth_factor("network/bandwidth-factor"); - -config::Flag cfg_latency_factor_str( - "network/latency-factor", {{"smpi/lat-factor"}}, - "Correction factor to apply to the provided latency (default value overridden by network model)", "1.0"); -static config::Flag cfg_bandwidth_factor_str( - "network/bandwidth-factor", {{"smpi/bw-factor"}}, - "Correction factor to apply to the provided bandwidth (default value overridden by network model)", "1.0"); - -double NetworkModel::get_latency_factor(double size) -{ - if (not cfg_latency_factor.is_initialized()) // lazy initiaization to avoid initialization fiasco - cfg_latency_factor.parse(cfg_latency_factor_str.get()); - - return cfg_latency_factor(size); -} -double NetworkModel::get_bandwidth_factor(double size) -{ - if (not cfg_bandwidth_factor.is_initialized()) - cfg_bandwidth_factor.parse(cfg_bandwidth_factor_str.get()); - - return cfg_bandwidth_factor(size); -} /** @brief Command-line option 'network/TCP-gamma' -- see @ref options_model_network_gamma */ config::Flag NetworkModel::cfg_tcp_gamma( @@ -138,5 +110,3 @@ void insert_link_latency(std::vector& result, const std::vect } } // namespace simgrid::kernel::resource - -#endif /* NETWORK_INTERFACE_CPP_ */