Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
finish the transition netcards->netpoints in the code
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 31 Jan 2017 08:33:30 +0000 (09:33 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 31 Jan 2017 08:33:30 +0000 (09:33 +0100)
18 files changed:
include/simgrid/forward.h
src/bindings/lua/lua_platf.cpp
src/instr/instr_interface.cpp
src/instr/instr_paje_containers.cpp
src/instr/instr_private.h
src/kernel/routing/FloydZone.cpp
src/kernel/routing/NetPoint.cpp
src/kernel/routing/NetPoint.hpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/NetZoneImpl.hpp
src/kernel/routing/VivaldiZone.cpp
src/kernel/routing/VivaldiZone.hpp
src/surf/network_ns3.cpp
src/surf/ns3/ns3_interface.h
src/surf/sg_platf.cpp
src/surf/storage_n11.cpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_sax_cb.cpp

index 610f34f..3459fd6 100644 (file)
@@ -72,7 +72,7 @@ typedef simgrid_Host* sg_host_t;
 typedef kernel_Activity *smx_activity_t;
 
 typedef surf_Cpu *surf_cpu_t;
-typedef routing_NetPoint* sg_netcard_t;
+typedef routing_NetPoint* sg_netpoint_t;
 typedef surf_Resource *sg_resource_t;
 
 // Types which are in fact dictelmt:
index bdcfef6..c8434e3 100644 (file)
@@ -320,7 +320,7 @@ int console_add_route(lua_State *L) {
   type = lua_gettable(L,-2);
   lua_ensure(type == LUA_TSTRING, "Attribute 'src' must be specified for any route and must be a string.");
   const char *srcName = lua_tostring(L, -1);
-  route.src = sg_netcard_by_name_or_null(srcName);
+  route.src           = sg_netpoint_by_name_or_null(srcName);
   lua_ensure(route.src != nullptr, "Attribute 'src=%s' of route does not name a node.", srcName);
   lua_pop(L,1);
 
@@ -328,7 +328,7 @@ int console_add_route(lua_State *L) {
   type = lua_gettable(L,-2);
   lua_ensure(type == LUA_TSTRING, "Attribute 'dest' must be specified for any route and must be a string.");
   const char *dstName = lua_tostring(L, -1);
-  route.dst = sg_netcard_by_name_or_null(dstName);
+  route.dst           = sg_netpoint_by_name_or_null(dstName);
   lua_ensure(route.dst != nullptr, "Attribute 'dst=%s' of route does not name a node.", dstName);
   lua_pop(L,1);
 
@@ -389,28 +389,28 @@ int console_add_ASroute(lua_State *L) {
   lua_pushstring(L, "src");
   lua_gettable(L, -2);
   const char *srcName = lua_tostring(L, -1);
-  ASroute.src = sg_netcard_by_name_or_null(srcName);
+  ASroute.src         = sg_netpoint_by_name_or_null(srcName);
   lua_ensure(ASroute.src != nullptr, "Attribute 'src=%s' of AS route does not name a node.", srcName);
   lua_pop(L, 1);
 
   lua_pushstring(L, "dst");
   lua_gettable(L, -2);
   const char *dstName = lua_tostring(L, -1);
-  ASroute.dst = sg_netcard_by_name_or_null(dstName);
+  ASroute.dst         = sg_netpoint_by_name_or_null(dstName);
   lua_ensure(ASroute.dst != nullptr, "Attribute 'dst=%s' of AS route does not name a node.", dstName);
   lua_pop(L, 1);
 
   lua_pushstring(L, "gw_src");
   lua_gettable(L, -2);
   const char *name = lua_tostring(L, -1);
-  ASroute.gw_src = sg_netcard_by_name_or_null(name);
+  ASroute.gw_src   = sg_netpoint_by_name_or_null(name);
   lua_ensure(ASroute.gw_src, "Attribute 'gw_src=%s' of AS route does not name a valid node", name);
   lua_pop(L, 1);
 
   lua_pushstring(L, "gw_dst");
   lua_gettable(L, -2);
   name = lua_tostring(L, -1);
-  ASroute.gw_dst = sg_netcard_by_name_or_null(name);
+  ASroute.gw_dst = sg_netpoint_by_name_or_null(name);
   lua_ensure(ASroute.gw_dst, "Attribute 'gw_dst=%s' of AS route does not name a valid node", name);
   lua_pop(L, 1);
 
index da48497..74ee42b 100644 (file)
@@ -308,11 +308,11 @@ static void instr_user_variable(double time, const char *resource, const char *v
 static void instr_user_srcdst_variable(double time, const char *src, const char *dst, const char *variable,
                               const char *father_type, double value, InstrUserVariable what)
 {
-  sg_netcard_t src_elm = sg_netcard_by_name_or_null(src);
+  sg_netpoint_t src_elm = sg_netpoint_by_name_or_null(src);
   if(!src_elm)
     xbt_die("Element '%s' not found!",src);
 
-  sg_netcard_t dst_elm = sg_netcard_by_name_or_null(dst);
+  sg_netpoint_t dst_elm = sg_netpoint_by_name_or_null(dst);
   if(!dst_elm)
     xbt_die("Element '%s' not found!",dst);
 
index f172f91..87edfbe 100644 (file)
@@ -68,19 +68,19 @@ container_t PJ_container_new (const char *name, e_container_types kind, containe
   //Search for network_element_t
   switch (kind){
     case INSTR_HOST:
-      newContainer->netcard = sg_host->pimpl_netpoint;
-      xbt_assert(newContainer->netcard, "Element '%s' not found",name);
+      newContainer->netpoint = sg_host->pimpl_netpoint;
+      xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
       break;
     case INSTR_ROUTER:
-      newContainer->netcard = simgrid::s4u::Engine::instance()->netpointByNameOrNull(name);
-      xbt_assert(newContainer->netcard, "Element '%s' not found",name);
+      newContainer->netpoint = simgrid::s4u::Engine::instance()->netpointByNameOrNull(name);
+      xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
       break;
     case INSTR_AS:
-      newContainer->netcard = simgrid::s4u::Engine::instance()->netpointByNameOrNull(name);
-      xbt_assert(newContainer->netcard, "Element '%s' not found",name);
+      newContainer->netpoint = simgrid::s4u::Engine::instance()->netpointByNameOrNull(name);
+      xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
       break;
     default:
-      newContainer->netcard = nullptr;
+      newContainer->netpoint = nullptr;
       break;
   }
 
index de371d1..dd0e1c3 100644 (file)
@@ -88,7 +88,7 @@ typedef enum {
 
 typedef struct s_container *container_t;
 typedef struct s_container {
-  sg_netcard_t netcard;
+  sg_netpoint_t netpoint;
   char *name;     /* Unique name of this container */
   char *id;       /* Unique id of this container */
   type_t type;    /* Type of this container */
index 1c20629..e88464b 100644 (file)
@@ -65,7 +65,7 @@ void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
     route->gw_dst = route_stack.front()->gw_dst;
   }
 
-  sg_netcard_t prev_dst_gw = nullptr;
+  sg_netpoint_t prev_dst_gw = nullptr;
   while (!route_stack.empty()) {
     sg_platf_route_cbarg_t e_route = route_stack.back();
     route_stack.pop_back();
index 49c517f..d1f353c 100644 (file)
@@ -30,11 +30,11 @@ NetPoint::NetPoint(std::string name, NetPoint::Type componentType, NetZoneImpl*
 }
 } // namespace simgrid::kernel::routing
 
-/** @brief Retrieve a netcard from its name
+/** @brief Retrieve a netpoint from its name
  *
- * Netcards are the thing that connect host or routers to the network
+ * Netpoints denote the location of host or routers in the network, to compute routes
  */
-simgrid::kernel::routing::NetPoint* sg_netcard_by_name_or_null(const char* name)
+simgrid::kernel::routing::NetPoint* sg_netpoint_by_name_or_null(const char* name)
 {
   return simgrid::s4u::Engine::instance()->netpointByNameOrNull(name);
 }
index b077a37..285ef6a 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef KERNEL_ROUTING_NETCARD_HPP_
-#define KERNEL_ROUTING_NETCARD_HPP_
+#ifndef KERNEL_ROUTING_NETPOINT_HPP_
+#define KERNEL_ROUTING_NETPOINT_HPP_
 
 #include <xbt/Extendable.hpp>
 #include <xbt/base.h>
@@ -36,7 +36,7 @@ public:
   unsigned int id() { return id_; }
   std::string name() { return name_; }
   const char* cname() { return name_.c_str(); }
-  /** @brief the NetZone in which this netcard is included */
+  /** @brief the NetZone in which this NetPoint is included */
   NetZoneImpl* netzone() { return netzone_; }
 
   bool isNetZone() { return componentType_ == Type::NetZone; }
@@ -57,6 +57,6 @@ private:
 }
 }
 
-XBT_PUBLIC(sg_netcard_t) sg_netcard_by_name_or_null(const char* name);
+XBT_PUBLIC(sg_netpoint_t) sg_netpoint_by_name_or_null(const char* name);
 
-#endif /* KERNEL_ROUTING_NETCARD_HPP_ */
+#endif /* KERNEL_ROUTING_NETPOINT_HPP_ */
index b312eb3..a2cd1a8 100644 (file)
@@ -31,15 +31,15 @@ NetZoneImpl::NetZoneImpl(NetZone* father, const char* name) : NetZone(father, na
   xbt_assert(nullptr == simgrid::s4u::Engine::instance()->netpointByNameOrNull(name),
              "Refusing to create a second NetZone called '%s'.", name);
 
-  netcard_ = new NetPoint(name, NetPoint::Type::NetZone, static_cast<NetZoneImpl*>(father));
-  XBT_DEBUG("NetZone '%s' created with the id '%d'", name, netcard_->id());
+  netpoint_ = new NetPoint(name, NetPoint::Type::NetZone, static_cast<NetZoneImpl*>(father));
+  XBT_DEBUG("NetZone '%s' created with the id '%d'", name, netpoint_->id());
 }
 NetZoneImpl::~NetZoneImpl()
 {
   for (auto& kv : bypassRoutes_)
     delete kv.second;
 
-  simgrid::s4u::Engine::instance()->netpointUnregister(netcard_);
+  simgrid::s4u::Engine::instance()->netpointUnregister(netpoint_);
 }
 
 simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
@@ -259,14 +259,14 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
   for (int max = 0; max <= max_index; max++) {
     for (int i = 0; i < max; i++) {
       if (i <= max_index_src && max <= max_index_dst) {
-        key = {path_src.at(i)->netcard_, path_dst.at(max)->netcard_};
+        key = {path_src.at(i)->netpoint_, path_dst.at(max)->netpoint_};
         if (bypassRoutes_.find(key) != bypassRoutes_.end()) {
           bypassedRoute = bypassRoutes_.at(key);
           break;
         }
       }
       if (max <= max_index_src && i <= max_index_dst) {
-        key = {path_src.at(max)->netcard_, path_dst.at(i)->netcard_};
+        key = {path_src.at(max)->netpoint_, path_dst.at(i)->netpoint_};
         if (bypassRoutes_.find(key) != bypassRoutes_.end()) {
           bypassedRoute = bypassRoutes_.at(key);
           break;
@@ -278,7 +278,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
       break;
 
     if (max <= max_index_src && max <= max_index_dst) {
-      key = {path_src.at(max)->netcard_, path_dst.at(max)->netcard_};
+      key = {path_src.at(max)->netpoint_, path_dst.at(max)->netpoint_};
       if (bypassRoutes_.find(key) != bypassRoutes_.end()) {
         bypassedRoute = bypassRoutes_.at(key);
         break;
@@ -335,7 +335,7 @@ void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
 
   route.link_list = new std::vector<surf::Link*>();
 
-  common_ancestor->getLocalRoute(src_ancestor->netcard_, dst_ancestor->netcard_, &route, latency);
+  common_ancestor->getLocalRoute(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency);
   xbt_assert((route.gw_src != nullptr) && (route.gw_dst != nullptr), "bad gateways for route from \"%s\" to \"%s\"",
              src->cname(), dst->cname());
 
index bc92279..75636ad 100644 (file)
@@ -100,7 +100,7 @@ public:
 
 private:
   std::map<std::pair<NetPoint*, NetPoint*>, BypassRoute*> bypassRoutes_; // src x dst -> route
-  routing::NetPoint* netcard_ = nullptr;                                 // Our representative in the father NetZone
+  routing::NetPoint* netpoint_ = nullptr;                                // Our representative in the father NetZone
 };
 }
 }
index 7832bed..85b34ac 100644 (file)
@@ -20,21 +20,21 @@ namespace routing {
 namespace vivaldi {
 simgrid::xbt::Extension<NetPoint, Coords> Coords::EXTENSION_ID;
 
-Coords::Coords(NetPoint* netcard, const char* coordStr)
+Coords::Coords(NetPoint* netpoint, const char* coordStr)
 {
   if (!Coords::EXTENSION_ID.valid())
     Coords::EXTENSION_ID = NetPoint::extension_create<Coords>();
 
   std::vector<std::string> string_values;
   boost::split(string_values, coordStr, boost::is_any_of(" "));
-  xbt_assert(string_values.size() == 3, "Coordinates of %s must have 3 dimensions", netcard->cname());
+  xbt_assert(string_values.size() == 3, "Coordinates of %s must have 3 dimensions", netpoint->cname());
 
   for (auto str : string_values)
     coords.push_back(xbt_str_parse_double(str.c_str(), "Invalid coordinate: %s"));
   coords.shrink_to_fit();
 
-  netcard->extension_set<Coords>(this);
-  XBT_DEBUG("Coords of %s %p: %s", netcard->cname(), netcard, coordStr);
+  netpoint->extension_set<Coords>(this);
+  XBT_DEBUG("Coords of %s %p: %s", netpoint->cname(), netpoint, coordStr);
 }
 Coords::~Coords() = default;
 }; // namespace vivaldi
@@ -47,28 +47,28 @@ static inline double euclidean_dist_comp(int index, std::vector<double>* src, st
   return (src_coord - dst_coord) * (src_coord - dst_coord);
 }
 
-static std::vector<double>* getCoordsFromNetcard(NetPoint* nc)
+static std::vector<double>* getCoordsFromNetpoint(NetPoint* np)
 {
-  simgrid::kernel::routing::vivaldi::Coords* coords = nc->extension<simgrid::kernel::routing::vivaldi::Coords>();
+  simgrid::kernel::routing::vivaldi::Coords* coords = np->extension<simgrid::kernel::routing::vivaldi::Coords>();
   xbt_assert(coords, "Please specify the Vivaldi coordinates of %s %s (%p)",
-             (nc->isNetZone() ? "Netzone" : (nc->isHost() ? "Host" : "Router")), nc->cname(), nc);
+             (np->isNetZone() ? "Netzone" : (np->isHost() ? "Host" : "Router")), np->cname(), np);
   return &coords->coords;
 }
 VivaldiZone::VivaldiZone(NetZone* father, const char* name) : ClusterZone(father, name)
 {
 }
 
-void VivaldiZone::setPeerLink(NetPoint* netcard, double bw_in, double bw_out, const char* coord)
+void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, const char* coord)
 {
-  xbt_assert(netcard->netzone() == this, "Cannot add a peer link to a netcard that is not in this netzone");
+  xbt_assert(netpoint->netzone() == this, "Cannot add a peer link to a netpoint that is not in this netzone");
 
-  new simgrid::kernel::routing::vivaldi::Coords(netcard, coord);
+  new simgrid::kernel::routing::vivaldi::Coords(netpoint, coord);
 
-  std::string link_up   = "link_" + netcard->name() + "_UP";
-  std::string link_down = "link_" + netcard->name() + "_DOWN";
+  std::string link_up   = "link_" + netpoint->name() + "_UP";
+  std::string link_down = "link_" + netpoint->name() + "_DOWN";
   Link* linkUp          = surf_network_model->createLink(link_up.c_str(), bw_out, 0, SURF_LINK_SHARED);
   Link* linkDown        = surf_network_model->createLink(link_down.c_str(), bw_in, 0, SURF_LINK_SHARED);
-  privateLinks_.insert({netcard->id(), {linkUp, linkDown}});
+  privateLinks_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
 void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
@@ -102,8 +102,8 @@ void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cba
 
   /* Compute the extra latency due to the euclidean distance if needed */
   if (lat) {
-    std::vector<double>* srcCoords = getCoordsFromNetcard(src);
-    std::vector<double>* dstCoords = getCoordsFromNetcard(dst);
+    std::vector<double>* srcCoords = getCoordsFromNetpoint(src);
+    std::vector<double>* dstCoords = getCoordsFromNetpoint(dst);
 
     double euclidean_dist =
         sqrt(euclidean_dist_comp(0, srcCoords, dstCoords) + euclidean_dist_comp(1, srcCoords, dstCoords)) +
index e2a6e62..9b7c9ff 100644 (file)
@@ -47,7 +47,7 @@ class XBT_PRIVATE VivaldiZone : public ClusterZone {
 public:
   explicit VivaldiZone(NetZone* father, const char* name);
 
-  void setPeerLink(NetPoint* netcard, double bw_in, double bw_out, const char* coord);
+  void setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, const char* coord);
   void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
 };
 
index c354669..422fea8 100644 (file)
@@ -44,9 +44,9 @@ static int number_of_links = 1;
 static int number_of_networks = 1;
 static int port_number = 1025; //Port number is limited from 1025 to 65 000
 
-simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetCardNs3> NetCardNs3::EXTENSION_ID;
+simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetPointNs3> NetPointNs3::EXTENSION_ID;
 
-NetCardNs3::NetCardNs3()
+NetPointNs3::NetPointNs3()
 {
   ns3::Ptr<ns3::Node> node = ns3::CreateObject<ns3::Node>(0);
   stack.Install(node);
@@ -58,11 +58,6 @@ NetCardNs3::NetCardNs3()
  * Callbacks *
  *************/
 
-static void netcardCreation_cb(simgrid::kernel::routing::NetPoint* netcard)
-{
-  netcard->extension_set<NetCardNs3>(new NetCardNs3());
-}
-
 static void clusterCreation_cb(sg_platf_cluster_cbarg_t cluster)
 {
   char* lat = bprintf("%fs", cluster->lat);
@@ -70,12 +65,12 @@ static void clusterCreation_cb(sg_platf_cluster_cbarg_t cluster)
 
   for (int i : *cluster->radicals) {
     // Routers don't create a router on the other end of the private link by themselves.
-    // We just need this router to be given an ID so we create a temporary NetCardNS3 so that it gets one
-    NetCardNs3* host_dst = new NetCardNs3();
+    // We just need this router to be given an ID so we create a temporary NetPointNS3 so that it gets one
+    NetPointNs3* host_dst = new NetPointNs3();
 
     // Create private link
     char* host_id = bprintf("%s%d%s", cluster->prefix, i, cluster->suffix);
-    NetCardNs3* host_src = sg_host_by_name(host_id)->pimpl_netpoint->extension<NetCardNs3>();
+    NetPointNs3* host_src = sg_host_by_name(host_id)->pimpl_netpoint->extension<NetPointNs3>();
     xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id);
 
     ns3_add_link(host_src->node_num, host_dst->node_num, bw,lat);
@@ -110,8 +105,8 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
     XBT_DEBUG("\tLink (%s) bdw:%s lat:%s", link->getName(), link_bdw, link_lat);
 
     // create link ns3
-    NetCardNs3* host_src = src->extension<NetCardNs3>();
-    NetCardNs3* host_dst = dst->extension<NetCardNs3>();
+    NetPointNs3* host_src = src->extension<NetPointNs3>();
+    NetPointNs3* host_dst = dst->extension<NetPointNs3>();
 
     xbt_assert(host_src != nullptr, "Network element %s does not seem to be NS3-ready", src->cname());
     xbt_assert(host_dst != nullptr, "Network element %s does not seem to be NS3-ready", dst->cname());
@@ -154,11 +149,14 @@ namespace simgrid {
 namespace surf {
 
 NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
-  NetCardNs3::EXTENSION_ID = simgrid::kernel::routing::NetPoint::extension_create<NetCardNs3>();
+  NetPointNs3::EXTENSION_ID = simgrid::kernel::routing::NetPoint::extension_create<NetPointNs3>();
 
   ns3_initialize(ns3_tcp_model.get().c_str());
 
-  simgrid::kernel::routing::NetPoint::onCreation.connect(&netcardCreation_cb);
+  simgrid::kernel::routing::NetPoint::onCreation.connect([](simgrid::kernel::routing::NetPoint pt) {
+    pt->extension_set<NetPointNs3>(new NetPointNs3());
+
+  });
   simgrid::surf::on_cluster.connect(&clusterCreation_cb);
   simgrid::surf::on_postparse.connect(&postparse_cb);
   simgrid::s4u::NetZone::onRouteCreation.connect(&routeCreation_cb);
@@ -343,8 +341,8 @@ void ns3_simulator(double maxSeconds)
 void ns3_create_flow(simgrid::s4u::Host* src, simgrid::s4u::Host* dst, double startTime, u_int32_t TotalBytes,
                      simgrid::surf::NetworkNS3Action* action)
 {
-  int node1 = src->pimpl_netpoint->extension<NetCardNs3>()->node_num;
-  int node2 = dst->pimpl_netpoint->extension<NetCardNs3>()->node_num;
+  int node1 = src->pimpl_netpoint->extension<NetPointNs3>()->node_num;
+  int node2 = dst->pimpl_netpoint->extension<NetPointNs3>()->node_num;
 
   ns3::Ptr<ns3::Node> src_node = nodes.Get(node1);
   ns3::Ptr<ns3::Node> dst_node = nodes.Get(node2);
index 3a92354..4603ebc 100644 (file)
@@ -14,11 +14,11 @@ class NetworkNS3Action;
 }
 }
 
-class NetCardNs3 {
+class NetPointNs3 {
 public:
-  static simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetCardNs3> EXTENSION_ID;
+  static simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetPointNs3> EXTENSION_ID;
 
-  explicit NetCardNs3();
+  explicit NetPointNs3();
   int node_num;
 };
 
index 58fbe8c..e0bd47a 100644 (file)
@@ -105,16 +105,16 @@ simgrid::kernel::routing::NetPoint* sg_platf_new_router(const char* name, const
   xbt_assert(nullptr == simgrid::s4u::Engine::instance()->netpointByNameOrNull(name),
              "Refusing to create a router named '%s': this name already describes a node.", name);
 
-  simgrid::kernel::routing::NetPoint* netcard =
+  simgrid::kernel::routing::NetPoint* netpoint =
       new simgrid::kernel::routing::NetPoint(name, simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
-  XBT_DEBUG("Router '%s' has the id %d", name, netcard->id());
+  XBT_DEBUG("Router '%s' has the id %d", name, netpoint->id());
 
   if (coords && strcmp(coords, ""))
-    new simgrid::kernel::routing::vivaldi::Coords(netcard, coords);
+    new simgrid::kernel::routing::vivaldi::Coords(netpoint, coords);
 
   sg_instr_new_router(name);
 
-  return netcard;
+  return netpoint;
 }
 
 void sg_platf_new_link(sg_platf_link_cbarg_t link){
@@ -720,8 +720,8 @@ void sg_platf_new_AS_seal()
 /** @brief Add a link connecting an host to the rest of its AS (which must be cluster or vivaldi) */
 void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink)
 {
-  simgrid::kernel::routing::NetPoint* netcard = sg_host_by_name(hostlink->id)->pimpl_netpoint;
-  xbt_assert(netcard, "Host '%s' not found!", hostlink->id);
+  simgrid::kernel::routing::NetPoint* netpoint = sg_host_by_name(hostlink->id)->pimpl_netpoint;
+  xbt_assert(netpoint, "Host '%s' not found!", hostlink->id);
   xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
              "Only hosts from Cluster and Vivaldi ASes can get an host_link.");
 
@@ -733,11 +733,11 @@ void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink)
 
   auto as_cluster = static_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
 
-  if (as_cluster->privateLinks_.find(netcard->id()) != as_cluster->privateLinks_.end())
+  if (as_cluster->privateLinks_.find(netpoint->id()) != as_cluster->privateLinks_.end())
     surf_parse_error("Host_link for '%s' is already defined!",hostlink->id);
 
-  XBT_DEBUG("Push Host_link for host '%s' to position %d", netcard->cname(), netcard->id());
-  as_cluster->privateLinks_.insert({netcard->id(), {linkUp, linkDown}});
+  XBT_DEBUG("Push Host_link for host '%s' to position %d", netpoint->cname(), netpoint->id());
+  as_cluster->privateLinks_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
 void sg_platf_new_trace(sg_platf_trace_cbarg_t trace)
index 6644b52..6cfdd69 100644 (file)
@@ -42,7 +42,7 @@ static void check_disk_attachment()
     if (xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != nullptr) {
       simgrid::surf::Storage* storage =
           static_cast<simgrid::surf::Storage*>(xbt_lib_get_or_null(storage_lib, key, SURF_STORAGE_LEVEL));
-      simgrid::kernel::routing::NetPoint* host_elm = sg_netcard_by_name_or_null(storage->attach_);
+      simgrid::kernel::routing::NetPoint* host_elm = sg_netpoint_by_name_or_null(storage->attach_);
       if (!host_elm)
         surf_parse_error("Unable to attach storage %s: host %s does not exist.", storage->getName(), storage->attach_);
     }
index 017ce08..379c8f4 100644 (file)
@@ -81,10 +81,10 @@ typedef struct s_sg_platf_peer_cbarg {
 typedef struct s_sg_platf_route_cbarg *sg_platf_route_cbarg_t;
 typedef struct s_sg_platf_route_cbarg {
   bool symmetrical;
-  sg_netcard_t src;
-  sg_netcard_t dst;
-  sg_netcard_t gw_src;
-  sg_netcard_t gw_dst;
+  sg_netpoint_t src;
+  sg_netpoint_t dst;
+  sg_netpoint_t gw_src;
+  sg_netpoint_t gw_dst;
   std::vector<Link*> *link_list;
 } s_sg_platf_route_cbarg_t;
 
index 47cf277..e4df569 100644 (file)
@@ -723,48 +723,48 @@ void ETag_surfxml_backbone(){
 }
 
 void STag_surfxml_route(){
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_route_src),
-      "Route src='%s' does name a node.", A_surfxml_route_src);
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_route_dst),
-      "Route dst='%s' does name a node.", A_surfxml_route_dst);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_route_src), "Route src='%s' does name a node.",
+                    A_surfxml_route_src);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_route_dst), "Route dst='%s' does name a node.",
+                    A_surfxml_route_dst);
 }
 
 void STag_surfxml_ASroute(){
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_ASroute_src),
-      "ASroute src='%s' does name a node.", A_surfxml_route_src);
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_ASroute_dst),
-      "ASroute dst='%s' does name a node.", A_surfxml_route_dst);
-
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___src),
-      "ASroute gw_src='%s' does name a node.", A_surfxml_ASroute_gw___src);
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___dst),
-      "ASroute gw_dst='%s' does name a node.", A_surfxml_ASroute_gw___dst);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_ASroute_src), "ASroute src='%s' does name a node.",
+                    A_surfxml_route_src);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_ASroute_dst), "ASroute dst='%s' does name a node.",
+                    A_surfxml_route_dst);
+
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_ASroute_gw___src), "ASroute gw_src='%s' does name a node.",
+                    A_surfxml_ASroute_gw___src);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_ASroute_gw___dst), "ASroute gw_dst='%s' does name a node.",
+                    A_surfxml_ASroute_gw___dst);
 }
 
 void STag_surfxml_bypassRoute(){
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_bypassRoute_src),
-      "bypassRoute src='%s' does name a node.", A_surfxml_bypassRoute_src);
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_bypassRoute_dst),
-      "bypassRoute dst='%s' does name a node.", A_surfxml_bypassRoute_dst);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_src), "bypassRoute src='%s' does name a node.",
+                    A_surfxml_bypassRoute_src);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_dst), "bypassRoute dst='%s' does name a node.",
+                    A_surfxml_bypassRoute_dst);
 }
 
 void STag_surfxml_bypassASroute(){
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_bypassASroute_src),
-      "bypassASroute src='%s' does name a node.", A_surfxml_bypassASroute_src);
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_bypassASroute_dst),
-      "bypassASroute dst='%s' does name a node.", A_surfxml_bypassASroute_dst);
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_bypassASroute_gw___src),
-      "bypassASroute gw_src='%s' does name a node.", A_surfxml_bypassASroute_gw___src);
-  surf_parse_assert(sg_netcard_by_name_or_null(A_surfxml_bypassASroute_gw___dst),
-      "bypassASroute gw_dst='%s' does name a node.", A_surfxml_bypassASroute_gw___dst);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_bypassASroute_src),
+                    "bypassASroute src='%s' does name a node.", A_surfxml_bypassASroute_src);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_bypassASroute_dst),
+                    "bypassASroute dst='%s' does name a node.", A_surfxml_bypassASroute_dst);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_bypassASroute_gw___src),
+                    "bypassASroute gw_src='%s' does name a node.", A_surfxml_bypassASroute_gw___src);
+  surf_parse_assert(sg_netpoint_by_name_or_null(A_surfxml_bypassASroute_gw___dst),
+                    "bypassASroute gw_dst='%s' does name a node.", A_surfxml_bypassASroute_gw___dst);
 }
 
 void ETag_surfxml_route(){
   s_sg_platf_route_cbarg_t route;
   memset(&route,0,sizeof(route));
 
-  route.src       = sg_netcard_by_name_or_null(A_surfxml_route_src); // tested to not be nullptr in start tag
-  route.dst       = sg_netcard_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
+  route.src         = sg_netpoint_by_name_or_null(A_surfxml_route_src); // tested to not be nullptr in start tag
+  route.dst         = sg_netpoint_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
   route.gw_src    = nullptr;
   route.gw_dst    = nullptr;
   route.link_list = new std::vector<Link*>();
@@ -782,11 +782,11 @@ void ETag_surfxml_ASroute(){
   s_sg_platf_route_cbarg_t ASroute;
   memset(&ASroute,0,sizeof(ASroute));
 
-  ASroute.src    = sg_netcard_by_name_or_null(A_surfxml_ASroute_src); // tested to not be nullptr in start tag
-  ASroute.dst    = sg_netcard_by_name_or_null(A_surfxml_ASroute_dst); // tested to not be nullptr in start tag
+  ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_ASroute_src); // tested to not be nullptr in start tag
+  ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_ASroute_dst); // tested to not be nullptr in start tag
 
