Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Also cleanup the network/weight-S parameter
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 22 Oct 2022 20:05:48 +0000 (22:05 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 22 Oct 2022 20:10:40 +0000 (22:10 +0200)
src/kernel/resource/NetworkModel.cpp
src/kernel/resource/NetworkModel.hpp
src/simgrid/sg_config.cpp
src/surf/network_cm02.cpp
src/surf/surf_interface.hpp

index dd3da13..eb03713 100644 (file)
@@ -37,6 +37,10 @@ config::Flag<bool> NetworkModel::cfg_crosstraffic(
     "network/crosstraffic",
     "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)", "yes");
 
+config::Flag<double> NetworkModel::cfg_weight_S_parameter(
+    "network/weight-S",
+    "Correction factor to apply to the weight of competing streams (default value set by network model)", 0.0);
+
 NetworkModel::~NetworkModel() = default;
 
 double NetworkModel::next_occurring_event_full(double now)
index cbfa9b1..7740382 100644 (file)
@@ -28,6 +28,7 @@ public:
   static config::Flag<bool> cfg_crosstraffic;
   static double cfg_latency_factor;
   static double cfg_bandwidth_factor;
+  static config::Flag<double> cfg_weight_S_parameter;
 
   using Model::Model;
   NetworkModel(const NetworkModel&) = delete;
index 23d1edd..c966b7a 100644 (file)
@@ -279,11 +279,6 @@ void sg_config_init(int *argc, char **argv)
       simgrid::kernel::resource::NetworkModel::cfg_bandwidth_factor, "network/bandwidth-factor",
       "Correction factor to apply to the provided bandwidth (default value set by network model)");
 
-  sg_weight_S_parameter = 20537; // comes from the default LV08 network model
-  simgrid::config::bind_flag(
-      sg_weight_S_parameter, "network/weight-S",
-      "Correction factor to apply to the weight of competing streams (default value set by network model)");
-
   static simgrid::config::Flag<double> _sg_network_loopback_latency{
       "network/loopback-lat",
       "For network models with an implicit loopback link (L07, CM02, LV08), "
index 159d606..0a6e7a7 100644 (file)
@@ -26,8 +26,6 @@ static simgrid::config::Flag<std::string> cfg_network_solver("network/solver",
                                                              "Set linear equations solver used by network model",
                                                              "maxmin", &simgrid::kernel::lmm::System::validate_solver);
 
-double sg_weight_S_parameter = 0.0; /* default value; can be set by model or from command line */
-
 /************************************************************************/
 /* New model based on optimizations discussed during Pedro Velho's thesis*/
 /************************************************************************/
@@ -431,10 +429,10 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
   action->sharing_penalty_  = latency;
   action->latency_          = latency;
 
-  if (sg_weight_S_parameter > 0) {
+  if (cfg_weight_S_parameter > 0) {
     action->sharing_penalty_ = std::accumulate(route.begin(), route.end(), action->sharing_penalty_,
                                                [](double total, StandardLinkImpl* const& link) {
-                                                 return total + sg_weight_S_parameter / link->get_bandwidth();
+                                                 return total + cfg_weight_S_parameter / link->get_bandwidth();
                                                });
   }
 
@@ -496,9 +494,9 @@ void NetworkCm02Link::set_bandwidth(double value)
 
   StandardLinkImpl::on_bandwidth_change();
 
-  if (sg_weight_S_parameter > 0) {
-    double delta = sg_weight_S_parameter / (bandwidth_.peak * bandwidth_.scale) -
-                   sg_weight_S_parameter / (old_peak * bandwidth_.scale);
+  if (NetworkModel::cfg_weight_S_parameter > 0) {
+    double delta = NetworkModel::cfg_weight_S_parameter / (bandwidth_.peak * bandwidth_.scale) -
+                   NetworkModel::cfg_weight_S_parameter / (old_peak * bandwidth_.scale);
 
     const kernel::lmm::Element* elem     = nullptr;
     const kernel::lmm::Element* nextelem = nullptr;
index c7cd906..e5d6d9a 100644 (file)
@@ -30,7 +30,6 @@ XBT_PUBLIC_DATA double sg_maxmin_precision;
 XBT_PUBLIC_DATA double sg_surf_precision;
 XBT_PUBLIC_DATA int sg_concurrency_limit;
 
-extern XBT_PRIVATE double sg_weight_S_parameter;
 extern XBT_PRIVATE std::vector<std::string> surf_path;
 extern XBT_PRIVATE std::unordered_map<std::string, simgrid::kernel::profile::Profile*> traces_set_list;