Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Wifi model interface:
authorLoic Guegan <manzerberdes@gmx.com>
Tue, 9 Jul 2019 16:09:05 +0000 (18:09 +0200)
committerLoic Guegan <manzerberdes@gmx.com>
Tue, 9 Jul 2019 16:18:04 +0000 (18:18 +0200)
 - Modify CM02 to handle WIFI links
 - Modify xml parser to handle WIFI sharing policy
 - Modify xml parser to create links with sevral bandwidths for WIFI

22 files changed:
include/simgrid/s4u/Link.hpp
src/bindings/lua/lua_platf.cpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/surf/link_wifi.cpp [deleted file]
src/surf/link_wifi.hpp [deleted file]
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_constant.hpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/ptask_L07.cpp
src/surf/ptask_L07.hpp
src/surf/sg_platf.cpp
src/surf/xml/platf.hpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_sax_cb.cpp
tools/cmake/DefinePackages.cmake

index bf34cc7..3ef6cee 100644 (file)
@@ -32,7 +32,7 @@ class XBT_PUBLIC Link : public xbt::Extendable<Link> {
   kernel::resource::LinkImpl* const pimpl_;
 
 public:
-  enum class SharingPolicy { SPLITDUPLEX = 2, SHARED = 1, FATPIPE = 0 };
+  enum class SharingPolicy { WIFI = 3, SPLITDUPLEX = 2, SHARED = 1, FATPIPE = 0 };
 
   kernel::resource::LinkImpl* get_impl() const { return pimpl_; }
 
index a806124..eba4663 100644 (file)
@@ -94,7 +94,7 @@ int console_add_backbone(lua_State *L) {
   type = lua_gettable(L, -2);
   lua_ensure(type == LUA_TSTRING || type == LUA_TNUMBER,
       "Attribute 'bandwidth' must be specified for backbone and must either be a string (in the right format; see docs) or a number.");
-  link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of backbone", link.id.c_str());
+  link.bandwidths.push_back(surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of backbone", link.id.c_str()));
   lua_pop(L, 1);
 
   lua_pushstring(L, "lat");
@@ -228,9 +228,9 @@ int  console_add_link(lua_State *L) {
   lua_ensure(type == LUA_TSTRING || type == LUA_TNUMBER,
       "Attribute 'bandwidth' must be specified for any link and must either be either a string (in the right format; see docs) or a number.");
   if (type == LUA_TNUMBER)
-    link.bandwidth = lua_tonumber(L, -1);
+    link.bandwidths.push_back(lua_tonumber(L, -1));
   else // LUA_TSTRING
-    link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of link", link.id.c_str());
+    link.bandwidths.push_back(surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of link", link.id.c_str()));
   lua_pop(L, 1);
 
   //get latency value
index e49e486..fd2a827 100644 (file)
@@ -129,7 +129,7 @@ void ClusterZone::create_links_for_node(ClusterCreationArgs* cluster, int id, in
 
   LinkCreationArgs link;
   link.id        = link_id;
-  link.bandwidth = cluster->bw;
+  link.bandwidths.push_back(cluster->bw);
   link.latency   = cluster->lat;
   link.policy    = cluster->sharing_policy;
   sg_platf_new_link(&link);
index fd526d1..d390e51 100644 (file)
@@ -138,7 +138,7 @@ void DragonflyZone::create_link(const std::string& id, int numlinks, resource::L
   *linkup   = nullptr;
   *linkdown = nullptr;
   LinkCreationArgs linkTemplate;
-  linkTemplate.bandwidth = this->bw_ * numlinks;
+  linkTemplate.bandwidths.push_back(this->bw_ * numlinks);
   linkTemplate.latency   = this->lat_;
   linkTemplate.policy    = this->sharing_policy_;
   linkTemplate.id        = std::move(id);
index d8b6e50..c277462 100644 (file)
@@ -445,7 +445,7 @@ FatTreeNode::FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int po
 {
   LinkCreationArgs linkTemplate;
   if (cluster->limiter_link) {
-    linkTemplate.bandwidth = cluster->limiter_link;
+    linkTemplate.bandwidths.push_back(cluster->limiter_link);
     linkTemplate.latency   = 0;
     linkTemplate.policy    = s4u::Link::SharingPolicy::SHARED;
     linkTemplate.id        = "limiter_"+std::to_string(id);
@@ -453,7 +453,7 @@ FatTreeNode::FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int po
     this->limiter_link_ = s4u::Link::by_name(linkTemplate.id)->get_impl();
   }
   if (cluster->loopback_bw || cluster->loopback_lat) {
-    linkTemplate.bandwidth = cluster->loopback_bw;
+    linkTemplate.bandwidths.push_back(cluster->loopback_bw);
     linkTemplate.latency   = cluster->loopback_lat;
     linkTemplate.policy    = s4u::Link::SharingPolicy::FATPIPE;
     linkTemplate.id        = "loopback_"+ std::to_string(id);
@@ -467,7 +467,7 @@ FatTreeLink::FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* downNode, Fa
 {
   static int uniqueId = 0;
   LinkCreationArgs linkTemplate;
-  linkTemplate.bandwidth = cluster->bw;
+  linkTemplate.bandwidths.push_back(cluster->bw);
   linkTemplate.latency   = cluster->lat;
   linkTemplate.policy    = cluster->sharing_policy; // sthg to do with that ?
   linkTemplate.id =
index dd4e9a3..a1001e6 100644 (file)
@@ -40,7 +40,7 @@ void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int
     std::string link_id =
         std::string(cluster->id) + "_link_from_" + std::to_string(id) + "_to_" + std::to_string(neighbor_rank_id);
     link.id        = link_id;
-    link.bandwidth = cluster->bw;
+    link.bandwidths.push_back(cluster->bw);
     link.latency   = cluster->lat;
     link.policy    = cluster->sharing_policy;
     sg_platf_new_link(&link);
index 5eb0694..818bffe 100644 (file)
@@ -73,8 +73,10 @@ void VivaldiZone::set_peer_link(NetPoint* netpoint, double bw_in, double bw_out,
 
   std::string link_up      = "link_" + netpoint->get_name() + "_UP";
   std::string link_down    = "link_" + netpoint->get_name() + "_DOWN";
-  resource::LinkImpl* linkUp   = network_model_->create_link(link_up, bw_out, 0, s4u::Link::SharingPolicy::SHARED);
-  resource::LinkImpl* linkDown = network_model_->create_link(link_down, bw_in, 0, s4u::Link::SharingPolicy::SHARED);
+  resource::LinkImpl* linkUp =
+      network_model_->create_link(link_up, std::vector<double>(1, bw_out), 0, s4u::Link::SharingPolicy::SHARED);
+  resource::LinkImpl* linkDown =
+      network_model_->create_link(link_down, std::vector<double>(1, bw_in), 0, s4u::Link::SharingPolicy::SHARED);
   private_links_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
diff --git a/src/surf/link_wifi.cpp b/src/surf/link_wifi.cpp
deleted file mode 100644 (file)
index fa99474..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (c) 2013-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. */
-
-#include "src/surf/link_wifi.hpp"
-
-namespace simgrid {
-namespace kernel {
-namespace resource {
-
-NetworkWifiLink::NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
-                                 s4u::Link::SharingPolicy policy, lmm::System* system)
-    : NetworkCm02Link(model, name, 0, 0, policy, system)
-{
-  for (auto bandwith : bandwidths) {
-    bandwidths_.push_back({bandwith, 1.0, nullptr});
-  }
-}
-
-void NetworkWifiLink::set_host_rate(sg_host_t host, int rate_level)
-{
-  host_rates_.insert(std::make_pair(host->get_name(), rate_level));
-}
-} // namespace resource
-} // namespace kernel
-} // namespace simgrid
diff --git a/src/surf/link_wifi.hpp b/src/surf/link_wifi.hpp
deleted file mode 100644 (file)
index 9aa5d91..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Copyright (c) 2013-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. */
-
-#ifndef SURF_LINK_WIFI_HPP_
-#define SURF_LINK_WIFI_HPP_
-
-#include "network_cm02.hpp"
-#include "network_interface.hpp"
-#include "src/surf/HostImpl.hpp"
-#include "xbt/string.hpp"
-
-namespace simgrid {
-namespace kernel {
-namespace resource {
-
-class NetworkWifiLink : public NetworkCm02Link {
-  /** @brief Hold every rates association between host and links (host name, rates id) */
-  std::map<xbt::string, int> host_rates_;
-
-  /** @brief Hold every rates available for this Access Point */
-  // double* rates; FIXME: unused
-
-  /** @brief A link can have several bandwith attach to it (mostly use by wifi model) */
-  std::vector<Metric> bandwidths_;
-
-public:
-  NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
-                  s4u::Link::SharingPolicy policy, lmm::System* system);
-
-  void set_host_rate(sg_host_t host, int rate_level);
-};
-
-} // namespace resource
-} // namespace kernel
-} // namespace simgrid
-
-#endif
index 883578b..d606b2a 100644 (file)
@@ -86,13 +86,18 @@ NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(b
   }
 
   set_maxmin_system(make_new_lmm_system(select));
-  loopback_ = NetworkCm02Model::create_link("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
+  loopback_ = NetworkCm02Model::create_link("__loopback__", std::vector<double>(1, 498000000), 0.000015,
+                                            s4u::Link::SharingPolicy::FATPIPE);
 }
 
-LinkImpl* NetworkCm02Model::create_link(const std::string& name, double bandwidth, double latency,
+LinkImpl* NetworkCm02Model::create_link(const std::string& name, std::vector<double> bandwidths, double latency,
                                         s4u::Link::SharingPolicy policy)
 {
-  return new NetworkCm02Link(this, name, bandwidth, latency, policy, get_maxmin_system());
+  if (policy == s4u::Link::SharingPolicy::WIFI) {
+    return (new NetworkWifiLink(this, name, bandwidths, policy, get_maxmin_system()));
+  }
+  xbt_assert(bandwidths.size() == 1, "Non WIFI links must use only 1 bandwidth.");
+  return new NetworkCm02Link(this, name, bandwidths[0], latency, policy, get_maxmin_system());
 }
 
 void NetworkCm02Model::update_actions_state_lazy(double now, double /*delta*/)
@@ -350,6 +355,20 @@ void NetworkCm02Link::set_latency(double value)
   }
 }
 
+NetworkWifiLink::NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
+                                 s4u::Link::SharingPolicy policy, lmm::System* system)
+    : NetworkCm02Link(model, name, 0, 0, policy, system)
+{
+  for (auto bandwith : bandwidths) {
+    bandwidths_.push_back({bandwith, 1.0, nullptr});
+  }
+}
+
+void NetworkWifiLink::set_host_rate(sg_host_t host, int rate_level)
+{
+  host_rates_.insert(std::make_pair(host->get_name(), rate_level));
+}
+
 /**********
  * Action *
  **********/
index cd576d6..235b7f0 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "network_interface.hpp"
 #include "xbt/graph.h"
-
+#include "xbt/string.hpp"
 
 /***********
  * Classes *
@@ -32,7 +32,7 @@ class NetworkCm02Model : public NetworkModel {
 public:
   explicit NetworkCm02Model(lmm::System* (*make_new_sys)(bool) = &lmm::make_new_maxmin_system);
   virtual ~NetworkCm02Model() = default;
-  LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+  LinkImpl* create_link(const std::string& name, std::vector<double> bandwidths, double latency,
                         s4u::Link::SharingPolicy policy) override;
   void update_actions_state_lazy(double now, double delta) override;
   void update_actions_state_full(double now, double delta) override;
@@ -53,6 +53,23 @@ public:
   void set_latency(double value) override;
 };
 
+class NetworkWifiLink : public NetworkCm02Link {
+  /** @brief Hold every rates association between host and links (host name, rates id) */
+  std::map<xbt::string, int> host_rates_;
+
+  /** @brief Hold every rates available for this Access Point */
+  // double* rates; FIXME: unused
+
+  /** @brief A link can have several bandwith attach to it (mostly use by wifi model) */
+  std::vector<Metric> bandwidths_;
+
+public:
+  NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
+                  s4u::Link::SharingPolicy policy, lmm::System* system);
+
+  void set_host_rate(sg_host_t host, int rate_level);
+};
+
 /**********
  * Action *
  **********/
index 6ec3a51..84d70ad 100644 (file)
@@ -27,8 +27,8 @@ NetworkConstantModel::NetworkConstantModel() : NetworkModel(Model::UpdateAlgo::F
   all_existing_models.push_back(this);
 }
 
-LinkImpl* NetworkConstantModel::create_link(const std::string& name, double /*bandwidth*/, double /*latency*/,
-                                            s4u::Link::SharingPolicy)
+LinkImpl* NetworkConstantModel::create_link(const std::string& name, std::vector<double> /*bandwidth*/,
+                                            double /*latency*/, s4u::Link::SharingPolicy)
 {
 
   xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "
index 63a08d0..daa5ff7 100644 (file)
@@ -21,7 +21,8 @@ public:
   double next_occuring_event(double now) override;
   void update_actions_state(double now, double delta) override;
 
-  LinkImpl* create_link(const std::string& name, double bw, double lat, s4u::Link::SharingPolicy policy) override;
+  LinkImpl* create_link(const std::string& name, std::vector<double> bws, double lat,
+                        s4u::Link::SharingPolicy policy) override;
 };
 
 class NetworkConstantAction : public NetworkAction {
index 79103fd..d86a596 100644 (file)
@@ -48,7 +48,7 @@ public:
    * @param latency The initial latency of the Link in seconds
    * @param policy The sharing policy of the Link
    */
-  virtual LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+  virtual LinkImpl* create_link(const std::string& name, std::vector<double> bandwidths, double latency,
                                 s4u::Link::SharingPolicy policy) = 0;
 
   /**
index 36b798d..c6e2cce 100644 (file)
@@ -173,10 +173,11 @@ NetworkNS3Model::~NetworkNS3Model() {
   IPV4addr.clear();
 }
 
-LinkImpl* NetworkNS3Model::create_link(const std::string& name, double bandwidth, double latency,
+LinkImpl* NetworkNS3Model::create_link(const std::string& name, std::vector<double> bandwidths, double latency,
                                        s4u::Link::SharingPolicy policy)
 {
-  return new LinkNS3(this, name, bandwidth, latency);
+  xbt_assert(bandwidths.size() == 1, "Non WIFI links must use only 1 bandwidth.");
+  return new LinkNS3(this, name, bandwidths[0], latency);
 }
 
 Action* NetworkNS3Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
index 18cba8c..dc1ec58 100644 (file)
@@ -57,7 +57,8 @@ NetworkL07Model::NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys)
     : NetworkModel(Model::UpdateAlgo::FULL), hostModel_(hmodel)
 {
   set_maxmin_system(sys);
-  loopback_ = NetworkL07Model::create_link("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
+  loopback_ = NetworkL07Model::create_link("__loopback__", std::vector<double>(1, 498000000), 0.000015,
+                                           s4u::Link::SharingPolicy::FATPIPE);
 }
 
 NetworkL07Model::~NetworkL07Model()
@@ -224,10 +225,11 @@ kernel::resource::Cpu* CpuL07Model::create_cpu(s4u::Host* host, const std::vecto
   return new CpuL07(this, host, speed_per_pstate, core);
 }
 
-kernel::resource::LinkImpl* NetworkL07Model::create_link(const std::string& name, double bandwidth, double latency,
-                                                         s4u::Link::SharingPolicy policy)
+kernel::resource::LinkImpl* NetworkL07Model::create_link(const std::string& name, std::vector<double> bandwidths,
+                                                         double latency, s4u::Link::SharingPolicy policy)
 {
-  return new LinkL07(this, name, bandwidth, latency, policy);
+  xbt_assert(bandwidths.size() == 1, "Non WIFI link must have only 1 bandwidth.");
+  return new LinkL07(this, name, bandwidths[0], latency, policy);
 }
 
 /************
index 523e00f..83f62f3 100644 (file)
@@ -63,7 +63,7 @@ public:
   NetworkL07Model(const NetworkL07Model&) = delete;
   NetworkL07Model& operator=(const NetworkL07Model&) = delete;
   ~NetworkL07Model();
-  kernel::resource::LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+  kernel::resource::LinkImpl* create_link(const std::string& name, std::vector<double> bandwidths, double latency,
                                           s4u::Link::SharingPolicy policy) override;
 
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
index 21dd6c1..3e41181 100644 (file)
@@ -113,7 +113,7 @@ simgrid::kernel::routing::NetPoint* sg_platf_new_router(const std::string& name,
 static void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link, const std::string& link_name)
 {
   simgrid::kernel::resource::LinkImpl* l =
-      surf_network_model->create_link(link_name, link->bandwidth, link->latency, link->policy);
+      surf_network_model->create_link(link_name, link->bandwidths, link->latency, link->policy);
 
   if (link->properties) {
     l->set_properties(*link->properties);
@@ -217,7 +217,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
 
       simgrid::kernel::routing::LinkCreationArgs link;
       link.id        = tmp_link;
-      link.bandwidth = cluster->loopback_bw;
+      link.bandwidths.push_back(cluster->loopback_bw);
       link.latency   = cluster->loopback_lat;
       link.policy    = simgrid::s4u::Link::SharingPolicy::FATPIPE;
       sg_platf_new_link(&link);
@@ -237,7 +237,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
 
       simgrid::kernel::routing::LinkCreationArgs link;
       link.id        = tmp_link;
-      link.bandwidth = cluster->limiter_link;
+      link.bandwidths.push_back(cluster->limiter_link);
       link.latency = 0;
       link.policy    = simgrid::s4u::Link::SharingPolicy::SHARED;
       sg_platf_new_link(&link);
@@ -272,7 +272,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
 
     simgrid::kernel::routing::LinkCreationArgs link;
     link.id        = std::string(cluster->id)+ "_backbone";
-    link.bandwidth = cluster->bb_bw;
+    link.bandwidths.push_back(cluster->bb_bw);
     link.latency   = cluster->bb_lat;
     link.policy    = cluster->bb_sharing_policy;
 
@@ -315,7 +315,7 @@ void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet
     simgrid::kernel::routing::LinkCreationArgs link;
     link.policy    = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX;
     link.latency   = cabinet->lat;
-    link.bandwidth = cabinet->bw;
+    link.bandwidths.push_back(cabinet->bw);
     link.id        = "link_" + hostname;
     sg_platf_new_link(&link);
 
index 4160d86..35d4bca 100644 (file)
@@ -24,6 +24,8 @@ XBT_PUBLIC int surf_parse_get_int(const std::string& s);
 XBT_PUBLIC double surf_parse_get_time(const char* string, const char* entity_kind, const std::string& name);
 XBT_PUBLIC double surf_parse_get_size(const char* string, const char* entity_kind, const std::string& name);
 XBT_PUBLIC double surf_parse_get_bandwidth(const char* string, const char* entity_kind, const std::string& name);
+XBT_PUBLIC std::vector<double> surf_parse_get_bandwidths(const char* string, const char* entity_kind,
+                                                         const std::string& name);
 XBT_PUBLIC double surf_parse_get_speed(const char* string, const char* entity_kind, const std::string& name);
 
 XBT_PUBLIC int surf_parse(); /* Entry-point to the parser */
index e321afc..09aaaad 100644 (file)
@@ -53,7 +53,7 @@ public:
 class LinkCreationArgs {
 public:
   std::string id;
-  double bandwidth                    = 0;
+  std::vector<double> bandwidths;
   profile::Profile* bandwidth_trace                        = nullptr;
   double latency                      = 0;
   profile::Profile* latency_trace                          = nullptr;
index 118e736..5544791 100644 (file)
@@ -229,6 +229,23 @@ double surf_parse_get_bandwidth(const char* string, const char* entity_kind, con
       "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps");
 }
 
+std::vector<double> surf_parse_get_bandwidths(const char* string, const char* entity_kind, const std::string& name)
+{
+  static const unit_scale units{std::make_tuple("bps", 0.125, 2, true), std::make_tuple("bps", 0.125, 10, true),
+                                std::make_tuple("Bps", 1.0, 2, true), std::make_tuple("Bps", 1.0, 10, true)};
+
+  std::vector<double> bandwidths;
+  std::vector<std::string> tokens;
+  boost::split(tokens, string, boost::is_any_of(";"));
+  for (auto token : tokens) {
+    bandwidths.push_back(surf_parse_get_value_with_unit(
+        token.c_str(), units, entity_kind, name,
+        "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps"));
+  }
+
+  return (bandwidths);
+}
+
 double surf_parse_get_speed(const char* string, const char* entity_kind, const std::string& name)
 {
   static const unit_scale units{std::make_tuple("f", 1.0, 10, true), std::make_tuple("flops", 1.0, 10, false)};
@@ -589,7 +606,7 @@ void ETag_surfxml_link(){
   current_property_set     = nullptr;
 
   link.id                  = std::string(A_surfxml_link_id);
-  link.bandwidth           = surf_parse_get_bandwidth(A_surfxml_link_bandwidth, "bandwidth of link", link.id.c_str());
+  link.bandwidths          = surf_parse_get_bandwidths(A_surfxml_link_bandwidth, "bandwidth of link", link.id.c_str());
   link.bandwidth_trace     = A_surfxml_link_bandwidth___file[0]
                              ? simgrid::kernel::profile::Profile::from_file(A_surfxml_link_bandwidth___file)
                              : nullptr;
@@ -615,6 +632,9 @@ void ETag_surfxml_link(){
   case A_surfxml_link_sharing___policy_SPLITDUPLEX:
     link.policy = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX;
     break;
+  case A_surfxml_link_sharing___policy_WIFI:
+    link.policy = simgrid::s4u::Link::SharingPolicy::WIFI;
+    break;
   default:
     surf_parse_error(std::string("Invalid sharing policy in link ") + link.id);
   }
@@ -660,7 +680,8 @@ void ETag_surfxml_backbone(){
 
   link.properties = nullptr;
   link.id = std::string(A_surfxml_backbone_id);
-  link.bandwidth = surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth, "bandwidth of backbone", link.id.c_str());
+  link.bandwidths.push_back(
+      surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth, "bandwidth of backbone", link.id.c_str()));
   link.latency = surf_parse_get_time(A_surfxml_backbone_latency, "latency of backbone", link.id.c_str());
   link.policy     = simgrid::s4u::Link::SharingPolicy::SHARED;
 
index 04c57b0..11bd51d 100644 (file)
@@ -340,8 +340,6 @@ set(SURF_SRC
   src/surf/cpu_interface.cpp
   src/surf/cpu_ti.cpp
   src/surf/network_cm02.cpp
-  src/surf/link_wifi.cpp
-  src/surf/link_wifi.hpp
   src/surf/network_constant.cpp
   src/surf/network_interface.cpp
   src/surf/PropertyHolder.cpp