Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move all network models to the kernel::resource namespace
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 7 Apr 2018 06:24:46 +0000 (08:24 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 7 Apr 2018 06:35:10 +0000 (08:35 +0200)
49 files changed:
include/simgrid/forward.h
include/simgrid/kernel/routing/ClusterZone.hpp
include/simgrid/kernel/routing/DijkstraZone.hpp
include/simgrid/kernel/routing/DragonflyZone.hpp
include/simgrid/kernel/routing/FatTreeZone.hpp
include/simgrid/kernel/routing/FloydZone.hpp
include/simgrid/kernel/routing/FullZone.hpp
include/simgrid/kernel/routing/NetZoneImpl.hpp
include/simgrid/kernel/routing/RoutedZone.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Link.hpp
include/simgrid/s4u/NetZone.hpp
src/bindings/lua/lua_platf.cpp
src/instr/instr_interface.cpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/s4u/s4u_engine.cpp
src/s4u/s4u_host.cpp
src/s4u/s4u_link.cpp
src/s4u/s4u_netzone.cpp
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_constant.hpp
src/surf/network_ib.cpp
src/surf/network_ib.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/network_smpi.cpp
src/surf/network_smpi.hpp
src/surf/ns3/ns3_simulator.cpp
src/surf/ns3/ns3_simulator.hpp
src/surf/plugins/link_energy.cpp
src/surf/ptask_L07.cpp
src/surf/ptask_L07.hpp
src/surf/sg_platf.cpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_sax_cb.cpp
teshsuite/simdag/flatifier/flatifier.cpp

index fa46962..15adc03 100644 (file)
@@ -17,12 +17,9 @@ namespace simgrid {
 namespace config {
 template <class T> class Flag;
 }
 namespace config {
 template <class T> class Flag;
 }
+
 namespace kernel {
 class EngineImpl;
 namespace kernel {
 class EngineImpl;
-namespace context {
-class Context;
-class ContextFactory;
-}
 namespace actor {
 class ActorImpl;
 using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
 namespace actor {
 class ActorImpl;
 using ActorImplPtr = boost::intrusive_ptr<ActorImpl>;
@@ -48,6 +45,10 @@ namespace activity {
 
   class MailboxImpl;
 }
 
   class MailboxImpl;
 }
+namespace context {
+class Context;
+class ContextFactory;
+} // namespace context
 namespace lmm {
 class Element;
 class Variable;
 namespace lmm {
 class Element;
 class Variable;
@@ -60,6 +61,8 @@ class Action;
 class Model;
 class Resource;
 class TraceEvent;
 class Model;
 class Resource;
 class TraceEvent;
+class LinkImpl;
+class NetworkAction;
 }
 namespace routing {
 class ClusterCreationArgs;
 }
 namespace routing {
 class ClusterCreationArgs;
@@ -68,14 +71,12 @@ class NetPoint;
 class NetZoneImpl;
 class RouteCreationArgs;
 }
 class NetZoneImpl;
 class RouteCreationArgs;
 }
-}
+} // namespace kernel
 namespace simix {
   class Host;
 }
 namespace simix {
   class Host;
 }
-
 namespace surf {
   class Cpu;
 namespace surf {
   class Cpu;
-  class LinkImpl;
   class HostImpl;
   class StorageImpl;
   class StorageType;
   class HostImpl;
   class StorageImpl;
   class StorageType;
@@ -84,7 +85,7 @@ namespace trace_mgr {
   class trace;
   class future_evt_set;
 }
   class trace;
   class future_evt_set;
 }
-}
+} // namespace simgrid
 
 typedef simgrid::s4u::Actor s4u_Actor;
 typedef simgrid::s4u::Host s4u_Host;
 
 typedef simgrid::s4u::Actor s4u_Actor;
 typedef simgrid::s4u::Host s4u_Host;
index 0005d46..44212a9 100644 (file)
@@ -81,14 +81,14 @@ public:
 
   /* We use a map instead of a std::vector here because that's a sparse vector. Some values may not exist */
   /* The pair is {linkUp, linkDown} */
 
   /* We use a map instead of a std::vector here because that's a sparse vector. Some values may not exist */
   /* The pair is {linkUp, linkDown} */
-  std::unordered_map<unsigned int, std::pair<surf::LinkImpl*, surf::LinkImpl*>> private_links_;
+  std::unordered_map<unsigned int, std::pair<kernel::resource::LinkImpl*, kernel::resource::LinkImpl*>> private_links_;
 
   unsigned int node_pos(int id) { return id * num_links_per_node_; }
   unsigned int node_pos_with_loopback(int id) { return node_pos(id) + (has_loopback_ ? 1 : 0); }
   unsigned int node_pos_with_loopback_limiter(int id) { return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0); }
 
   void* loopback_                = nullptr;
 
   unsigned int node_pos(int id) { return id * num_links_per_node_; }
   unsigned int node_pos_with_loopback(int id) { return node_pos(id) + (has_loopback_ ? 1 : 0); }
   unsigned int node_pos_with_loopback_limiter(int id) { return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0); }
 
   void* loopback_                = nullptr;
-  surf::LinkImpl* backbone_        = nullptr;
+  kernel::resource::LinkImpl* backbone_ = nullptr;
   NetPoint* router_              = nullptr;
   bool has_limiter_                = false;
   bool has_loopback_               = false;
   NetPoint* router_              = nullptr;
   bool has_limiter_                = false;
   bool has_loopback_               = false;
index 2003a9a..b3a5322 100644 (file)
@@ -53,7 +53,7 @@ public:
    */
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) override;
   void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
    */
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) override;
   void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                 std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) override;
+                 std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
 
   xbt_graph_t route_graph_ = nullptr;          /* xbt_graph */
   std::map<int, xbt_node_t> graph_node_map_;   /* map */
 
   xbt_graph_t route_graph_ = nullptr;          /* xbt_graph */
   std::map<int, xbt_node_t> graph_node_map_;   /* map */
index f11a8e5..bb06b63 100644 (file)
@@ -17,10 +17,10 @@ public:
   unsigned int group_;
   unsigned int chassis_;
   unsigned int blade_;
   unsigned int group_;
   unsigned int chassis_;
   unsigned int blade_;
-  surf::LinkImpl** blue_links_  = nullptr;
-  surf::LinkImpl** black_links_ = nullptr;
-  surf::LinkImpl** green_links_ = nullptr;
-  surf::LinkImpl** my_nodes_    = nullptr;
+  resource::LinkImpl** blue_links_  = nullptr;
+  resource::LinkImpl** black_links_ = nullptr;
+  resource::LinkImpl** green_links_ = nullptr;
+  resource::LinkImpl** my_nodes_    = nullptr;
   DragonflyRouter(int i, int j, int k);
   ~DragonflyRouter();
 };
   DragonflyRouter(int i, int j, int k);
   ~DragonflyRouter();
 };
@@ -68,7 +68,7 @@ public:
   void seal() override;
   void generateRouters();
   void generateLinks();
   void seal() override;
   void generateRouters();
   void generateLinks();
-  void createLink(const std::string& id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown);
+  void createLink(const std::string& id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
 
   void rankId_to_coords(int rankId, unsigned int (*coords)[4]);
 
 
   void rankId_to_coords(int rankId, unsigned int (*coords)[4]);
 
index 1fb7230..b7023dc 100644 (file)
@@ -46,11 +46,11 @@ public:
 
   /** Virtual link standing for the node global capacity.
    */
 
   /** Virtual link standing for the node global capacity.
    */
-  surf::LinkImpl* limiter_link_;
+  resource::LinkImpl* limiter_link_;
   /** If present, communications from this node to this node will pass through it
    * instead of passing by an upper level switch.
    */
   /** If present, communications from this node to this node will pass through it
    * instead of passing by an upper level switch.
    */
-  surf::LinkImpl* loopback;
+  resource::LinkImpl* loopback;
   FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int position);
 };
 
   FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int position);
 };
 
@@ -63,9 +63,9 @@ class FatTreeLink {
 public:
   FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* source, FatTreeNode* destination);
   /** Link going up in the tree */
 public:
   FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* source, FatTreeNode* destination);
   /** Link going up in the tree */
-  surf::LinkImpl* up_link_;
+  resource::LinkImpl* up_link_;
   /** Link going down in the tree */
   /** Link going down in the tree */
-  surf::LinkImpl* down_link_;
+  resource::LinkImpl* down_link_;
   /** Upper end of the link */
   FatTreeNode* up_node_;
   /** Lower end of the link */
   /** Upper end of the link */
   FatTreeNode* up_node_;
   /** Lower end of the link */
index e9e65ec..92fe57f 100644 (file)
@@ -27,9 +27,8 @@ public:
   ~FloydZone() override;
 
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   ~FloydZone() override;
 
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
-  void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
-                 kernel::routing::NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
-                 bool symmetrical) override;
+  void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+                 std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
   void seal() override;
 
 private:
   void seal() override;
 
 private:
index 5f8fcde..99722a1 100644 (file)
@@ -25,9 +25,8 @@ public:
   ~FullZone() override;
 
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   ~FullZone() override;
 
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
-  void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
-                 kernel::routing::NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
-                 bool symmetrical) override;
+  void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+                 std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
 
 private:
   RouteCreationArgs** routing_table_ = nullptr;
 
 private:
   RouteCreationArgs** routing_table_ = nullptr;
index 18a525b..ba1d690 100644 (file)
@@ -59,7 +59,7 @@ public:
                                   std::map<std::string, std::string>* props);
   /** @brief Creates a new route in this NetZone */
   void add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
                                   std::map<std::string, std::string>* props);
   /** @brief Creates a new route in this NetZone */
   void add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                        std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) override;
+                        std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
 
 protected:
   /**
 
 protected:
   /**
@@ -74,7 +74,7 @@ protected:
   /** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */
   /* returns whether we found a bypass path */
   bool get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
   /** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */
   /* returns whether we found a bypass path */
   bool get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
-                        /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
+                        /* OUT */ std::vector<resource::LinkImpl*>& links, double* latency);
 
 public:
   /* @brief get the route between two nodes in the full platform
 
 public:
   /* @brief get the route between two nodes in the full platform
@@ -85,7 +85,7 @@ public:
    * @param latency Accumulator in which the latencies should be added (caller must set it to 0)
    */
   static void get_global_route(routing::NetPoint* src, routing::NetPoint* dst,
    * @param latency Accumulator in which the latencies should be added (caller must set it to 0)
    */
   static void get_global_route(routing::NetPoint* src, routing::NetPoint* dst,
-                               /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
+                               /* OUT */ std::vector<resource::LinkImpl*>& links, double* latency);
 
   virtual void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
                          std::map<std::string, xbt_edge_t>* edges) = 0;
 
   virtual void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
                          std::map<std::string, xbt_edge_t>* edges) = 0;
index 81d7c43..60bb1d5 100644 (file)
@@ -55,14 +55,13 @@ public:
   void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
                  std::map<std::string, xbt_edge_t>* edges) override;
   virtual RouteCreationArgs* newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
   void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
                  std::map<std::string, xbt_edge_t>* edges) override;
   virtual RouteCreationArgs* newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
-                                              NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
+                                              NetPoint* gw_dst, std::vector<resource::LinkImpl*>& link_list,
                                               bool symmetrical, bool change_order);
 
 protected:
   void getRouteCheckParams(NetPoint* src, NetPoint* dst);
                                               bool symmetrical, bool change_order);
 
 protected:
   void getRouteCheckParams(NetPoint* src, NetPoint* dst);
-  void addRouteCheckParams(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
-                           kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                           std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical);
+  void addRouteCheckParams(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+                           std::vector<resource::LinkImpl*>& link_list, bool symmetrical);
 };
 } // namespace routing
 } // namespace kernel
 };
 } // namespace routing
 } // namespace kernel
index db09e0d..3696d91 100644 (file)
@@ -112,7 +112,7 @@ public:
   std::unordered_map<std::string, Storage*> const& getMountedStorages();
 
   void routeTo(Host* dest, std::vector<Link*>& links, double* latency);
   std::unordered_map<std::string, Storage*> const& getMountedStorages();
 
   void routeTo(Host* dest, std::vector<Link*>& links, double* latency);