-  ASroute.gw_src = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___src); // tested to not be nullptr in start tag
-  ASroute.gw_dst = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___dst); // tested to not be nullptr in start tag
+  ASroute.gw_src = sg_netpoint_by_name_or_null(A_surfxml_ASroute_gw___src); // tested to not be nullptr in start tag
+  ASroute.gw_dst = sg_netpoint_by_name_or_null(A_surfxml_ASroute_gw___dst); // tested to not be nullptr in start tag
 
   ASroute.link_list =  new std::vector<Link*>();
 
@@ -812,8 +812,8 @@ void ETag_surfxml_bypassRoute(){
   s_sg_platf_route_cbarg_t route;
   memset(&route,0,sizeof(route));
 
-  route.src = sg_netcard_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be nullptr in start tag
-  route.dst = sg_netcard_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be nullptr in start tag
+  route.src         = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be nullptr in start tag
+  route.dst         = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be nullptr in start tag
   route.gw_src = nullptr;
   route.gw_dst = nullptr;
   route.symmetrical = false;
@@ -830,8 +830,8 @@ void ETag_surfxml_bypassASroute(){
   s_sg_platf_route_cbarg_t ASroute;
   memset(&ASroute,0,sizeof(ASroute));
 
-  ASroute.src         = sg_netcard_by_name_or_null(A_surfxml_bypassASroute_src);
-  ASroute.dst         = sg_netcard_by_name_or_null(A_surfxml_bypassASroute_dst);
+  ASroute.src         = sg_netpoint_by_name_or_null(A_surfxml_bypassASroute_src);
+  ASroute.dst         = sg_netpoint_by_name_or_null(A_surfxml_bypassASroute_dst);
   ASroute.link_list   = new std::vector<Link*>();
   for (auto link: parsed_link_list)
     ASroute.link_list->push_back(link);
@@ -839,8 +839,8 @@ void ETag_surfxml_bypassASroute(){
 
   ASroute.symmetrical = false;
 
-  ASroute.gw_src = sg_netcard_by_name_or_null(A_surfxml_bypassASroute_gw___src);
-  ASroute.gw_dst = sg_netcard_by_name_or_null(A_surfxml_bypassASroute_gw___dst);
+  ASroute.gw_src = sg_netpoint_by_name_or_null(A_surfxml_bypassASroute_gw___src);
+  ASroute.gw_dst = sg_netpoint_by_name_or_null(A_surfxml_bypassASroute_gw___dst);
 
   sg_platf_new_bypassRoute(&ASroute);
 }