Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix process_killall. Closes #186.
[simgrid.git] / src / surf / network_smpi.cpp
index 411a467..9c6f389 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015. The SimGrid Team.
+/* Copyright (c) 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -18,8 +18,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 std::vector<s_smpi_factor_t> smpi_bw_factor;
 std::vector<s_smpi_factor_t> smpi_lat_factor;
 
-xbt_dict_t gap_lookup = nullptr;
-
 /*********
  * Model *
  *********/
@@ -42,73 +40,65 @@ void surf_network_model_init_SMPI()
   surf_network_model = new simgrid::surf::NetworkSmpiModel();
   all_existing_models->push_back(surf_network_model);
 
-  xbt_cfg_setdefault_double("network/sender-gap", 10e-6);
   xbt_cfg_setdefault_double("network/weight-S", 8775);
 }
 
 namespace simgrid {
-  namespace surf {
-
-  NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
-  {
-    haveGap_ = true;
-    }
-
-    NetworkSmpiModel::~NetworkSmpiModel()
-    {
-      xbt_dict_free(&gap_lookup);
-    }
-
-    double NetworkSmpiModel::bandwidthFactor(double size)
-    {
-      if (smpi_bw_factor.empty())
-        smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw-factor"));
-
-      double current = 1.0;
-      for (const auto& fact : smpi_bw_factor) {
-        if (size <= fact.factor) {
-          XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
-          return current;
-        } else
-          current = fact.values.front();
-      }
-      XBT_DEBUG("%f > %zu return %f", size, smpi_bw_factor.back().factor, current);
+namespace surf {
 
-      return current;
-    }
-
-    double NetworkSmpiModel::latencyFactor(double size)
-    {
-      if (smpi_lat_factor.empty())
-        smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));
-
-      double current=1.0;
-      for (const auto& fact : smpi_lat_factor) {
-        if (size <= fact.factor) {
-          XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
-          return current;
-        }else
-          current=fact.values.front();
-      }
-      XBT_DEBUG("%f > %zu return %f", size, smpi_lat_factor.back().factor, current);
+NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
+{
+}
+
+NetworkSmpiModel::~NetworkSmpiModel() = default;
 
+double NetworkSmpiModel::bandwidthFactor(double size)
+{
+  if (smpi_bw_factor.empty())
+    smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw-factor"));
+
+  double current = 1.0;
+  for (auto const& fact : smpi_bw_factor) {
+    if (size <= fact.factor) {
+      XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
       return current;
-    }
+    } else
+      current = fact.values.front();
+  }
+  XBT_DEBUG("%f > %zu return %f", size, smpi_bw_factor.back().factor, current);
+
+  return current;
+}
 
-    double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
-    {
-      return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
-    }
+double NetworkSmpiModel::latencyFactor(double size)
+{
+  if (smpi_lat_factor.empty())
+    smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));
 
-    /************
-     * Resource *
-     ************/
+  double current = 1.0;
+  for (auto const& fact : smpi_lat_factor) {
+    if (size <= fact.factor) {
+      XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
+      return current;
+    } else
+      current = fact.values.front();
+  }
+  XBT_DEBUG("%f > %zu return %f", size, smpi_lat_factor.back().factor, current);
 
+  return current;
+}
 
+double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
+{
+  return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
+}
 
-    /**********
    * Action *
    **********/
+/************
* Resource *
************/
 
-  }
+/**********
+ * Action *
+ **********/
+}
 }