-  void routeTo(Host* dest, std::vector<surf::LinkImpl*>& links, double* latency);
+  void routeTo(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency);
 
   /** Block the calling actor on an execution located on the called host
    *
 
   /** Block the calling actor on an execution located on the called host
    *
index d236911..62f7633 100644 (file)
  ***********/
 
 namespace simgrid {
  ***********/
 
 namespace simgrid {
-namespace surf {
-class NetworkAction;
-};
 namespace s4u {
 /** @brief A Link represents the network facilities between [hosts](\ref simgrid::s4u::Host) */
 class XBT_PUBLIC Link : public simgrid::xbt::Extendable<Link> {
 namespace s4u {
 /** @brief A Link represents the network facilities between [hosts](\ref simgrid::s4u::Host) */
 class XBT_PUBLIC Link : public simgrid::xbt::Extendable<Link> {
-  friend simgrid::surf::LinkImpl;
+  friend simgrid::kernel::resource::LinkImpl;
 
   // Links are created from the NetZone, and destroyed by their private implementation when the simulation ends
 
   // Links are created from the NetZone, and destroyed by their private implementation when the simulation ends
-  explicit Link(surf::LinkImpl* pimpl) : pimpl_(pimpl) {}
+  explicit Link(kernel::resource::LinkImpl* pimpl) : pimpl_(pimpl) {}
   virtual ~Link() = default;
   // The private implementation, that never changes
   virtual ~Link() = default;
   // The private implementation, that never changes
-  surf::LinkImpl* const pimpl_;
+  kernel::resource::LinkImpl* const pimpl_;
 
 public:
   /** @brief Retrieve a link from its name */
 
 public:
   /** @brief Retrieve a link from its name */
@@ -87,10 +84,10 @@ public:
   static simgrid::xbt::signal<void(s4u::Link&)> onStateChange;
 
   /** @brief Callback signal fired when a communication starts */
   static simgrid::xbt::signal<void(s4u::Link&)> onStateChange;
 
   /** @brief Callback signal fired when a communication starts */
-  static simgrid::xbt::signal<void(surf::NetworkAction*, s4u::Host* src, s4u::Host* dst)> onCommunicate;
+  static simgrid::xbt::signal<void(kernel::resource::NetworkAction*, s4u::Host* src, s4u::Host* dst)> onCommunicate;
 
   /** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
 
   /** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
-  static simgrid::xbt::signal<void(surf::NetworkAction*)> onCommunicationStateChange;
+  static simgrid::xbt::signal<void(kernel::resource::NetworkAction*)> onCommunicationStateChange;
 
   XBT_ATTRIB_DEPRECATED_v321("Use get_cname(): v3.21 will turn this warning into an error.") const char* name();
 };
 
   XBT_ATTRIB_DEPRECATED_v321("Use get_cname(): v3.21 will turn this warning into an error.") const char* name();
 };
index 2b6b42e..13e8780 100644 (file)
@@ -48,13 +48,13 @@ public:
   XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_cname()") const char* getCname() const { return get_cname(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_route()") void addRoute(
       kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
   XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_cname()") const char* getCname() const { return get_cname(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_route()") void addRoute(
       kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
-      kernel::routing::NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+      kernel::routing::NetPoint* gw_dst, std::vector<simgrid::kernel::resource::LinkImpl*>& link_list, bool symmetrical)
   {
     add_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_bypass_route()") void addBypassRoute(
       kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
   {
     add_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_bypass_route()") void addBypassRoute(
       kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
-      kernel::routing::NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+      kernel::routing::NetPoint* gw_dst, std::vector<simgrid::kernel::resource::LinkImpl*>& link_list, bool symmetrical)
   {
     add_bypass_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
   }
   {
     add_bypass_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
   }
@@ -74,15 +74,15 @@ public:
   virtual int addComponent(kernel::routing::NetPoint * elm); /* A host, a router or a netzone, whatever */
   virtual void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                          kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
   virtual int addComponent(kernel::routing::NetPoint * elm); /* A host, a router or a netzone, whatever */
   virtual void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                          kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                         std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical);
+                         std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical);
   virtual void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                                 kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
   virtual void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                                 kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                                std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) = 0;
+                                std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical) = 0;
 
   /*** Called on each newly created regular route (not on bypass routes) */
   static simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                                    kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
 
   /*** Called on each newly created regular route (not on bypass routes) */
   static simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                                    kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                                   std::vector<surf::LinkImpl*>& link_list)>
+                                   std::vector<kernel::resource::LinkImpl*>& link_list)>
       onRouteCreation;
   static simgrid::xbt::signal<void(NetZone&)> onCreation;
   static simgrid::xbt::signal<void(NetZone&)> onSeal;
       onRouteCreation;
   static simgrid::xbt::signal<void(NetZone&)> onCreation;
   static simgrid::xbt::signal<void(NetZone&)> onSeal;
index 90a2afa..3275d94 100644 (file)
@@ -103,7 +103,7 @@ int console_add_backbone(lua_State *L) {
   }
 
   sg_platf_new_link(&link);
   }
 
   sg_platf_new_link(&link);
-  routing_cluster_add_backbone(simgrid::surf::LinkImpl::byName(link.id));
+  routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl::byName(link.id));
 
   return 0;
 }
 
   return 0;
 }
@@ -336,12 +336,12 @@ int console_add_route(lua_State *L) {
   boost::split(names, str, boost::is_any_of(", \t\r\n"));
   if (names.empty()) {
     /* unique name */
   boost::split(names, str, boost::is_any_of(", \t\r\n"));
   if (names.empty()) {
     /* unique name */
-    route.link_list.push_back(simgrid::surf::LinkImpl::byName(lua_tostring(L, -1)));
+    route.link_list.push_back(simgrid::kernel::resource::LinkImpl::byName(lua_tostring(L, -1)));
   } else {
     // Several names separated by , \t\r\n
     for (auto const& name : names) {
       if (name.length() > 0) {
   } else {
     // Several names separated by , \t\r\n
     for (auto const& name : names) {
       if (name.length() > 0) {
-        simgrid::surf::LinkImpl* link = simgrid::surf::LinkImpl::byName(name);
+        simgrid::kernel::resource::LinkImpl* link = simgrid::kernel::resource::LinkImpl::byName(name);
         route.link_list.push_back(link);
       }
     }
         route.link_list.push_back(link);
       }
     }
@@ -414,12 +414,12 @@ int console_add_ASroute(lua_State *L) {
   boost::split(names, str, boost::is_any_of(", \t\r\n"));
   if (names.empty()) {
     /* unique name with no comma */
   boost::split(names, str, boost::is_any_of(", \t\r\n"));
   if (names.empty()) {
     /* unique name with no comma */
-    ASroute.link_list.push_back(simgrid::surf::LinkImpl::byName(lua_tostring(L, -1)));
+    ASroute.link_list.push_back(simgrid::kernel::resource::LinkImpl::byName(lua_tostring(L, -1)));
   } else {
     // Several names separated by , \t\r\n
     for (auto const& name : names) {
       if (name.length() > 0) {
   } else {
     // Several names separated by , \t\r\n
     for (auto const& name : names) {
       if (name.length() > 0) {
-        simgrid::surf::LinkImpl* link = simgrid::surf::LinkImpl::byName(name);
+        simgrid::kernel::resource::LinkImpl* link = simgrid::kernel::resource::LinkImpl::byName(name);
         ASroute.link_list.push_back(link);
       }
     }
         ASroute.link_list.push_back(link);
       }
     }
index c5ff45c..62ca5c1 100644 (file)
@@ -305,7 +305,7 @@ static void instr_user_srcdst_variable(double time, const char *src, const char
   if (not dst_elm)
     xbt_die("Element '%s' not found!",dst);
 
   if (not dst_elm)
     xbt_die("Element '%s' not found!",dst);
 
-  std::vector<simgrid::surf::LinkImpl*> route;
+  std::vector<simgrid::kernel::resource::LinkImpl*> route;
   simgrid::kernel::routing::NetZoneImpl::get_global_route(src_elm, dst_elm, route, nullptr);
   for (auto const& link : route)
     instr_user_variable(time, link->get_cname(), variable, father_type, value, what, nullptr, &user_link_variables);
   simgrid::kernel::routing::NetZoneImpl::get_global_route(src_elm, dst_elm, route, nullptr);
   for (auto const& link : route)
     instr_user_variable(time, link->get_cname(), variable, father_type, value, what, nullptr, &user_link_variables);
index f162c5b..e3f8505 100644 (file)
@@ -30,7 +30,7 @@ void ClusterZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
   if ((src->id() == dst->id()) && has_loopback_) {
     xbt_assert(not src->is_router(), "Routing from a cluster private router to itself is meaningless");
 
   if ((src->id() == dst->id()) && has_loopback_) {
     xbt_assert(not src->is_router(), "Routing from a cluster private router to itself is meaningless");
 
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(node_pos(src->id()));
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos(src->id()));
     route->link_list.push_back(info.first);
     if (lat)
       *lat += info.first->latency();
     route->link_list.push_back(info.first);
     if (lat)
       *lat += info.first->latency();
@@ -39,11 +39,12 @@ void ClusterZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
 
   if (not src->is_router()) { // No private link for the private router
     if (has_limiter_) {      // limiter for sender
 
   if (not src->is_router()) { // No private link for the private router
     if (has_limiter_) {      // limiter for sender
-      std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(node_pos_with_loopback(src->id()));
+      std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos_with_loopback(src->id()));
       route->link_list.push_back(info.first);
     }
 
       route->link_list.push_back(info.first);
     }
 
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(node_pos_with_loopback_limiter(src->id()));
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info =
+        private_links_.at(node_pos_with_loopback_limiter(src->id()));
     if (info.first) { // link up
       route->link_list.push_back(info.first);
       if (lat)
     if (info.first) { // link up
       route->link_list.push_back(info.first);
       if (lat)
@@ -59,7 +60,8 @@ void ClusterZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
 
   if (not dst->is_router()) { // No specific link for router
 
 
   if (not dst->is_router()) { // No specific link for router
 
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(node_pos_with_loopback_limiter(dst->id()));
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info =
+        private_links_.at(node_pos_with_loopback_limiter(dst->id()));
     if (info.second) { // link down
       route->link_list.push_back(info.second);
       if (lat)
     if (info.second) { // link down
       route->link_list.push_back(info.second);
       if (lat)
@@ -91,7 +93,7 @@ void ClusterZone::get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>
     if (not src->is_router()) {
       xbt_node_t previous = new_xbt_graph_node(graph, src->get_cname(), nodes);
 
     if (not src->is_router()) {
       xbt_node_t previous = new_xbt_graph_node(graph, src->get_cname(), nodes);
 
-      std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(src->id());
+      std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(src->id());
 
       if (info.first) { // link up
         xbt_node_t current = new_xbt_graph_node(graph, info.first->get_cname(), nodes);
 
       if (info.first) { // link up
         xbt_node_t current = new_xbt_graph_node(graph, info.first->get_cname(), nodes);
@@ -129,13 +131,13 @@ void ClusterZone::create_links_for_node(ClusterCreationArgs* cluster, int id, in
   link.policy    = cluster->sharing_policy;
   sg_platf_new_link(&link);
 
   link.policy    = cluster->sharing_policy;
   sg_platf_new_link(&link);
 
-  surf::LinkImpl *linkUp;
-  surf::LinkImpl *linkDown;
+  resource::LinkImpl* linkUp;
+  resource::LinkImpl* linkDown;
   if (link.policy == SURF_LINK_SPLITDUPLEX) {
   if (link.policy == SURF_LINK_SPLITDUPLEX) {
-    linkUp   = surf::LinkImpl::byName(link_id + "_UP");
-    linkDown = surf::LinkImpl::byName(link_id + "_DOWN");
+    linkUp   = resource::LinkImpl::byName(link_id + "_UP");
+    linkDown = resource::LinkImpl::byName(link_id + "_DOWN");
   } else {
   } else {
-    linkUp   = surf::LinkImpl::byName(link_id);
+    linkUp   = resource::LinkImpl::byName(link_id);
     linkDown = linkUp;
   }
   private_links_.insert({position, {linkUp, linkDown}});
     linkDown = linkUp;
   }
   private_links_.insert({position, {linkUp, linkDown}});
index f6ae5a1..4aa05bb 100644 (file)
@@ -154,7 +154,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr
     for (auto const& link : e_route->link_list) {
       route->link_list.insert(route->link_list.begin(), link);
       if (lat)
     for (auto const& link : e_route->link_list) {
       route->link_list.insert(route->link_list.begin(), link);
       if (lat)
-        *lat += static_cast<surf::LinkImpl*>(link)->latency();
+        *lat += static_cast<resource::LinkImpl*>(link)->latency();
     }
   }
 
     }
   }
 
@@ -229,7 +229,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr
       first_gw = gw_dst;
 
     if (hierarchy_ == RoutingMode::recursive && v != dst_node_id && gw_dst->get_name() != prev_gw_src->get_name()) {
       first_gw = gw_dst;
 
     if (hierarchy_ == RoutingMode::recursive && v != dst_node_id && gw_dst->get_name() != prev_gw_src->get_name()) {
-      std::vector<surf::LinkImpl*> e_route_as_to_as;
+      std::vector<resource::LinkImpl*> e_route_as_to_as;
 
       NetPoint* gw_dst_net_elm      = nullptr;
       NetPoint* prev_gw_src_net_elm = nullptr;
 
       NetPoint* gw_dst_net_elm      = nullptr;
       NetPoint* prev_gw_src_net_elm = nullptr;
@@ -246,7 +246,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr
     for (auto const& link : e_route->link_list) {
       route->link_list.insert(route->link_list.begin(), link);
       if (lat)
     for (auto const& link : e_route->link_list) {
       route->link_list.insert(route->link_list.begin(), link);
       if (lat)
-        *lat += static_cast<surf::LinkImpl*>(link)->latency();
+        *lat += static_cast<resource::LinkImpl*>(link)->latency();
     }
   }
 
     }
   }
 
@@ -270,9 +270,8 @@ DijkstraZone::DijkstraZone(NetZone* father, std::string name, bool cached) : Rou
 {
 }
 
 {
 }
 
-void DijkstraZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
-                             kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                             std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+                             std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
 {
   const char* srcName = src->get_cname();
   const char* dstName = dst->get_cname();
 {
   const char* srcName = src->get_cname();
   const char* dstName = dst->get_cname();
index a0ada55..dbb52a3 100644 (file)
@@ -159,7 +159,8 @@ void DragonflyZone::generateRouters()
   }
 }
 
   }
 }
 
-void DragonflyZone::createLink(const std::string& id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown)
+void DragonflyZone::createLink(const std::string& id, int numlinks, resource::LinkImpl** linkup,
+                               resource::LinkImpl** linkdown)
 {
   *linkup   = nullptr;
   *linkdown = nullptr;
 {
   *linkup   = nullptr;
   *linkdown = nullptr;
@@ -170,12 +171,12 @@ void DragonflyZone::createLink(const std::string& id, int numlinks, surf::LinkIm
   linkTemplate.id        = id;
   sg_platf_new_link(&linkTemplate);
   XBT_DEBUG("Generating link %s", id.c_str());
   linkTemplate.id        = id;
   sg_platf_new_link(&linkTemplate);
   XBT_DEBUG("Generating link %s", id.c_str());
-  surf::LinkImpl* link;
+  resource::LinkImpl* link;
   if (this->sharing_policy_ == SURF_LINK_SPLITDUPLEX) {
   if (this->sharing_policy_ == SURF_LINK_SPLITDUPLEX) {
-    *linkup   = surf::LinkImpl::byName(linkTemplate.id + "_UP");   // check link?
-    *linkdown = surf::LinkImpl::byName(linkTemplate.id + "_DOWN"); // check link ?
+    *linkup   = resource::LinkImpl::byName(linkTemplate.id + "_UP");   // check link?
+    *linkdown = resource::LinkImpl::byName(linkTemplate.id + "_DOWN"); // check link ?
   } else {
   } else {
-    link      = surf::LinkImpl::byName(linkTemplate.id);
+    link      = resource::LinkImpl::byName(linkTemplate.id);
     *linkup   = link;
     *linkdown = link;
   }
     *linkup   = link;
     *linkdown = link;
   }
@@ -184,17 +185,17 @@ void DragonflyZone::createLink(const std::string& id, int numlinks, surf::LinkIm
 void DragonflyZone::generateLinks()
 {
   static int uniqueId = 0;
 void DragonflyZone::generateLinks()
 {
   static int uniqueId = 0;
-  surf::LinkImpl* linkup;
-  surf::LinkImpl* linkdown;
+  resource::LinkImpl* linkup;
+  resource::LinkImpl* linkdown;
 
   unsigned int numRouters = this->num_groups_ * this->num_chassis_per_group_ * this->num_blades_per_chassis_;
 
   // Links from routers to their local nodes.
   for (unsigned int i = 0; i < numRouters; i++) {
     // allocate structures
 
   unsigned int numRouters = this->num_groups_ * this->num_chassis_per_group_ * this->num_blades_per_chassis_;
 
   // Links from routers to their local nodes.
   for (unsigned int i = 0; i < numRouters; i++) {
     // allocate structures
-    this->routers_[i]->my_nodes_    = new surf::LinkImpl*[num_links_per_link_ * this->num_nodes_per_blade_];
-    this->routers_[i]->green_links_ = new surf::LinkImpl*[this->num_blades_per_chassis_];
-    this->routers_[i]->black_links_ = new surf::LinkImpl*[this->num_chassis_per_group_];
+    this->routers_[i]->my_nodes_    = new resource::LinkImpl*[num_links_per_link_ * this->num_nodes_per_blade_];
+    this->routers_[i]->green_links_ = new resource::LinkImpl*[this->num_blades_per_chassis_];
+    this->routers_[i]->black_links_ = new resource::LinkImpl*[this->num_chassis_per_group_];
 
     for (unsigned int j = 0; j < num_links_per_link_ * this->num_nodes_per_blade_; j += num_links_per_link_) {
       std::string id = "local_link_from_router_" + std::to_string(i) + "_to_node_" +
 
     for (unsigned int j = 0; j < num_links_per_link_ * this->num_nodes_per_blade_; j += num_links_per_link_) {
       std::string id = "local_link_from_router_" + std::to_string(i) + "_to_node_" +
@@ -250,8 +251,8 @@ void DragonflyZone::generateLinks()
     for (unsigned int j = i + 1; j < this->num_groups_; j++) {
       unsigned int routernumi                 = i * num_blades_per_chassis_ * num_chassis_per_group_ + j;
       unsigned int routernumj                 = j * num_blades_per_chassis_ * num_chassis_per_group_ + i;
     for (unsigned int j = i + 1; j < this->num_groups_; j++) {
       unsigned int routernumi                 = i * num_blades_per_chassis_ * num_chassis_per_group_ + j;
       unsigned int routernumj                 = j * num_blades_per_chassis_ * num_chassis_per_group_ + i;
-      this->routers_[routernumi]->blue_links_ = new surf::LinkImpl*;
-      this->routers_[routernumj]->blue_links_ = new surf::LinkImpl*;
+      this->routers_[routernumi]->blue_links_ = new resource::LinkImpl*;
+      this->routers_[routernumj]->blue_links_ = new resource::LinkImpl*;
       std::string id = "blue_link_between_group_"+ std::to_string(i) +"_and_" + std::to_string(j) +"_routers_" +
           std::to_string(routernumi) + "_and_" + std::to_string(routernumj) + "_" + std::to_string(uniqueId);
       this->createLink(id, this->num_links_blue_, &linkup, &linkdown);
       std::string id = "blue_link_between_group_"+ std::to_string(i) +"_and_" + std::to_string(j) +"_routers_" +
           std::to_string(routernumi) + "_and_" + std::to_string(routernumj) + "_" + std::to_string(uniqueId);
       this->createLink(id, this->num_links_blue_, &linkup, &linkdown);
@@ -275,7 +276,7 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationA
            dst->id());
 
   if ((src->id() == dst->id()) && has_loopback_) {
            dst->id());
 
   if ((src->id() == dst->id()) && has_loopback_) {
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(node_pos(src->id()));
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos(src->id()));
 
     route->link_list.push_back(info.first);
     if (latency)
 
     route->link_list.push_back(info.first);
     if (latency)
@@ -303,7 +304,7 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationA
     *latency += myRouter->my_nodes_[myCoords[3] * num_links_per_link_]->latency();
 
   if (has_limiter_) { // limiter for sender
     *latency += myRouter->my_nodes_[myCoords[3] * num_links_per_link_]->latency();
 
   if (has_limiter_) { // limiter for sender
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(node_pos_with_loopback(src->id()));
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos_with_loopback(src->id()));
     route->link_list.push_back(info.first);
   }
 
     route->link_list.push_back(info.first);
   }
 
@@ -353,7 +354,7 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationA
   }
 
   if (has_limiter_) { // limiter for receiver
   }
 
   if (has_limiter_) { // limiter for receiver
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(node_pos_with_loopback(dst->id()));
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos_with_loopback(dst->id()));
     route->link_list.push_back(info.first);
   }
 
     route->link_list.push_back(info.first);
   }
 
index 0884942..f2fa5dc 100644 (file)
@@ -450,7 +450,7 @@ FatTreeNode::FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int po
     linkTemplate.policy    = SURF_LINK_SHARED;
     linkTemplate.id        = "limiter_"+std::to_string(id);
     sg_platf_new_link(&linkTemplate);
     linkTemplate.policy    = SURF_LINK_SHARED;
     linkTemplate.id        = "limiter_"+std::to_string(id);
     sg_platf_new_link(&linkTemplate);
-    this->limiter_link_ = surf::LinkImpl::byName(linkTemplate.id);
+    this->limiter_link_ = resource::LinkImpl::byName(linkTemplate.id);
   }
   if (cluster->loopback_bw || cluster->loopback_lat) {
     linkTemplate.bandwidth = cluster->loopback_bw;
   }
   if (cluster->loopback_bw || cluster->loopback_lat) {
     linkTemplate.bandwidth = cluster->loopback_bw;
@@ -458,7 +458,7 @@ FatTreeNode::FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int po
     linkTemplate.policy    = SURF_LINK_FATPIPE;
     linkTemplate.id        = "loopback_"+ std::to_string(id);
     sg_platf_new_link(&linkTemplate);
     linkTemplate.policy    = SURF_LINK_FATPIPE;
     linkTemplate.id        = "loopback_"+ std::to_string(id);
     sg_platf_new_link(&linkTemplate);
-    this->loopback = surf::LinkImpl::byName(linkTemplate.id);
+    this->loopback = resource::LinkImpl::byName(linkTemplate.id);
   }
 }
 
   }
 }
 
@@ -476,11 +476,11 @@ FatTreeLink::FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* downNode, Fa
 
   if (cluster->sharing_policy == SURF_LINK_SPLITDUPLEX) {
     std::string tmpID = std::string(linkTemplate.id) + "_UP";
 
   if (cluster->sharing_policy == SURF_LINK_SPLITDUPLEX) {
     std::string tmpID = std::string(linkTemplate.id) + "_UP";
-    this->up_link_    = surf::LinkImpl::byName(tmpID); // check link?
+    this->up_link_    = resource::LinkImpl::byName(tmpID); // check link?
     tmpID          = std::string(linkTemplate.id) + "_DOWN";
     tmpID          = std::string(linkTemplate.id) + "_DOWN";
-    this->down_link_  = surf::LinkImpl::byName(tmpID); // check link ?
+    this->down_link_  = resource::LinkImpl::byName(tmpID); // check link ?
   } else {
   } else {
-    this->up_link_   = surf::LinkImpl::byName(linkTemplate.id);
+    this->up_link_   = resource::LinkImpl::byName(linkTemplate.id);
     this->down_link_ = this->up_link_;
   }
   uniqueId++;
     this->down_link_ = this->up_link_;
   }
   uniqueId++;
index f702344..40e85f3 100644 (file)
@@ -86,7 +86,7 @@ void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
 }
 
 void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
 }
 
 void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                          std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+                          std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
 {
   /* set the size of table routing */
   unsigned int table_size = getTableSize();
 {
   /* set the size of table routing */
   unsigned int table_size = getTableSize();
index 208d937..b0c87c0 100644 (file)
@@ -71,9 +71,8 @@ void FullZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
   }
 }
 
   }
 }
 
-void FullZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
-                         kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                         std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+                         std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
 {
   addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical);
 
 {
   addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical);
 
index 7e9aa1d..240309e 100644 (file)
@@ -23,7 +23,7 @@ public:
   explicit BypassRoute(NetPoint* gwSrc, NetPoint* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
   NetPoint* gw_src;
   NetPoint* gw_dst;
   explicit BypassRoute(NetPoint* gwSrc, NetPoint* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
   NetPoint* gw_src;
   NetPoint* gw_dst;
-  std::vector<surf::LinkImpl*> links;
+  std::vector<resource::LinkImpl*> links;
 };
 
 NetZoneImpl::NetZoneImpl(NetZone* father, std::string name) : NetZone(father, name)
 };
 
 NetZoneImpl::NetZoneImpl(NetZone* father, std::string name) : NetZone(father, name)
@@ -65,7 +65,7 @@ simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, std::vector<doubl
 }
 
 void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
 }
 
 void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                                   std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+                                   std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
 {
   /* Argument validity checks */
   if (gw_dst) {
 {
   /* Argument validity checks */
   if (gw_dst) {
@@ -204,7 +204,7 @@ static void find_common_ancestors(NetPoint* src, NetPoint* dst,
 
 /* PRECONDITION: this is the common ancestor of src and dst */
 bool NetZoneImpl::get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
 
 /* PRECONDITION: this is the common ancestor of src and dst */
 bool NetZoneImpl::get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
-                                   /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
+                                   /* OUT */ std::vector<resource::LinkImpl*>& links, double* latency)
 {
   // If never set a bypass route return nullptr without any further computations
   if (bypass_routes_.empty())
 {
   // If never set a bypass route return nullptr without any further computations
   if (bypass_routes_.empty())
@@ -214,7 +214,7 @@ bool NetZoneImpl::get_bypass_route(routing::NetPoint* src, routing::NetPoint* ds
   if (dst->get_englobing_zone() == this && src->get_englobing_zone() == this) {
     if (bypass_routes_.find({src, dst}) != bypass_routes_.end()) {
       BypassRoute* bypassedRoute = bypass_routes_.at({src, dst});
   if (dst->get_englobing_zone() == this && src->get_englobing_zone() == this) {
     if (bypass_routes_.find({src, dst}) != bypass_routes_.end()) {
       BypassRoute* bypassedRoute = bypass_routes_.at({src, dst});
-      for (surf::LinkImpl* const& link : bypassedRoute->links) {
+      for (resource::LinkImpl* const& link : bypassedRoute->links) {
         links.push_back(link);
         if (latency)
           *latency += link->latency();
         links.push_back(link);
         if (latency)
           *latency += link->latency();
@@ -298,7 +298,7 @@ bool NetZoneImpl::get_bypass_route(routing::NetPoint* src, routing::NetPoint* ds
               src->get_cname(), dst->get_cname(), bypassedRoute->links.size());
     if (src != key.first)
       get_global_route(src, bypassedRoute->gw_src, links, latency);
               src->get_cname(), dst->get_cname(), bypassedRoute->links.size());
     if (src != key.first)
       get_global_route(src, bypassedRoute->gw_src, links, latency);
-    for (surf::LinkImpl* const& link : bypassedRoute->links) {
+    for (resource::LinkImpl* const& link : bypassedRoute->links) {
       links.push_back(link);
       if (latency)
         *latency += link->latency();
       links.push_back(link);
       if (latency)
         *latency += link->latency();
@@ -311,8 +311,8 @@ bool NetZoneImpl::get_bypass_route(routing::NetPoint* src, routing::NetPoint* ds
   return false;
 }
 
   return false;
 }
 
-void NetZoneImpl::get_global_route(routing::NetPoint* src, routing::NetPoint* dst,
-                                   /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
+void NetZoneImpl::get_global_route(NetPoint* src, NetPoint* dst,
+                                   /* OUT */ std::vector<resource::LinkImpl*>& links, double* latency)
 {
   RouteCreationArgs route;
 
 {
   RouteCreationArgs route;
 
index d61f453..249320a 100644 (file)
@@ -121,7 +121,7 @@ void RoutedZone::get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>*
 /* ************************* GENERIC AUX FUNCTIONS ************************** */
 /* change a route containing link names into a route containing link entities */
 RouteCreationArgs* RoutedZone::newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
 /* ************************* GENERIC AUX FUNCTIONS ************************** */
 /* change a route containing link names into a route containing link entities */
 RouteCreationArgs* RoutedZone::newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
-                                                NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
+                                                NetPoint* gw_dst, std::vector<resource::LinkImpl*>& link_list,
                                                 bool symmetrical, bool change_order)
 {
   RouteCreationArgs* result = new RouteCreationArgs();
                                                 bool symmetrical, bool change_order)
 {
   RouteCreationArgs* result = new RouteCreationArgs();
@@ -164,9 +164,8 @@ void RoutedZone::getRouteCheckParams(NetPoint* src, NetPoint* dst)
              "%s@%s). Please report that bug.",
              src->get_cname(), dst->get_cname(), src_as->get_cname(), dst_as->get_cname(), get_cname());
 }
              "%s@%s). Please report that bug.",
              src->get_cname(), dst->get_cname(), src_as->get_cname(), dst_as->get_cname(), get_cname());
 }
-void RoutedZone::addRouteCheckParams(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
-                                     kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                                     std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+void RoutedZone::addRouteCheckParams(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+                                     std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
 {
   const char* srcName = src->get_cname();
   const char* dstName = dst->get_cname();
 {
   const char* srcName = src->get_cname();
   const char* dstName = dst->get_cname();
index e2041cd..c65d9a7 100644 (file)
@@ -54,15 +54,15 @@ void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int
     link.latency   = cluster->lat;
     link.policy    = cluster->sharing_policy;
     sg_platf_new_link(&link);
     link.latency   = cluster->lat;
     link.policy    = cluster->sharing_policy;
     sg_platf_new_link(&link);
-    surf::LinkImpl* linkUp;
-    surf::LinkImpl* linkDown;
+    resource::LinkImpl* linkUp;
+    resource::LinkImpl* linkDown;
     if (link.policy == SURF_LINK_SPLITDUPLEX) {
       std::string tmp_link = link_id + "_UP";
     if (link.policy == SURF_LINK_SPLITDUPLEX) {
       std::string tmp_link = link_id + "_UP";
-      linkUp         = surf::LinkImpl::byName(tmp_link);
+      linkUp               = resource::LinkImpl::byName(tmp_link);
       tmp_link             = link_id + "_DOWN";
       tmp_link             = link_id + "_DOWN";
-      linkDown = surf::LinkImpl::byName(tmp_link);
+      linkDown             = resource::LinkImpl::byName(tmp_link);
     } else {
     } else {
-      linkUp   = surf::LinkImpl::byName(link_id);
+      linkUp   = resource::LinkImpl::byName(link_id);
       linkDown = linkUp;
     }
     /*
       linkDown = linkUp;
     }
     /*
@@ -102,7 +102,7 @@ void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
     return;
 
   if (src->id() == dst->id() && has_loopback_) {
     return;
 
   if (src->id() == dst->id() && has_loopback_) {
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(src->id() * num_links_per_node_);
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(src->id() * num_links_per_node_);
 
     route->link_list.push_back(info.first);
     if (lat)
 
     route->link_list.push_back(info.first);
     if (lat)
@@ -177,7 +177,7 @@ void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
       dim_product *= cur_dim;
     }
 
       dim_product *= cur_dim;
     }
 
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info;
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info;
 
     if (has_limiter_) { // limiter for sender
       info = private_links_.at(nodeOffset + (has_loopback_ ? 1 : 0));
 
     if (has_limiter_) { // limiter for sender
       info = private_links_.at(nodeOffset + (has_loopback_ ? 1 : 0));
index 70c2b08..56cc29e 100644 (file)
@@ -72,8 +72,8 @@ void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, s
 
   std::string link_up      = "link_" + netpoint->get_name() + "_UP";
   std::string link_down    = "link_" + netpoint->get_name() + "_DOWN";
 
   std::string link_up      = "link_" + netpoint->get_name() + "_UP";
   std::string link_down    = "link_" + netpoint->get_name() + "_DOWN";
-  surf::LinkImpl* linkUp   = surf_network_model->createLink(link_up, bw_out, 0, SURF_LINK_SHARED);
-  surf::LinkImpl* linkDown = surf_network_model->createLink(link_down, bw_in, 0, SURF_LINK_SHARED);
+  resource::LinkImpl* linkUp   = surf_network_model->createLink(link_up, bw_out, 0, SURF_LINK_SHARED);
+  resource::LinkImpl* linkDown = surf_network_model->createLink(link_down, bw_in, 0, SURF_LINK_SHARED);
   private_links_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
   private_links_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
@@ -91,7 +91,7 @@ void VivaldiZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
   /* Retrieve the private links */
   auto src_link = private_links_.find(src->id());
   if (src_link != private_links_.end()) {
   /* Retrieve the private links */
   auto src_link = private_links_.find(src->id());
   if (src_link != private_links_.end()) {
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = src_link->second;
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info = src_link->second;
     if (info.first) {
       route->link_list.push_back(info.first);
       if (lat)
     if (info.first) {
       route->link_list.push_back(info.first);
       if (lat)
@@ -103,7 +103,7 @@ void VivaldiZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
 
   auto dst_link = private_links_.find(dst->id());
   if (dst_link != private_links_.end()) {
 
   auto dst_link = private_links_.find(dst->id());
   if (dst_link != private_links_.end()) {
-    std::pair<surf::LinkImpl*, surf::LinkImpl*> info = dst_link->second;
+    std::pair<resource::LinkImpl*, resource::LinkImpl*> info = dst_link->second;
     if (info.second) {
       route->link_list.push_back(info.second);
       if (lat)
     if (info.second) {
       route->link_list.push_back(info.second);
       if (lat)
index c2bb1b6..ba75301 100644 (file)
@@ -158,7 +158,7 @@ void Engine::delStorage(std::string name)
 /** @brief Returns the amount of links in the platform */
 size_t Engine::getLinkCount()
 {
 /** @brief Returns the amount of links in the platform */
 size_t Engine::getLinkCount()
 {
-  return simgrid::surf::LinkImpl::linksCount();
+  return kernel::resource::LinkImpl::linksCount();
 }
 
 /** @brief Fills the passed list with all links found in the platform
 }
 
 /** @brief Fills the passed list with all links found in the platform
@@ -167,14 +167,14 @@ size_t Engine::getLinkCount()
 void XBT_ATTRIB_DEPRECATED_v322("Engine::getLinkList() is deprecated in favor of Engine::getAllLinks(). Please switch before v3.22")
 Engine::getLinkList(std::vector<Link*>* list)
 {
 void XBT_ATTRIB_DEPRECATED_v322("Engine::getLinkList() is deprecated in favor of Engine::getAllLinks(). Please switch before v3.22")
 Engine::getLinkList(std::vector<Link*>* list)
 {
-  simgrid::surf::LinkImpl::linksList(list);
+  kernel::resource::LinkImpl::linksList(list);
 }
 
 /** @brief Returns the list of all links found in the platform */
 std::vector<Link*> Engine::getAllLinks()
 {
   std::vector<Link*> res;
 }
 
 /** @brief Returns the list of all links found in the platform */
 std::vector<Link*> Engine::getAllLinks()
 {
   std::vector<Link*> res;
-  simgrid::surf::LinkImpl::linksList(&res);
+  kernel::resource::LinkImpl::linksList(&res);
   return res;
 }
 
   return res;
 }
 
index 481c10a..42b8791 100644 (file)
@@ -143,14 +143,14 @@ void Host::actorList(std::vector<ActorPtr>* whereto)
  */
 void Host::routeTo(Host* dest, std::vector<Link*>& links, double* latency)
 {
  */
 void Host::routeTo(Host* dest, std::vector<Link*>& links, double* latency)
 {
-  std::vector<surf::LinkImpl*> linkImpls;
+  std::vector<kernel::resource::LinkImpl*> linkImpls;
   this->routeTo(dest, linkImpls, latency);
   this->routeTo(dest, linkImpls, latency);
-  for (surf::LinkImpl* const& l : linkImpls)
+  for (kernel::resource::LinkImpl* const& l : linkImpls)
     links.push_back(&l->piface_);
 }
 
 /** @brief Just like Host::routeTo, but filling an array of link implementations */
     links.push_back(&l->piface_);
 }
 
 /** @brief Just like Host::routeTo, but filling an array of link implementations */
-void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>& links, double* latency)
+void Host::routeTo(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency)
 {
   simgrid::kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
   if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
 {
   simgrid::kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
   if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
index d9a5089..031f57d 100644 (file)
@@ -49,11 +49,11 @@ void sg_link_data_set(sg_link_t link, void* data)
 }
 int sg_link_count()
 {
 }
 int sg_link_count()
 {
-  return simgrid::surf::LinkImpl::linksCount();
+  return simgrid::kernel::resource::LinkImpl::linksCount();
 }
 sg_link_t* sg_link_list()
 {
 }
 sg_link_t* sg_link_list()
 {
-  simgrid::surf::LinkImpl** list = simgrid::surf::LinkImpl::linksList();
+  simgrid::kernel::resource::LinkImpl** list = simgrid::kernel::resource::LinkImpl::linksList();
   sg_link_t* res                 = (sg_link_t*)list; // Use the same memory area
 
   int size = sg_link_count();
   sg_link_t* res                 = (sg_link_t*)list; // Use the same memory area
 
   int size = sg_link_count();
@@ -64,7 +64,7 @@ sg_link_t* sg_link_list()
 }
 void sg_link_exit()
 {
 }
 void sg_link_exit()
 {
-  simgrid::surf::LinkImpl::linksExit();
+  simgrid::kernel::resource::LinkImpl::linksExit();
 }
 
 /***********
 }
 
 /***********
@@ -75,7 +75,7 @@ namespace simgrid {
 namespace s4u {
 Link* Link::byName(const char* name)
 {
 namespace s4u {
 Link* Link::byName(const char* name)
 {
-  surf::LinkImpl* res = surf::LinkImpl::byName(name);
+  kernel::resource::LinkImpl* res = kernel::resource::LinkImpl::byName(name);
   if (res == nullptr)
     return nullptr;
   return &res->piface_;
   if (res == nullptr)
     return nullptr;
   return &res->piface_;
@@ -171,7 +171,7 @@ void Link::setProperty(std::string key, std::string value)
 simgrid::xbt::signal<void(s4u::Link&)> Link::onCreation;
 simgrid::xbt::signal<void(s4u::Link&)> Link::onDestruction;
 simgrid::xbt::signal<void(s4u::Link&)> Link::onStateChange;
 simgrid::xbt::signal<void(s4u::Link&)> Link::onCreation;
 simgrid::xbt::signal<void(s4u::Link&)> Link::onDestruction;
 simgrid::xbt::signal<void(s4u::Link&)> Link::onStateChange;
-simgrid::xbt::signal<void(surf::NetworkAction*, s4u::Host* src, s4u::Host* dst)> Link::onCommunicate;
-simgrid::xbt::signal<void(surf::NetworkAction*)> Link::onCommunicationStateChange;
+simgrid::xbt::signal<void(kernel::resource::NetworkAction*, s4u::Host* src, s4u::Host* dst)> Link::onCommunicate;
+simgrid::xbt::signal<void(kernel::resource::NetworkAction*)> Link::onCommunicationStateChange;
 }
 }
 }
 }
index 03ba50e..5588961 100644 (file)
@@ -16,7 +16,7 @@ namespace s4u {
 
 simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                           kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
 
 simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                           kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
-                          std::vector<surf::LinkImpl*>& link_list)>
+                          std::vector<kernel::resource::LinkImpl*>& link_list)>
     NetZone::onRouteCreation;
 simgrid::xbt::signal<void(NetZone&)> NetZone::onCreation;
 simgrid::xbt::signal<void(NetZone&)> NetZone::onSeal;
     NetZone::onRouteCreation;
 simgrid::xbt::signal<void(NetZone&)> NetZone::onCreation;
 simgrid::xbt::signal<void(NetZone&)> NetZone::onSeal;
@@ -103,7 +103,7 @@ int NetZone::addComponent(kernel::routing::NetPoint* elm)
 
 void NetZone::add_route(kernel::routing::NetPoint* /*src*/, kernel::routing::NetPoint* /*dst*/,
                         kernel::routing::NetPoint* /*gw_src*/, kernel::routing::NetPoint* /*gw_dst*/,
 
 void NetZone::add_route(kernel::routing::NetPoint* /*src*/, kernel::routing::NetPoint* /*dst*/,
                         kernel::routing::NetPoint* /*gw_src*/, kernel::routing::NetPoint* /*gw_dst*/,
-                        std::vector<simgrid::surf::LinkImpl*>& /*link_list*/, bool /*symmetrical*/)
+                        std::vector<kernel::resource::LinkImpl*>& /*link_list*/, bool /*symmetrical*/)
 {
   xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_.c_str());
 }
 {
   xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_.c_str());
 }
index 27b98cb..035ca86 100644 (file)
@@ -35,7 +35,7 @@ void surf_network_model_init_LegrandVelho()
   if (surf_network_model)
     return;
 
   if (surf_network_model)
     return;
 
-  surf_network_model = new simgrid::surf::NetworkCm02Model();
+  surf_network_model = new simgrid::kernel::resource::NetworkCm02Model();
   all_existing_models->push_back(surf_network_model);
 
   xbt_cfg_setdefault_double("network/latency-factor",      13.01);
   all_existing_models->push_back(surf_network_model);
 
   xbt_cfg_setdefault_double("network/latency-factor",      13.01);
@@ -64,7 +64,7 @@ void surf_network_model_init_CM02()
   xbt_cfg_setdefault_double("network/bandwidth-factor", 1.0);
   xbt_cfg_setdefault_double("network/weight-S",         0.0);
 
   xbt_cfg_setdefault_double("network/bandwidth-factor", 1.0);
   xbt_cfg_setdefault_double("network/weight-S",         0.0);
 
-  surf_network_model = new simgrid::surf::NetworkCm02Model();
+  surf_network_model = new simgrid::kernel::resource::NetworkCm02Model();
   all_existing_models->push_back(surf_network_model);
 }
 
   all_existing_models->push_back(surf_network_model);
 }
 
@@ -90,7 +90,7 @@ void surf_network_model_init_Reno()
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
-  surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
+  surf_network_model = new simgrid::kernel::resource::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
   all_existing_models->push_back(surf_network_model);
 }
 
   all_existing_models->push_back(surf_network_model);
 }
 
@@ -107,7 +107,7 @@ void surf_network_model_init_Reno2()
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
-  surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
+  surf_network_model = new simgrid::kernel::resource::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
   all_existing_models->push_back(surf_network_model);
 }
 
   all_existing_models->push_back(surf_network_model);
 }
 
@@ -123,16 +123,16 @@ void surf_network_model_init_Vegas()
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
   xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97);
   xbt_cfg_setdefault_double("network/weight-S", 20537);
 
-  surf_network_model = new simgrid::surf::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
+  surf_network_model = new simgrid::kernel::resource::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
   all_existing_models->push_back(surf_network_model);
 }
 
 namespace simgrid {
   all_existing_models->push_back(surf_network_model);
 }
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(bool))
 
 NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(bool))
-    : NetworkModel(xbt_cfg_get_string("network/optim") == "Full" ? kernel::resource::Model::UpdateAlgo::Full
-                                                                 : kernel::resource::Model::UpdateAlgo::Lazy)
+    : NetworkModel(xbt_cfg_get_string("network/optim") == "Full" ? Model::UpdateAlgo::Full : Model::UpdateAlgo::Lazy)
 {
   std::string optim = xbt_cfg_get_string("network/optim");
   bool select = xbt_cfg_get_boolean("network/maxmin-selective-update");
 {
   std::string optim = xbt_cfg_get_string("network/optim");
   bool select = xbt_cfg_get_boolean("network/maxmin-selective-update");
@@ -172,19 +172,18 @@ void NetworkCm02Model::update_actions_state_lazy(double now, double /*delta*/)
     }
 
     // if I am wearing a latency hat
     }
 
     // if I am wearing a latency hat
-    if (action->get_type() == kernel::resource::ActionHeap::Type::latency) {
+    if (action->get_type() == ActionHeap::Type::latency) {
       XBT_DEBUG("Latency paid for action %p. Activating", action);
       get_maxmin_system()->update_variable_weight(action->get_variable(), action->weight_);
       get_action_heap().remove(action);
       action->set_last_update();
 
       // if I am wearing a max_duration or normal hat
       XBT_DEBUG("Latency paid for action %p. Activating", action);
       get_maxmin_system()->update_variable_weight(action->get_variable(), action->weight_);
       get_action_heap().remove(action);
       action->set_last_update();
 
       // if I am wearing a max_duration or normal hat
-    } else if (action->get_type() == kernel::resource::ActionHeap::Type::max_duration ||
-               action->get_type() == kernel::resource::ActionHeap::Type::normal) {
+    } else if (action->get_type() == ActionHeap::Type::max_duration || action->get_type() == ActionHeap::Type::normal) {
       // no need to communicate anymore
       // assume that flows that reached max_duration have remaining of 0
       XBT_DEBUG("Action %p finished", action);
       // no need to communicate anymore
       // assume that flows that reached max_duration have remaining of 0
       XBT_DEBUG("Action %p finished", action);
-      action->finish(kernel::resource::Action::State::done);
+      action->finish(Action::State::done);
       get_action_heap().remove(action);
     }
   }
       get_action_heap().remove(action);
     }
   }
@@ -232,12 +231,12 @@ void NetworkCm02Model::update_actions_state_full(double now, double delta)
 
     if (((action.get_remains() <= 0) && (action.get_variable()->get_weight() > 0)) ||
         ((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
 
     if (((action.get_remains() <= 0) && (action.get_variable()->get_weight() > 0)) ||
         ((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
-      action.finish(kernel::resource::Action::State::done);
+      action.finish(Action::State::done);
     }
   }
 }
 
     }
   }
 }
 
-kernel::resource::Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
+Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
 {
   int failed = 0;
   double latency = 0.0;
 {
   int failed = 0;
   double latency = 0.0;
@@ -266,7 +265,7 @@ kernel::resource::Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Hos
   action->weight_ = latency;
   action->latency_ = latency;
   action->rate_ = rate;
   action->weight_ = latency;
   action->latency_ = latency;
   action->rate_ = rate;
-  if (get_update_algorithm() == kernel::resource::Model::UpdateAlgo::Lazy) {
+  if (get_update_algorithm() == Model::UpdateAlgo::Lazy) {
     action->set_last_update();
   }
 
     action->set_last_update();
   }
 
@@ -289,14 +288,14 @@ kernel::resource::Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Hos
 
   if (action->latency_ > 0) {
     action->set_variable(get_maxmin_system()->variable_new(action, 0.0, -1.0, constraints_per_variable));
 
   if (action->latency_ > 0) {
     action->set_variable(get_maxmin_system()->variable_new(action, 0.0, -1.0, constraints_per_variable));
-    if (get_update_algorithm() == kernel::resource::Model::UpdateAlgo::Lazy) {
+    if (get_update_algorithm() == Model::UpdateAlgo::Lazy) {
       // add to the heap the event when the latency is payed
       double date = action->latency_ + action->get_last_update();
       // add to the heap the event when the latency is payed
       double date = action->latency_ + action->get_last_update();
-      kernel::resource::ActionHeap::Type type;
+      ActionHeap::Type type;
       if (route.empty())
       if (route.empty())
-        type = kernel::resource::ActionHeap::Type::normal;
+        type = ActionHeap::Type::normal;
       else
       else
-        type = kernel::resource::ActionHeap::Type::latency;
+        type = ActionHeap::Type::latency;
 
       XBT_DEBUG("Added action (%p) one latency event at date %f", action, date);
       get_action_heap().insert(action, date, type);
 
       XBT_DEBUG("Added action (%p) one latency event at date %f", action, date);
       get_action_heap().insert(action, date, type);
@@ -372,12 +371,11 @@ void NetworkCm02Link::apply_event(tmgr_trace_event_t triggered, double value)
 
       turn_off();
       while ((var = get_constraint()->get_variable(&elem))) {
 
       turn_off();
       while ((var = get_constraint()->get_variable(&elem))) {
-        kernel::resource::Action* action = static_cast<kernel::resource::Action*>(var->get_id());
+        Action* action = static_cast<Action*>(var->get_id());
 
 
-        if (action->get_state() == kernel::resource::Action::State::running ||
-            action->get_state() == kernel::resource::Action::State::ready) {
+        if (action->get_state() == Action::State::running || action->get_state() == Action::State::ready) {
           action->set_finish_time(now);
           action->set_finish_time(now);
-          action->set_state(kernel::resource::Action::State::failed);
+          action->set_state(Action::State::failed);
         }
       }
     }
         }
       }
     }
@@ -484,3 +482,4 @@ void NetworkCm02Action::update_remains_lazy(double now)
 
 }
 }
 
 }
 }
+} // namespace simgrid
index 689ba92..2860c7c 100644 (file)
  ***********/
 
 namespace simgrid {
  ***********/
 
 namespace simgrid {
-  namespace surf {
+namespace kernel {
+namespace resource {
 
 
-    class XBT_PRIVATE NetworkCm02Model;
-    class XBT_PRIVATE NetworkCm02Action;
-    class XBT_PRIVATE NetworkSmpiModel;
-
-  }
-}
+class XBT_PRIVATE NetworkCm02Model;
+class XBT_PRIVATE NetworkCm02Action;
+class XBT_PRIVATE NetworkSmpiModel;
 
 /*********
  * Model *
  *********/
 
 
 /*********
  * Model *
  *********/
 
-namespace simgrid {
-namespace surf {
-
 class NetworkCm02Model : public NetworkModel {
 public:
 class NetworkCm02Model : public NetworkModel {
 public:
-  explicit NetworkCm02Model(kernel::lmm::System* (*make_new_sys)(bool) = &simgrid::kernel::lmm::make_new_maxmin_system);
+  explicit NetworkCm02Model(lmm::System* (*make_new_sys)(bool) = &lmm::make_new_maxmin_system);
   virtual ~NetworkCm02Model() = default;
   LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
                        e_surf_link_sharing_policy_t policy) override;
   void update_actions_state_lazy(double now, double delta) override;
   void update_actions_state_full(double now, double delta) override;
   virtual ~NetworkCm02Model() = default;
   LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
                        e_surf_link_sharing_policy_t policy) override;
   void update_actions_state_lazy(double now, double delta) override;
   void update_actions_state_full(double now, double delta) override;
-  kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
+  Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
 };
 
 /************
 };
 
 /************
@@ -51,7 +46,7 @@ public:
 class NetworkCm02Link : public LinkImpl {
 public:
   NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
 class NetworkCm02Link : public LinkImpl {
 public:
   NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
-                  e_surf_link_sharing_policy_t policy, kernel::lmm::System* system);
+                  e_surf_link_sharing_policy_t policy, lmm::System* system);
   virtual ~NetworkCm02Link() = default;
   void apply_event(tmgr_trace_event_t event, double value) override;
   void setBandwidth(double value) override;
   virtual ~NetworkCm02Link() = default;
   void apply_event(tmgr_trace_event_t event, double value) override;
   void setBandwidth(double value) override;
@@ -66,11 +61,11 @@ class NetworkCm02Action : public NetworkAction {
   friend NetworkSmpiModel;
 
 public:
   friend NetworkSmpiModel;
 
 public:
-  NetworkCm02Action(kernel::resource::Model* model, double cost, bool failed) : NetworkAction(model, cost, failed){};
+  NetworkCm02Action(Model* model, double cost, bool failed) : NetworkAction(model, cost, failed){};
   virtual ~NetworkCm02Action() = default;
   void update_remains_lazy(double now) override;
 };
 }
 }
   virtual ~NetworkCm02Action() = default;
   void update_remains_lazy(double now) override;
 };
 }
 }
-
+} // namespace simgrid
 #endif /* SURF_NETWORK_CM02_HPP_ */
 #endif /* SURF_NETWORK_CM02_HPP_ */
index 4c0bd88..be5f87c 100644 (file)
@@ -15,12 +15,13 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 void surf_network_model_init_Constant()
 {
   xbt_assert(surf_network_model == nullptr);
 void surf_network_model_init_Constant()
 {
   xbt_assert(surf_network_model == nullptr);
-  surf_network_model = new simgrid::surf::NetworkConstantModel();
+  surf_network_model = new simgrid::kernel::resource::NetworkConstantModel();
   all_existing_models->push_back(surf_network_model);
 }
 
 namespace simgrid {
   all_existing_models->push_back(surf_network_model);
 }
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 LinkImpl* NetworkConstantModel::createLink(const std::string& name, double bw, double lat,
                                            e_surf_link_sharing_policy_t policy)
 {
 LinkImpl* NetworkConstantModel::createLink(const std::string& name, double bw, double lat,
                                            e_surf_link_sharing_policy_t policy)
 {
@@ -91,4 +92,5 @@ void NetworkConstantAction::update_remains_lazy(double /*now*/)
   THROW_IMPOSSIBLE;
 }
 }
   THROW_IMPOSSIBLE;
 }
 }
+} // namespace kernel
 }
 }
index 151b2d0..c2219d9 100644 (file)
 #include "network_interface.hpp"
 
 namespace simgrid {
 #include "network_interface.hpp"
 
 namespace simgrid {
-  namespace surf {
-
-    /***********
-     * Classes *
-     ***********/
-
-    class XBT_PRIVATE NetworkConstantModel;
-    class XBT_PRIVATE NetworkConstantAction;
-
-    /*********
-     * Model *
-     *********/
-    class NetworkConstantModel : public NetworkModel {
-    public:
-      NetworkConstantModel() : NetworkModel(Model::UpdateAlgo::Full) {}
-      kernel::resource::Action* communicate(simgrid::s4u::Host* src, simgrid::s4u::Host* dst, double size,
-                                            double rate) override;
-      double next_occuring_event(double now) override;
-      void update_actions_state(double now, double delta) override;
-
-      LinkImpl* createLink(const std::string& name, double bw, double lat,
-                           e_surf_link_sharing_policy_t policy) override;
+namespace kernel {
+namespace resource {
+
+/***********
+ * Classes *
+ ***********/
+
+class XBT_PRIVATE NetworkConstantModel;
+class XBT_PRIVATE NetworkConstantAction;
+
+/*********
+ * Model *
+ *********/
+class NetworkConstantModel : public NetworkModel {
+public:
+  NetworkConstantModel() : NetworkModel(Model::UpdateAlgo::Full) {}
+  Action* communicate(simgrid::s4u::Host* src, simgrid::s4u::Host* dst, double size, double rate) override;
+  double next_occuring_event(double now) override;
+  void update_actions_state(double now, double delta) override;
+
+  LinkImpl* createLink(const std::string& name, double bw, double lat, e_surf_link_sharing_policy_t policy) override;
     };
 
     /**********
     };
 
     /**********
@@ -48,5 +47,6 @@ namespace simgrid {
 
   }
 }
 
   }
 }
+} // namespace simgrid
 
 #endif /* NETWORK_CONSTANT_HPP_ */
 
 #endif /* NETWORK_CONSTANT_HPP_ */
index ee9d50e..bbba768 100644 (file)
@@ -15,8 +15,8 @@
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
 static void IB_create_host_callback(simgrid::s4u::Host& host){
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
 static void IB_create_host_callback(simgrid::s4u::Host& host){
-  using simgrid::surf::NetworkIBModel;
-  using simgrid::surf::IBNode;
+  using simgrid::kernel::resource::IBNode;
+  using simgrid::kernel::resource::NetworkIBModel;
 
   static int id=0;
   // pour t->id -> rajouter une nouvelle struct dans le dict, pour stocker les comms actives
 
   static int id=0;
   // pour t->id -> rajouter une nouvelle struct dans le dict, pour stocker les comms actives
@@ -27,10 +27,10 @@ static void IB_create_host_callback(simgrid::s4u::Host& host){
   ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.get_name(), act});
 }
 
   ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.get_name(), act});
 }
 
-static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* action)
+static void IB_action_state_changed_callback(simgrid::kernel::resource::NetworkAction* action)
 {
 {
-  using simgrid::surf::NetworkIBModel;
-  using simgrid::surf::IBNode;
+  using simgrid::kernel::resource::IBNode;
+  using simgrid::kernel::resource::NetworkIBModel;
 
   if (action->get_state() != simgrid::kernel::resource::Action::State::done)
     return;
 
   if (action->get_state() != simgrid::kernel::resource::Action::State::done)
     return;
@@ -43,12 +43,12 @@ static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* actio
 
 }
 
 
 }
 
-static void IB_action_init_callback(simgrid::surf::NetworkAction* action, simgrid::s4u::Host* src,
+static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction* action, simgrid::s4u::Host* src,
                                     simgrid::s4u::Host* dst)
 {
                                     simgrid::s4u::Host* dst)
 {
-  simgrid::surf::NetworkIBModel* ibModel = (simgrid::surf::NetworkIBModel*)surf_network_model;
-  simgrid::surf::IBNode* act_src;
-  simgrid::surf::IBNode* act_dst;
+  simgrid::kernel::resource::NetworkIBModel* ibModel = (simgrid::kernel::resource::NetworkIBModel*)surf_network_model;
+  simgrid::kernel::resource::IBNode* act_src;
+  simgrid::kernel::resource::IBNode* act_dst;
 
   auto asrc = ibModel->active_nodes.find(src->get_name());
   if (asrc != ibModel->active_nodes.end()) {
 
   auto asrc = ibModel->active_nodes.find(src->get_name());
   if (asrc != ibModel->active_nodes.end()) {
@@ -88,7 +88,7 @@ void surf_network_model_init_IB()
   if (surf_network_model)
     return;
 
   if (surf_network_model)
     return;
 
-  surf_network_model = new simgrid::surf::NetworkIBModel();
+  surf_network_model = new simgrid::kernel::resource::NetworkIBModel();
   all_existing_models->push_back(surf_network_model);
   simgrid::s4u::Link::onCommunicationStateChange.connect(IB_action_state_changed_callback);
   simgrid::s4u::Link::onCommunicate.connect(IB_action_init_callback);
   all_existing_models->push_back(surf_network_model);
   simgrid::s4u::Link::onCommunicationStateChange.connect(IB_action_state_changed_callback);
   simgrid::s4u::Link::onCommunicate.connect(IB_action_init_callback);
@@ -98,7 +98,8 @@ void surf_network_model_init_IB()
 }
 
 namespace simgrid {
 }
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 NetworkIBModel::NetworkIBModel() : NetworkSmpiModel()
 {
 
 NetworkIBModel::NetworkIBModel() : NetworkSmpiModel()
 {
@@ -237,3 +238,4 @@ void NetworkIBModel::updateIBfactors(NetworkAction* action, IBNode* from, IBNode
 }
 }
 }
 }
 }
 }
+} // namespace simgrid
index df41a88..960f241 100644 (file)
 #include <vector>
 
 namespace simgrid {
 #include <vector>
 
 namespace simgrid {
-  namespace surf {
+namespace kernel {
+namespace resource {
 
 
-    class XBT_PRIVATE IBNode;
+class XBT_PRIVATE IBNode;
 
 
-    class XBT_PRIVATE ActiveComm{
-    public :
-      //IBNode* origin;
-      IBNode* destination;
-      NetworkAction *action;
-      double init_rate;
-      ActiveComm() : destination(nullptr),action(nullptr),init_rate(-1){};
-      virtual ~ActiveComm() = default;
-    };
+class XBT_PRIVATE ActiveComm {
+public:
+  IBNode* destination;
+  NetworkAction* action;
+  double init_rate;
+  ActiveComm() : destination(nullptr), action(nullptr), init_rate(-1){};
+  virtual ~ActiveComm() = default;
+};
 
 
-    class IBNode{
-    public :
-      int id;
-      //store related links, to ease computation of the penalties
-      std::vector<ActiveComm*> ActiveCommsUp;
-      //store the number of comms received from each node
-      std::map<IBNode*, int> ActiveCommsDown;
-      //number of comms the node is receiving
-      int nbActiveCommsDown;
-      explicit IBNode(int id) : id(id),nbActiveCommsDown(0){};
-      virtual ~IBNode() = default;
-    };
+class IBNode {
+public:
+  int id;
+  // store related links, to ease computation of the penalties
+  std::vector<ActiveComm*> ActiveCommsUp;
+  // store the number of comms received from each node
+  std::map<IBNode*, int> ActiveCommsDown;
+  // number of comms the node is receiving
+  int nbActiveCommsDown;
+  explicit IBNode(int id) : id(id), nbActiveCommsDown(0){};
+  virtual ~IBNode() = default;
+};
 
 
-    class XBT_PRIVATE NetworkIBModel : public NetworkSmpiModel {
-    private:
-      void updateIBfactors_rec(IBNode* root, std::vector<bool>& updatedlist);
-      void computeIBfactors(IBNode *root);
-    public:
-      NetworkIBModel();
-      explicit NetworkIBModel(const char *name);
-      ~NetworkIBModel() override;
-      void updateIBfactors(NetworkAction *action, IBNode *from, IBNode * to, int remove);
+class XBT_PRIVATE NetworkIBModel : public NetworkSmpiModel {
+private:
+  void updateIBfactors_rec(IBNode* root, std::vector<bool>& updatedlist);
+  void computeIBfactors(IBNode* root);
 
 
-      std::unordered_map<std::string, IBNode*> active_nodes;
-      std::unordered_map<NetworkAction*, std::pair<IBNode*, IBNode*>> active_comms;
+public:
+  NetworkIBModel();
+  explicit NetworkIBModel(const char* name);
+  ~NetworkIBModel() override;
+  void updateIBfactors(NetworkAction* action, IBNode* from, IBNode* to, int remove);
 
 
-      double Bs;
-      double Be;
-      double ys;
+  std::unordered_map<std::string, IBNode*> active_nodes;
+  std::unordered_map<NetworkAction*, std::pair<IBNode*, IBNode*>> active_comms;
 
 
-    };
-
-  }
+  double Bs;
+  double Be;
+  double ys;
+};
 }
 }
-
+} // namespace kernel
+} // namespace simgrid
 #endif
 #endif
index acfa0d1..4d6e228 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf, "Logging specific to the SURF network module");
 
 namespace simgrid {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf, "Logging specific to the SURF network module");
 
 namespace simgrid {
-  namespace surf {
+namespace kernel {
+namespace resource {
 
 
-  /* List of links */
-  std::unordered_map<std::string, LinkImpl*>* LinkImpl::links = new std::unordered_map<std::string, LinkImpl*>();
+/* List of links */
+std::unordered_map<std::string, LinkImpl*>* LinkImpl::links = new std::unordered_map<std::string, LinkImpl*>();
 
 
-  LinkImpl* LinkImpl::byName(std::string name)
-  {
-    auto link = links->find(name);
-    return link == links->end() ? nullptr : link->second;
+LinkImpl* LinkImpl::byName(std::string name)
+{
+  auto link = links->find(name);
+  return link == links->end() ? nullptr : link->second;
   }
   /** @brief Returns the amount of links in the platform */
   int LinkImpl::linksCount()
   }
   /** @brief Returns the amount of links in the platform */
   int LinkImpl::linksCount()
@@ -55,32 +56,35 @@ namespace simgrid {
   }
   }
 }
   }
   }
 }
+} // namespace simgrid
 
 /*********
  * Model *
  *********/
 
 
 /*********
  * Model *
  *********/
 
-simgrid::surf::NetworkModel *surf_network_model = nullptr;
+simgrid::kernel::resource::NetworkModel* surf_network_model = nullptr;
 
 namespace simgrid {
 
 namespace simgrid {
-  namespace surf {
+namespace kernel {
+namespace resource {
 
 
-  /** @brief Command-line option 'network/TCP-gamma' -- see \ref options_model_network_gamma */
-  simgrid::config::Flag<double> NetworkModel::cfg_tcp_gamma(
-      {"network/TCP-gamma", "network/TCP_gamma"},
-      "Size of the biggest TCP window (cat /proc/sys/net/ipv4/tcp_[rw]mem for recv/send window; "
-      "Use the last given value, which is the max window size)",
-      4194304.0);
+/** @brief Command-line option 'network/TCP-gamma' -- see \ref options_model_network_gamma */
+simgrid::config::Flag<double> NetworkModel::cfg_tcp_gamma(
+    {"network/TCP-gamma", "network/TCP_gamma"},
+    "Size of the biggest TCP window (cat /proc/sys/net/ipv4/tcp_[rw]mem for recv/send window; "
+    "Use the last given value, which is the max window size)",
+    4194304.0);
 
 
-  /** @brief Command-line option 'network/crosstraffic' -- see \ref options_model_network_crosstraffic */
-  simgrid::config::Flag<bool> NetworkModel::cfg_crosstraffic(
-      "network/crosstraffic",
-      "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)", "yes");
+/** @brief Command-line option 'network/crosstraffic' -- see \ref options_model_network_crosstraffic */
+simgrid::config::Flag<bool> NetworkModel::cfg_crosstraffic(
+    "network/crosstraffic",
+    "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)", "yes");
 
 
-  NetworkModel::~NetworkModel() = default;
+NetworkModel::~NetworkModel() = default;
 
 
-    double NetworkModel::latencyFactor(double /*size*/) {
-      return sg_latency_factor;
+double NetworkModel::latencyFactor(double /*size*/)
+{
+  return sg_latency_factor;
     }
 
     double NetworkModel::bandwidthFactor(double /*size*/) {
     }
 
     double NetworkModel::bandwidthFactor(double /*size*/) {
@@ -95,7 +99,7 @@ namespace simgrid {
     {
       double minRes = Model::next_occuring_event_full(now);
 
     {
       double minRes = Model::next_occuring_event_full(now);
 
-      for (kernel::resource::Action const& action : *get_running_action_set()) {
+      for (Action const& action : *get_running_action_set()) {
         const NetworkAction& net_action = static_cast<const NetworkAction&>(action);
         if (net_action.latency_ > 0)
           minRes = (minRes < 0) ? net_action.latency_ : std::min(minRes, net_action.latency_);
         const NetworkAction& net_action = static_cast<const NetworkAction&>(action);
         if (net_action.latency_ > 0)
           minRes = (minRes < 0) ? net_action.latency_ : std::min(minRes, net_action.latency_);
@@ -110,7 +114,7 @@ namespace simgrid {
      * Resource *
      ************/
 
      * Resource *
      ************/
 
-    LinkImpl::LinkImpl(simgrid::surf::NetworkModel* model, const std::string& name, kernel::lmm::Constraint* constraint)
+    LinkImpl::LinkImpl(NetworkModel* model, const std::string& name, lmm::Constraint* constraint)
         : Resource(model, name, constraint), piface_(this)
     {
 
         : Resource(model, name, constraint), piface_(this)
     {
 
@@ -212,8 +216,7 @@ namespace simgrid {
       for (int i = 0; i < llen; i++) {
         /* Beware of composite actions: ptasks put links and cpus together */
         // extra pb: we cannot dynamic_cast from void*...
       for (int i = 0; i < llen; i++) {
         /* Beware of composite actions: ptasks put links and cpus together */
         // extra pb: we cannot dynamic_cast from void*...
-        kernel::resource::Resource* resource =
-            static_cast<kernel::resource::Resource*>(get_variable()->get_constraint(i)->get_id());
+        Resource* resource = static_cast<Resource*>(get_variable()->get_constraint(i)->get_id());
         LinkImpl* link     = dynamic_cast<LinkImpl*>(resource);
         if (link != nullptr)
           retlist.push_back(link);
         LinkImpl* link     = dynamic_cast<LinkImpl*>(resource);
         if (link != nullptr)
           retlist.push_back(link);
@@ -222,6 +225,7 @@ namespace simgrid {
       return retlist;
     }
   }
       return retlist;
     }
   }
+  } // namespace kernel
 }
 
 #endif /* NETWORK_INTERFACE_CPP_ */
 }
 
 #endif /* NETWORK_INTERFACE_CPP_ */
index 0717913..8298151 100644 (file)
@@ -21,7 +21,8 @@
  ***********/
 
 namespace simgrid {
  ***********/
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 /*********
  * Model *
  *********/
 /*********
  * Model *
  *********/
@@ -30,12 +31,12 @@ namespace surf {
  * @brief SURF network model interface class
  * @details A model is an object which handles the interactions between its Resources and its Actions
  */
  * @brief SURF network model interface class
  * @details A model is an object which handles the interactions between its Resources and its Actions
  */
-class NetworkModel : public kernel::resource::Model {
+class NetworkModel : public Model {
 public:
   static simgrid::config::Flag<double> cfg_tcp_gamma;
   static simgrid::config::Flag<bool> cfg_crosstraffic;
 
 public:
   static simgrid::config::Flag<double> cfg_tcp_gamma;
   static simgrid::config::Flag<bool> cfg_crosstraffic;
 
-  explicit NetworkModel(kernel::resource::Model::UpdateAlgo algo) : Model(algo) {}
+  explicit NetworkModel(Model::UpdateAlgo algo) : Model(algo) {}
   ~NetworkModel() override;
 
   /**
   ~NetworkModel() override;
 
   /**
@@ -61,7 +62,7 @@ public:
    * unlimited.
    * @return The action representing the communication
    */
    * unlimited.
    * @return The action representing the communication
    */
-  virtual kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) = 0;
+  virtual Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) = 0;
 
   /**
    * @brief Get the right multiplicative factor for the latency.
 
   /**
    * @brief Get the right multiplicative factor for the latency.
@@ -109,9 +110,9 @@ public:
  * @brief SURF network link interface class
  * @details A Link represents the link between two [hosts](\ref simgrid::surf::HostImpl)
  */
  * @brief SURF network link interface class
  * @details A Link represents the link between two [hosts](\ref simgrid::surf::HostImpl)
  */
-class LinkImpl : public simgrid::kernel::resource::Resource, public simgrid::surf::PropertyHolder {
+class LinkImpl : public Resource, public simgrid::surf::PropertyHolder {
 protected:
 protected:
-  LinkImpl(simgrid::surf::NetworkModel* model, const std::string& name, kernel::lmm::Constraint* constraint);
+  LinkImpl(NetworkModel* model, const std::string& name, lmm::Constraint* constraint);
   ~LinkImpl() override;
 
 public:
   ~LinkImpl() override;
 
 public:
@@ -182,7 +183,7 @@ public:
  * @brief SURF network action interface class
  * @details A NetworkAction represents a communication between two [hosts](\ref HostImpl)
  */
  * @brief SURF network action interface class
  * @details A NetworkAction represents a communication between two [hosts](\ref HostImpl)
  */
-class NetworkAction : public simgrid::kernel::resource::Action {
+class NetworkAction : public Action {
 public:
   /** @brief Constructor
    *
 public:
   /** @brief Constructor
    *
@@ -190,23 +191,19 @@ public:
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
    */
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
    */
-  NetworkAction(simgrid::kernel::resource::Model* model, double cost, bool failed)
-      : simgrid::kernel::resource::Action(model, cost, failed)
-  {
-  }
+  NetworkAction(Model* model, double cost, bool failed) : Action(model, cost, failed) {}
 
   /**
    * @brief NetworkAction constructor
    *
    * @param model The NetworkModel associated to this NetworkAction
 
   /**
    * @brief NetworkAction constructor
    *
    * @param model The NetworkModel associated to this NetworkAction
-   * @param cost The cost of this  NetworkAction in [TODO]
-   * @param failed [description]
+   * @param cost The cost of this  NetworkAction in bytes
+   * @param failed Actions can be created in a failed state
    * @param var The lmm variable associated to this Action if it is part of a LMM component
    */
    * @param var The lmm variable associated to this Action if it is part of a LMM component
    */
-  NetworkAction(simgrid::kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var)
-      : simgrid::kernel::resource::Action(model, cost, failed, var){};
+  NetworkAction(Model* model, double cost, bool failed, lmm::Variable* var) : Action(model, cost, failed, var){};
 
 
-  void set_state(simgrid::kernel::resource::Action::State state) override;
+  void set_state(Action::State state) override;
   virtual std::list<LinkImpl*> links();
 
   double latency_    = {};
   virtual std::list<LinkImpl*> links();
 
   double latency_    = {};
@@ -216,11 +213,11 @@ public:
 };
 }
 }
 };
 }
 }
-
+} // namespace simgrid
 /** \ingroup SURF_models
  *  \brief The network model
  */
 /** \ingroup SURF_models
  *  \brief The network model
  */
-XBT_PUBLIC_DATA simgrid::surf::NetworkModel* surf_network_model;
+XBT_PUBLIC_DATA simgrid::kernel::resource::NetworkModel* surf_network_model;
 
 #endif /* SURF_NETWORK_INTERFACE_HPP_ */
 
 
 #endif /* SURF_NETWORK_INTERFACE_HPP_ */
 
index d377157..13642d0 100644 (file)
@@ -89,10 +89,10 @@ static void clusterCreation_cb(simgrid::kernel::routing::ClusterCreationArgs* cl
 static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoint* src,
                              simgrid::kernel::routing::NetPoint* dst, simgrid::kernel::routing::NetPoint* gw_src,
                              simgrid::kernel::routing::NetPoint* gw_dst,
 static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoint* src,
                              simgrid::kernel::routing::NetPoint* dst, simgrid::kernel::routing::NetPoint* gw_src,
                              simgrid::kernel::routing::NetPoint* gw_dst,
-                             std::vector<simgrid::surf::LinkImpl*>& link_list)
+                             std::vector<simgrid::kernel::resource::LinkImpl*>& link_list)
 {
   if (link_list.size() == 1) {
 {
   if (link_list.size() == 1) {
-    simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list[0]);
+    simgrid::kernel::resource::LinkNS3* link = static_cast<simgrid::kernel::resource::LinkNS3*>(link_list[0]);
 
     XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->get_cname(), dst->get_cname(), link->get_cname(),
               (symmetrical ? "(symmetrical)" : "(not symmetrical)"));
 
     XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->get_cname(), dst->get_cname(), link->get_cname(),
               (symmetrical ? "(symmetrical)" : "(not symmetrical)"));
@@ -139,7 +139,7 @@ void surf_network_model_init_NS3()
   if (surf_network_model)
     return;
 
   if (surf_network_model)
     return;
 
-  surf_network_model = new simgrid::surf::NetworkNS3Model();
+  surf_network_model = new simgrid::kernel::resource::NetworkNS3Model();
   all_existing_models->push_back(surf_network_model);
 }
 
   all_existing_models->push_back(surf_network_model);
 }
 
@@ -147,7 +147,8 @@ static simgrid::config::Flag<std::string>
     ns3_tcp_model("ns3/TcpModel", "The ns3 tcp model can be : NewReno or Reno or Tahoe", "default");
 
 namespace simgrid {
     ns3_tcp_model("ns3/TcpModel", "The ns3 tcp model can be : NewReno or Reno or Tahoe", "default");
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 NetworkNS3Model::NetworkNS3Model() : NetworkModel(Model::UpdateAlgo::Full)
 {
 
 NetworkNS3Model::NetworkNS3Model() : NetworkModel(Model::UpdateAlgo::Full)
 {
@@ -347,6 +348,7 @@ void NetworkNS3Action::update_remains_lazy(double /*now*/)
   THROW_IMPOSSIBLE;
 }
 
   THROW_IMPOSSIBLE;
 }
 
+} // namespace resource
 }
 }
 
 }
 }
 
index aa8ab6b..27e8058 100644 (file)
@@ -11,7 +11,8 @@
 #include "network_interface.hpp"
 
 namespace simgrid {
 #include "network_interface.hpp"
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 class NetworkNS3Model : public NetworkModel {
 public:
 
 class NetworkNS3Model : public NetworkModel {
 public:
@@ -58,6 +59,7 @@ public:
   s4u::Host* dst_;
 };
 
   s4u::Host* dst_;
 };
 
+} // namespace resource
 }
 }
 
 }
 }
 
index 2b1c21d..4189c00 100644 (file)
@@ -33,14 +33,15 @@ void surf_network_model_init_SMPI()
 {
   if (surf_network_model)
     return;
 {
   if (surf_network_model)
     return;
-  surf_network_model = new simgrid::surf::NetworkSmpiModel();
+  surf_network_model = new simgrid::kernel::resource::NetworkSmpiModel();
   all_existing_models->push_back(surf_network_model);
 
   xbt_cfg_setdefault_double("network/weight-S", 8775);
 }
 
 namespace simgrid {
   all_existing_models->push_back(surf_network_model);
 
   xbt_cfg_setdefault_double("network/weight-S", 8775);
 }
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
 {
 
 NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
 {
@@ -98,3 +99,4 @@ double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double s
  **********/
 }
 }
  **********/
 }
 }
+} // namespace simgrid
index 8a91cb8..01ff44d 100644 (file)
@@ -9,16 +9,18 @@
 #include "network_cm02.hpp"
 
 namespace simgrid {
 #include "network_cm02.hpp"
 
 namespace simgrid {
-  namespace surf {
+namespace kernel {
+namespace resource {
 
 
-    class XBT_PRIVATE NetworkSmpiModel : public NetworkCm02Model {
-    public:
-      NetworkSmpiModel();
-      ~NetworkSmpiModel();
+class XBT_PRIVATE NetworkSmpiModel : public NetworkCm02Model {
+public:
+  NetworkSmpiModel();
+  ~NetworkSmpiModel();
 
 
-      double latencyFactor(double size);
-      double bandwidthFactor(double size);
-      double bandwidthConstraint(double rate, double bound, double size);
-    };
-  }
+  double latencyFactor(double size);
+  double bandwidthFactor(double size);
+  double bandwidthConstraint(double rate, double bound, double size);
+};
+} // namespace resource
+} // namespace kernel
 }
 }
index 1ced7bc..825e555 100644 (file)
@@ -19,7 +19,7 @@ static void datasent_cb(ns3::Ptr<ns3::Socket> socket, uint32_t dataSent);
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ns3);
 
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ns3);
 
-SgFlow::SgFlow(uint32_t totalBytes, simgrid::surf::NetworkNS3Action* action)
+SgFlow::SgFlow(uint32_t totalBytes, simgrid::kernel::resource::NetworkNS3Action* action)
 {
   totalBytes_ = totalBytes;
   remaining_  = totalBytes;
 {
   totalBytes_ = totalBytes;
   remaining_  = totalBytes;
index edb6fc7..db1236a 100644 (file)
@@ -7,18 +7,13 @@
 #define NS3_SIMULATOR_HPP
 
 #include "simgrid/s4u/Host.hpp"
 #define NS3_SIMULATOR_HPP
 
 #include "simgrid/s4u/Host.hpp"
+#include "src/surf/network_ns3.hpp"
 
 #include <ns3/node.h>
 #include <ns3/tcp-socket-factory.h>
 
 #include <cstdint>
 
 
 #include <ns3/node.h>
 #include <ns3/tcp-socket-factory.h>
 
 #include <cstdint>
 
-namespace simgrid {
-namespace surf {
-class NetworkNS3Action;
-}
-} // namespace simgrid
-
 class NetPointNs3 {
 public:
   static simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetPointNs3> EXTENSION_ID;
 class NetPointNs3 {
 public:
   static simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetPointNs3> EXTENSION_ID;
@@ -37,7 +32,7 @@ XBT_PUBLIC void ns3_add_cluster(const char* id, double bw, double lat);
 
 class XBT_PRIVATE SgFlow {
 public:
 
 class XBT_PRIVATE SgFlow {
 public:
-  SgFlow(uint32_t totalBytes, simgrid::surf::NetworkNS3Action* action);
+  SgFlow(uint32_t totalBytes, simgrid::kernel::resource::NetworkNS3Action* action);
 
   // private:
   std::uint32_t bufferedBytes_ = 0;
 
   // private:
   std::uint32_t bufferedBytes_ = 0;
@@ -45,7 +40,7 @@ public:
   std::uint32_t remaining_;
   std::uint32_t totalBytes_;
   bool finished_ = false;
   std::uint32_t remaining_;
   std::uint32_t totalBytes_;
   bool finished_ = false;
-  simgrid::surf::NetworkNS3Action* action_;
+  simgrid::kernel::resource::NetworkNS3Action* action_;
 };
 
 void StartFlow(ns3::Ptr<ns3::Socket> sock, const char* to, uint16_t port_number);
 };
 
 void StartFlow(ns3::Ptr<ns3::Socket> sock, const char* to, uint16_t port_number);
index dbe5c8f..f8ec4ba 100644 (file)
@@ -145,10 +145,11 @@ double LinkEnergy::getConsumedEnergy()
 using simgrid::plugin::LinkEnergy;
 
 /* **************************** events  callback *************************** */
 using simgrid::plugin::LinkEnergy;
 
 /* **************************** events  callback *************************** */
-static void onCommunicate(simgrid::surf::NetworkAction* action, simgrid::s4u::Host* src, simgrid::s4u::Host* dst)
+static void onCommunicate(simgrid::kernel::resource::NetworkAction* action, simgrid::s4u::Host* src,
+                          simgrid::s4u::Host* dst)
 {
   XBT_DEBUG("onCommunicate is called");
 {
   XBT_DEBUG("onCommunicate is called");
-  for (simgrid::surf::LinkImpl* link : action->links()) {
+  for (simgrid::kernel::resource::LinkImpl* link : action->links()) {
 
     if (link == nullptr)
       continue;
 
     if (link == nullptr)
       continue;
@@ -206,8 +207,8 @@ void sg_link_energy_plugin_init()
                link.extension<LinkEnergy>()->getConsumedEnergy());
   });
 
                link.extension<LinkEnergy>()->getConsumedEnergy());
   });
 
-  simgrid::s4u::Link::onCommunicationStateChange.connect([](simgrid::surf::NetworkAction* action) {
-    for (simgrid::surf::LinkImpl* link : action->links()) {
+  simgrid::s4u::Link::onCommunicationStateChange.connect([](simgrid::kernel::resource::NetworkAction* action) {
+    for (simgrid::kernel::resource::LinkImpl* link : action->links()) {
       if (link != nullptr)
         link->piface_.extension<LinkEnergy>()->update();
     }
       if (link != nullptr)
         link->piface_.extension<LinkEnergy>()->update();
     }
index 9e2bfe1..f2edb25 100644 (file)
@@ -163,7 +163,7 @@ L07Action::L07Action(kernel::resource::Model* model, int host_nb, sg_host_t* hos
         if (bytes_amount[i * host_nb + j] > 0) {
           double lat=0.0;
 
         if (bytes_amount[i * host_nb + j] > 0) {
           double lat=0.0;
 
-          std::vector<LinkImpl*> route;
+          std::vector<kernel::resource::LinkImpl*> route;
           hostList_->at(i)->routeTo(hostList_->at(j), route, &lat);
           latency = std::max(latency, lat);
 
           hostList_->at(i)->routeTo(hostList_->at(j), route, &lat);
           latency = std::max(latency, lat);
 
@@ -191,7 +191,7 @@ L07Action::L07Action(kernel::resource::Model* model, int host_nb, sg_host_t* hos
     for (int i = 0; i < host_nb; i++) {
       for (int j = 0; j < host_nb; j++) {
         if (bytes_amount[i * host_nb + j] > 0.0) {
     for (int i = 0; i < host_nb; i++) {
       for (int j = 0; j < host_nb; j++) {
         if (bytes_amount[i * host_nb + j] > 0.0) {
-          std::vector<LinkImpl*> route;
+          std::vector<kernel::resource::LinkImpl*> route;
           hostList_->at(i)->routeTo(hostList_->at(j), route, nullptr);
 
           for (auto const& link : route)
           hostList_->at(i)->routeTo(hostList_->at(j), route, nullptr);
 
           for (auto const& link : route)
@@ -227,8 +227,8 @@ Cpu *CpuL07Model::createCpu(simgrid::s4u::Host *host,  std::vector<double> *spee
   return new CpuL07(this, host, speedPerPstate, core);
 }
 
   return new CpuL07(this, host, speedPerPstate, core);
 }
 
-LinkImpl* NetworkL07Model::createLink(const std::string& name, double bandwidth, double latency,
-                                      e_surf_link_sharing_policy_t policy)
+kernel::resource::LinkImpl* NetworkL07Model::createLink(const std::string& name, double bandwidth, double latency,
+                                                        e_surf_link_sharing_policy_t policy)
 {
   return new LinkL07(this, name, bandwidth, latency, policy);
 }
 {
   return new LinkL07(this, name, bandwidth, latency, policy);
 }
@@ -388,7 +388,7 @@ void L07Action::updateBound()
 
         if (communicationAmount_[i * hostNb + j] > 0) {
           double lat = 0.0;
 
         if (communicationAmount_[i * hostNb + j] > 0) {
           double lat = 0.0;
-          std::vector<LinkImpl*> route;
+          std::vector<kernel::resource::LinkImpl*> route;
           hostList_->at(i)->routeTo(hostList_->at(j), route, &lat);
 
           lat_current = std::max(lat_current, lat * communicationAmount_[i * hostNb + j]);
           hostList_->at(i)->routeTo(hostList_->at(j), route, &lat);
 
           lat_current = std::max(lat_current, lat * communicationAmount_[i * hostNb + j]);
@@ -396,7 +396,7 @@ void L07Action::updateBound()
       }
     }
   }
       }
     }
   }
-  double lat_bound = NetworkModel::cfg_tcp_gamma / (2.0 * lat_current);
+  double lat_bound = kernel::resource::NetworkModel::cfg_tcp_gamma / (2.0 * lat_current);
   XBT_DEBUG("action (%p) : lat_bound = %g", this, lat_bound);
   if ((latency_ <= 0.0) && (suspended_ == Action::SuspendStates::not_suspended)) {
     if (rate_ < 0)
   XBT_DEBUG("action (%p) : lat_bound = %g", this, lat_bound);
   if ((latency_ <= 0.0) && (suspended_ == Action::SuspendStates::not_suspended)) {
     if (rate_ < 0)
index 25364a2..e0a8ae9 100644 (file)
@@ -53,12 +53,12 @@ public:
   HostL07Model *hostModel_;
 };
 
   HostL07Model *hostModel_;
 };
 
-class NetworkL07Model : public NetworkModel {
+class NetworkL07Model : public kernel::resource::NetworkModel {
 public:
   NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
   ~NetworkL07Model();
 public:
   NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
   ~NetworkL07Model();
-  LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
-                       e_surf_link_sharing_policy_t policy) override;
+  kernel::resource::LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
+                                         e_surf_link_sharing_policy_t policy) override;
 
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
 
 
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
 
@@ -87,7 +87,7 @@ protected:
   void onSpeedChange() override;
 };
 
   void onSpeedChange() override;
 };
 
-class LinkL07 : public LinkImpl {
+class LinkL07 : public kernel::resource::LinkImpl {
 public:
   LinkL07(NetworkL07Model* model, const std::string& name, double bandwidth, double latency,
           e_surf_link_sharing_policy_t policy);
 public:
   LinkL07(NetworkL07Model* model, const std::string& name, double bandwidth, double latency,
           e_surf_link_sharing_policy_t policy);
index 4c2161a..c8057ad 100644 (file)
@@ -120,7 +120,7 @@ void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link)
     names.push_back(link->id);
   }
   for (auto const& link_name : names) {
     names.push_back(link->id);
   }
   for (auto const& link_name : names) {
-    simgrid::surf::LinkImpl* l =
+    simgrid::kernel::resource::LinkImpl* l =
         surf_network_model->createLink(link_name, link->bandwidth, link->latency, link->policy);
 
     if (link->properties) {
         surf_network_model->createLink(link_name, link->bandwidth, link->latency, link->policy);
 
     if (link->properties) {
@@ -209,8 +209,8 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
     // other columns are to store one or more link for the node
 
     //add a loopback link
     // other columns are to store one or more link for the node
 
     //add a loopback link
-    simgrid::surf::LinkImpl* linkUp   = nullptr;
-    simgrid::surf::LinkImpl* linkDown = nullptr;
+    simgrid::kernel::resource::LinkImpl* linkUp   = nullptr;
+    simgrid::kernel::resource::LinkImpl* linkDown = nullptr;
     if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){
       std::string tmp_link = link_id + "_loopback";
       XBT_DEBUG("<loopback\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->loopback_bw);
     if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){
       std::string tmp_link = link_id + "_loopback";
       XBT_DEBUG("<loopback\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->loopback_bw);
@@ -221,8 +221,8 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
       link.latency   = cluster->loopback_lat;
       link.policy    = SURF_LINK_FATPIPE;
       sg_platf_new_link(&link);
       link.latency   = cluster->loopback_lat;
       link.policy    = SURF_LINK_FATPIPE;
       sg_platf_new_link(&link);
-      linkUp   = simgrid::surf::LinkImpl::byName(tmp_link);
-      linkDown = simgrid::surf::LinkImpl::byName(tmp_link);
+      linkUp   = simgrid::kernel::resource::LinkImpl::byName(tmp_link);
+      linkDown = simgrid::kernel::resource::LinkImpl::byName(tmp_link);
 
       auto* as_cluster = static_cast<ClusterZone*>(current_as);
       as_cluster->private_links_.insert({as_cluster->node_pos(rankId), {linkUp, linkDown}});
 
       auto* as_cluster = static_cast<ClusterZone*>(current_as);
       as_cluster->private_links_.insert({as_cluster->node_pos(rankId), {linkUp, linkDown}});
@@ -241,7 +241,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
       link.latency = 0;
       link.policy = SURF_LINK_SHARED;
       sg_platf_new_link(&link);
       link.latency = 0;
       link.policy = SURF_LINK_SHARED;
       sg_platf_new_link(&link);
-      linkDown = simgrid::surf::LinkImpl::byName(tmp_link);
+      linkDown = simgrid::kernel::resource::LinkImpl::byName(tmp_link);
       linkUp   = linkDown;
       current_as->private_links_.insert({current_as->node_pos_with_loopback(rankId), {linkUp, linkDown}});
     }
       linkUp   = linkDown;
       current_as->private_links_.insert({current_as->node_pos_with_loopback(rankId), {linkUp, linkDown}});
     }
@@ -278,7 +278,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
     XBT_DEBUG("<link\tid=\"%s\" bw=\"%f\" lat=\"%f\"/>", link.id.c_str(), cluster->bb_bw, cluster->bb_lat);
     sg_platf_new_link(&link);
 
     XBT_DEBUG("<link\tid=\"%s\" bw=\"%f\" lat=\"%f\"/>", link.id.c_str(), cluster->bb_bw, cluster->bb_lat);
     sg_platf_new_link(&link);
 
-    routing_cluster_add_backbone(simgrid::surf::LinkImpl::byName(link.id));
+    routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl::byName(link.id));
   }
 
   XBT_DEBUG("</AS>");
   }
 
   XBT_DEBUG("</AS>");
@@ -288,7 +288,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
   delete cluster->radicals;
 }
 
   delete cluster->radicals;
 }
 
-void routing_cluster_add_backbone(simgrid::surf::LinkImpl* bb)
+void routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl* bb)
 {
   simgrid::kernel::routing::ClusterZone* cluster =
       dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
 {
   simgrid::kernel::routing::ClusterZone* cluster =
       dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
@@ -644,8 +644,8 @@ void sg_platf_new_hostlink(simgrid::kernel::routing::HostLinkCreationArgs* hostl
   xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
              "Only hosts from Cluster and Vivaldi ASes can get an host_link.");
 
   xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
              "Only hosts from Cluster and Vivaldi ASes can get an host_link.");
 
-  simgrid::surf::LinkImpl* linkUp   = simgrid::surf::LinkImpl::byName(hostlink->link_up);
-  simgrid::surf::LinkImpl* linkDown = simgrid::surf::LinkImpl::byName(hostlink->link_down);
+  simgrid::kernel::resource::LinkImpl* linkUp   = simgrid::kernel::resource::LinkImpl::byName(hostlink->link_up);
+  simgrid::kernel::resource::LinkImpl* linkDown = simgrid::kernel::resource::LinkImpl::byName(hostlink->link_down);
 
   xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up.c_str());
   xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down.c_str());
 
   xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up.c_str());
   xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down.c_str());
index 2004447..1b0f935 100644 (file)
@@ -78,7 +78,7 @@ public:
   NetPoint* dst    = nullptr;
   NetPoint* gw_src = nullptr;
   NetPoint* gw_dst = nullptr;
   NetPoint* dst    = nullptr;
   NetPoint* gw_src = nullptr;
   NetPoint* gw_dst = nullptr;
-  std::vector<simgrid::surf::LinkImpl*> link_list;
+  std::vector<simgrid::kernel::resource::LinkImpl*> link_list;
 };
 
 enum class ClusterTopology { DRAGONFLY = 3, FAT_TREE = 2, FLAT = 1, TORUS = 0 };
 };
 
 enum class ClusterTopology { DRAGONFLY = 3, FAT_TREE = 2, FLAT = 1, TORUS = 0 };
@@ -182,7 +182,7 @@ public:
 extern "C" {
 
 /********** Routing **********/
 extern "C" {
 
 /********** Routing **********/
-void routing_cluster_add_backbone(simgrid::surf::LinkImpl* bb);
+void routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl* bb);
 /*** END of the parsing cruft ***/
 
 XBT_PUBLIC void sg_platf_begin(); // Start a new platform
 /*** END of the parsing cruft ***/
 
 XBT_PUBLIC void sg_platf_begin(); // Start a new platform
index 34ac520..db18b63 100644 (file)
@@ -25,7 +25,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF
 #include "simgrid_dtd.c"
 
 static const char* surf_parsed_filename; // Currently parsed file (for the error messages)
 #include "simgrid_dtd.c"
 
 static const char* surf_parsed_filename; // Currently parsed file (for the error messages)
-std::vector<simgrid::surf::LinkImpl*> parsed_link_list; /* temporary store of current list link of a route */
+std::vector<simgrid::kernel::resource::LinkImpl*>
+    parsed_link_list; /* temporary store of current list link of a route */
 
 /*
  * Helping functions
 
 /*
  * Helping functions
@@ -608,17 +609,17 @@ void ETag_surfxml_link(){
 
 void STag_surfxml_link___ctn()
 {
 
 void STag_surfxml_link___ctn()
 {
-  simgrid::surf::LinkImpl* link = nullptr;
+  simgrid::kernel::resource::LinkImpl* link = nullptr;
   switch (A_surfxml_link___ctn_direction) {
   case AU_surfxml_link___ctn_direction:
   case A_surfxml_link___ctn_direction_NONE:
   switch (A_surfxml_link___ctn_direction) {
   case AU_surfxml_link___ctn_direction:
   case A_surfxml_link___ctn_direction_NONE:
-    link = simgrid::surf::LinkImpl::byName(A_surfxml_link___ctn_id);
+    link = simgrid::kernel::resource::LinkImpl::byName(A_surfxml_link___ctn_id);
     break;
   case A_surfxml_link___ctn_direction_UP:
     break;
   case A_surfxml_link___ctn_direction_UP:
-    link = simgrid::surf::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_UP");
+    link = simgrid::kernel::resource::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_UP");
     break;
   case A_surfxml_link___ctn_direction_DOWN:
     break;
   case A_surfxml_link___ctn_direction_DOWN:
-    link = simgrid::surf::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_DOWN");
+    link = simgrid::kernel::resource::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_DOWN");
     break;
   default:
     surf_parse_error(std::string("Invalid direction for link ") + A_surfxml_link___ctn_id);
     break;
   default:
     surf_parse_error(std::string("Invalid direction for link ") + A_surfxml_link___ctn_id);
@@ -650,7 +651,7 @@ void ETag_surfxml_backbone(){
   link.policy = SURF_LINK_SHARED;
 
   sg_platf_new_link(&link);
   link.policy = SURF_LINK_SHARED;
 
   sg_platf_new_link(&link);
-  routing_cluster_add_backbone(simgrid::surf::LinkImpl::byName(A_surfxml_backbone_id));
+  routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl::byName(A_surfxml_backbone_id));
 }
 
 void STag_surfxml_route(){
 }
 
 void STag_surfxml_route(){
index a43c039..d21cf4d 100644 (file)
@@ -127,7 +127,7 @@ static void dump_routes()
     simgrid::kernel::routing::NetPoint* netcardSrc = host1->pimpl_netpoint;
     for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
       simgrid::s4u::Host* host2 = hosts[it_dst];
     simgrid::kernel::routing::NetPoint* netcardSrc = host1->pimpl_netpoint;
     for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
       simgrid::s4u::Host* host2 = hosts[it_dst];
-      std::vector<simgrid::surf::LinkImpl*> route;
+      std::vector<simgrid::kernel::resource::LinkImpl*> route;
       simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
       simgrid::kernel::routing::NetZoneImpl::get_global_route(netcardSrc, netcardDst, route, nullptr);
       if (not route.empty()) {
       simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
       simgrid::kernel::routing::NetZoneImpl::get_global_route(netcardSrc, netcardDst, route, nullptr);
       if (not route.empty()) {
@@ -141,7 +141,7 @@ static void dump_routes()
     for (auto const& netcardDst : netcardList) { // to router
       if (netcardDst->is_router()) {
         std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->get_cname(), netcardDst->get_cname());
     for (auto const& netcardDst : netcardList) { // to router
       if (netcardDst->is_router()) {
         std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->get_cname(), netcardDst->get_cname());
-        std::vector<simgrid::surf::LinkImpl*> route;
+        std::vector<simgrid::kernel::resource::LinkImpl*> route;
         simgrid::kernel::routing::NetZoneImpl::get_global_route(netcardSrc, netcardDst, route, nullptr);
         for (auto const& link : route)
           std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
         simgrid::kernel::routing::NetZoneImpl::get_global_route(netcardSrc, netcardDst, route, nullptr);
         for (auto const& link : route)
           std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
@@ -155,7 +155,7 @@ static void dump_routes()
       for (auto const& value2 : netcardList) { // to router
         if (value2->is_router()) {
           std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->get_cname(), value2->get_cname());
       for (auto const& value2 : netcardList) { // to router
         if (value2->is_router()) {
           std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->get_cname(), value2->get_cname());
-          std::vector<simgrid::surf::LinkImpl*> route;
+          std::vector<simgrid::kernel::resource::LinkImpl*> route;
           simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, value2, route, nullptr);
           for (auto const& link : route)
             std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
           simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, value2, route, nullptr);
           for (auto const& link : route)
             std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
@@ -165,7 +165,7 @@ static void dump_routes()
       for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
         simgrid::s4u::Host* host2 = hosts[it_dst];
         std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->get_cname(), host2->get_cname());
       for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
         simgrid::s4u::Host* host2 = hosts[it_dst];
         std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->get_cname(), host2->get_cname());
-        std::vector<simgrid::surf::LinkImpl*> route;
+        std::vector<simgrid::kernel::resource::LinkImpl*> route;
         simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
         simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, netcardDst, route, nullptr);
         for (auto const& link : route)
         simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
         simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, netcardDst, route, nullptr);
         for (auto const& link : route)