Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
one more class in platform creation
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 12 Jan 2018 09:05:37 +0000 (10:05 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 12 Jan 2018 09:05:37 +0000 (10:05 +0100)
24 files changed:
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/ClusterZone.hpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DijkstraZone.hpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/DragonflyZone.hpp
src/kernel/routing/EmptyZone.hpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FatTreeZone.hpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FloydZone.hpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/FullZone.hpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/NetZoneImpl.hpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/RoutedZone.hpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/TorusZone.hpp
src/kernel/routing/VivaldiZone.cpp
src/kernel/routing/VivaldiZone.hpp
src/surf/sg_platf.cpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_sax_cb.cpp

index ad30187..2bd40cd 100644 (file)
@@ -20,7 +20,7 @@ ClusterZone::ClusterZone(NetZone* father, std::string name) : NetZoneImpl(father
 {
 }
 
-void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
+void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
 {
   XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
   xbt_assert(not privateLinks_.empty(),
index 376747e..bb1eb03 100644 (file)
@@ -69,7 +69,7 @@ class XBT_PRIVATE ClusterZone : public NetZoneImpl {
 public:
   explicit ClusterZone(NetZone* father, std::string name);
 
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
                 std::map<std::string, xbt_edge_t>* edges) override;
 
index 5fe8bd7..214a02f 100644 (file)
@@ -17,14 +17,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf
 
 static void graph_node_data_free(void* n)
 {
-  graph_node_data_t data = static_cast<graph_node_data_t>(n);
-  delete data;
+  delete static_cast<graph_node_data_t>(n);
 }
 
 static void graph_edge_data_free(void* e)
 {
-  sg_platf_route_cbarg_t e_route = static_cast<sg_platf_route_cbarg_t>(e);
-  delete e_route;
+  delete static_cast<RouteCreationArgs*>(e);
 }
 
 /* Utility functions */
@@ -56,7 +54,7 @@ void DijkstraZone::seal()
       }
 
       if (not found) {
-        sg_platf_route_cbarg_t e_route = new s_sg_platf_route_cbarg_t;
+        RouteCreationArgs* e_route = new RouteCreationArgs();
         e_route->link_list.push_back(surf_network_model->loopback_);
         xbt_graph_new_edge(routeGraph_, node, node, e_route);
       }
@@ -92,7 +90,7 @@ xbt_node_t DijkstraZone::nodeMapSearch(int id)
 
 /* Parsing */
 
-void DijkstraZone::newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route)
+void DijkstraZone::newRoute(int src_id, int dst_id, RouteCreationArgs* e_route)
 {
   XBT_DEBUG("Load Route from \"%d\" to \"%d\"", src_id, dst_id);
   xbt_node_t src = nullptr;
@@ -124,7 +122,7 @@ void DijkstraZone::newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_rou
   xbt_graph_new_edge(routeGraph_, src, dst, e_route);
 }
 
-void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
+void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
 {
   getRouteCheckParams(src, dst);
   int src_id = src->id();
@@ -149,7 +147,7 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
     if (edge == nullptr)
       THROWF(arg_error, 0, "No route from '%s' to '%s'", src->getCname(), dst->getCname());
 
-    sg_platf_route_cbarg_t e_route = static_cast<sg_platf_route_cbarg_t>(xbt_graph_edge_get_data(edge));
+    RouteCreationArgs* e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
 
     for (auto const& link : e_route->link_list) {
       route->link_list.insert(route->link_list.begin(), link);
@@ -194,7 +192,7 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
         xbt_node_t u_node                  = xbt_graph_edge_get_target(edge);
         graph_node_data_t data             = static_cast<graph_node_data_t>(xbt_graph_node_get_data(u_node));
         int u_id                           = data->graph_id;
-        sg_platf_route_cbarg_t tmp_e_route = static_cast<sg_platf_route_cbarg_t>(xbt_graph_edge_get_data(edge));
+        RouteCreationArgs* tmp_e_route     = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
         int cost_v_u                       = tmp_e_route->link_list.size(); /* count of links, old model assume 1 */
 
         if (cost_v_u + cost_arr[v_id] < cost_arr[u_id]) {
@@ -219,7 +217,7 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
     if (edge == nullptr)
       THROWF(arg_error, 0, "No route from '%s' to '%s'", src->getCname(), dst->getCname());
 
-    sg_platf_route_cbarg_t e_route = static_cast<sg_platf_route_cbarg_t>(xbt_graph_edge_get_data(edge));
+    RouteCreationArgs* e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
 
     NetPoint* prev_gw_src          = gw_src;
     gw_src                         = e_route->gw_src;
@@ -287,7 +285,7 @@ void DijkstraZone::addRoute(kernel::routing::NetPoint* src, kernel::routing::Net
    * nodes */
 
   /* Add the route to the base */
-  sg_platf_route_cbarg_t e_route = newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 1);
+  RouteCreationArgs* e_route = newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 1);
   newRoute(src->id(), dst->id(), e_route);
 
   // Symmetrical YES
@@ -314,7 +312,7 @@ void DijkstraZone::addRoute(kernel::routing::NetPoint* src, kernel::routing::Net
       gw_src           = gw_dst;
       gw_dst           = gw_tmp;
     }
-    sg_platf_route_cbarg_t link_route_back =
+    RouteCreationArgs* link_route_back =
         newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 0);
     newRoute(dst->id(), src->id(), link_route_back);
   }
index 0f7f10d..001eb42 100644 (file)
@@ -38,7 +38,7 @@ public:
   ~DijkstraZone() override;
   xbt_node_t routeGraphNewNode(int id, int graph_id);
   xbt_node_t nodeMapSearch(int id);
-  void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route);
+  void newRoute(int src_id, int dst_id, RouteCreationArgs* e_route);
   /* For each vertex (node) already in the graph,
    * make sure it also has a loopback link; this loopback
    * can potentially already be in the graph, and in that
@@ -50,7 +50,7 @@ public:
    * After this function returns, any node in the graph
    * will have a loopback attached to it.
    */
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) override;
   void addRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
                 std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) override;
 
index d6eecc5..cc72704 100644 (file)
@@ -260,7 +260,7 @@ void DragonflyZone::generateLinks()
   }
 }
 
-void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* latency)
+void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* latency)
 {
   // Minimal routing version.
   // TODO : non-minimal random one, and adaptive ?
index fd63be5..111908b 100644 (file)
@@ -63,7 +63,7 @@ public:
   explicit DragonflyZone(NetZone* father, std::string name);
   ~DragonflyZone() override;
   //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void parse_specific_arguments(ClusterCreationArgs* cluster) override;
   void seal() override;
   void generateRouters();
index 6d479b8..2ec0d85 100644 (file)
@@ -24,7 +24,7 @@ public:
   explicit EmptyZone(NetZone* father, std::string name);
   ~EmptyZone() override;
 
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override
   {
     /* There can't be route in an Empty zone */
   }
index 16e2798..9b34a4d 100644 (file)
@@ -56,7 +56,7 @@ bool FatTreeZone::isInSubTree(FatTreeNode* root, FatTreeNode* node)
   return true;
 }
 
-void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency)
+void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency)
 {
 
   if (dst->isRouter() || src->isRouter())
index 7e329b6..73e313a 100644 (file)
@@ -100,7 +100,7 @@ class XBT_PRIVATE FatTreeZone : public ClusterZone {
 public:
   explicit FatTreeZone(NetZone* father, std::string name);
   ~FatTreeZone() override;
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
 
   /** \brief Generate the fat tree
    *
index 9eca6d6..3095394 100644 (file)
@@ -43,14 +43,14 @@ FloydZone::~FloydZone()
   delete[] costTable_;
 }
 
-void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
+void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
 {
   unsigned int table_size = getTableSize();
 
   getRouteCheckParams(src, dst);
 
   /* create a result route */
-  std::vector<sg_platf_route_cbarg_t> route_stack;
+  std::vector<RouteCreationArgs*> route_stack;
   unsigned int cur = dst->id();
   do {
     int pred = TO_FLOYD_PRED(src->id(), cur);
@@ -67,7 +67,7 @@ void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
 
   sg_netpoint_t prev_dst_gw = nullptr;
   while (not route_stack.empty()) {
-    sg_platf_route_cbarg_t e_route = route_stack.back();
+    RouteCreationArgs* e_route = route_stack.back();
     route_stack.pop_back();
     if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr &&
         prev_dst_gw->getCname() != e_route->gw_src->getCname()) {
@@ -97,7 +97,7 @@ void FloydZone::addRoute(kernel::routing::NetPoint* src, kernel::routing::NetPoi
     /* Create Cost, Predecessor and Link tables */
     costTable_        = new double[table_size * table_size];                 /* link cost from host to host */
     predecessorTable_ = new int[table_size * table_size];                    /* predecessor host numbers */
-    linkTable_        = new sg_platf_route_cbarg_t[table_size * table_size]; /* actual link between src and dst */
+    linkTable_        = new RouteCreationArgs*[table_size * table_size];     /* actual link between src and dst */
 
     /* Initialize costs and predecessors */
     for (unsigned int i = 0; i < table_size; i++)
@@ -163,7 +163,7 @@ void FloydZone::seal()
     /* Create Cost, Predecessor and Link tables */
     costTable_        = new double[table_size * table_size];                 /* link cost from host to host */
     predecessorTable_ = new int[table_size * table_size];                    /* predecessor host numbers */
-    linkTable_        = new sg_platf_route_cbarg_t[table_size * table_size]; /* actual link between src and dst */
+    linkTable_        = new RouteCreationArgs*[table_size * table_size];     /* actual link between src and dst */
 
     /* Initialize costs and predecessors */
     for (unsigned int i = 0; i < table_size; i++)
@@ -177,11 +177,9 @@ void FloydZone::seal()
   /* Add the loopback if needed */
   if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
     for (unsigned int i = 0; i < table_size; i++) {
-      sg_platf_route_cbarg_t e_route = TO_FLOYD_LINK(i, i);
+      RouteCreationArgs* e_route = TO_FLOYD_LINK(i, i);
       if (not e_route) {
-        e_route            = new s_sg_platf_route_cbarg_t;
-        e_route->gw_src    = nullptr;
-        e_route->gw_dst    = nullptr;
+        e_route = new RouteCreationArgs();
         e_route->link_list.push_back(surf_network_model->loopback_);
         TO_FLOYD_LINK(i, i) = e_route;
         TO_FLOYD_PRED(i, i) = i;
index 69ead53..c7479c2 100644 (file)
@@ -26,7 +26,7 @@ public:
   explicit FloydZone(NetZone* father, std::string name);
   ~FloydZone() override;
 
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   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) override;
@@ -36,7 +36,7 @@ private:
   /* vars to compute the Floyd algorithm. */
   int* predecessorTable_;
   double* costTable_;
-  sg_platf_route_cbarg_t* linkTable_;
+  RouteCreationArgs** linkTable_;
 };
 }
 }
index bedc0cf..ddcaf3d 100644 (file)
@@ -24,16 +24,14 @@ void FullZone::seal()
 
   /* Create table if needed */
   if (not routingTable_)
-    routingTable_ = new sg_platf_route_cbarg_t[table_size * table_size]();
+    routingTable_ = new RouteCreationArgs*[table_size * table_size]();
 
   /* Add the loopback if needed */
   if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
     for (unsigned int i = 0; i < table_size; i++) {
-      sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(i, i);
+      RouteCreationArgs* e_route = TO_ROUTE_FULL(i, i);
       if (not e_route) {
-        e_route            = new s_sg_platf_route_cbarg_t;
-        e_route->gw_src    = nullptr;
-        e_route->gw_dst    = nullptr;
+        e_route = new RouteCreationArgs();
         e_route->link_list.push_back(surf_network_model->loopback_);
         TO_ROUTE_FULL(i, i) = e_route;
       }
@@ -53,12 +51,12 @@ FullZone::~FullZone()
   }
 }
 
-void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t res, double* lat)
+void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* res, double* lat)
 {
   XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
 
   unsigned int table_size        = getTableSize();
-  sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(src->id(), dst->id());
+  RouteCreationArgs* e_route     = TO_ROUTE_FULL(src->id(), dst->id());
 
   if (e_route != nullptr) {
     res->gw_src = e_route->gw_src;
@@ -80,7 +78,7 @@ void FullZone::addRoute(kernel::routing::NetPoint* src, kernel::routing::NetPoin
   unsigned int table_size = getTableSize();
 
   if (not routingTable_)
-    routingTable_ = new sg_platf_route_cbarg_t[table_size * table_size]();
+    routingTable_ = new RouteCreationArgs*[table_size * table_size]();
 
   /* Check that the route does not already exist */
   if (gw_dst) // inter-zone route (to adapt the error message, if any)
index d40709d..d92e444 100644 (file)
@@ -24,12 +24,12 @@ public:
   void seal() override;
   ~FullZone() override;
 
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   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) override;
 
-  sg_platf_route_cbarg_t* routingTable_ = nullptr;
+  RouteCreationArgs** routingTable_ = nullptr;
 };
 }
 }
index 3094695..775bff4 100644 (file)
@@ -314,7 +314,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
 void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
                                  /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
 {
-  s_sg_platf_route_cbarg_t route;
+  RouteCreationArgs route;
 
   XBT_DEBUG("Resolve route from '%s' to '%s'", src->getCname(), dst->getCname());
 
index 4a3e5ec..83ec1f8 100644 (file)
@@ -74,7 +74,7 @@ protected:
    * @param into Container into which the traversed links and gateway informations should be pushed
    * @param latency Accumulator in which the latencies should be added (caller must set it to 0)
    */
-  virtual void getLocalRoute(NetPoint * src, NetPoint * dst, sg_platf_route_cbarg_t into, double* latency) = 0;
+  virtual void getLocalRoute(NetPoint * src, NetPoint * dst, RouteCreationArgs * into, double* latency) = 0;
   /** @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 getBypassRoute(routing::NetPoint * src, routing::NetPoint * dst,
index 6d41cbc..5c573be 100644 (file)
@@ -73,7 +73,7 @@ void RoutedZone::getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>*
       if (my_src == my_dst)
         continue;
 
-      sg_platf_route_cbarg_t route = new s_sg_platf_route_cbarg_t;
+      RouteCreationArgs* route = new RouteCreationArgs();
 
       getLocalRoute(my_src, my_dst, route, nullptr);
 
@@ -120,12 +120,11 @@ void RoutedZone::getGraph(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 */
-sg_platf_route_cbarg_t RoutedZone::newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst,
-                                                    NetPoint* gw_src, NetPoint* gw_dst,
-                                                    std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical,
-                                                    bool change_order)
+RouteCreationArgs* RoutedZone::newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
+                                                NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
+                                                bool symmetrical, bool change_order)
 {
-  sg_platf_route_cbarg_t result = new s_sg_platf_route_cbarg_t;
+  RouteCreationArgs* result = new RouteCreationArgs();
 
   xbt_assert(hierarchy == RoutingMode::base || hierarchy == RoutingMode::recursive,
              "The hierarchy of this netzone is neither BASIC nor RECURSIVE, I'm lost here.");
index c1117fc..1a874b0 100644 (file)
@@ -54,9 +54,9 @@ public:
 
   void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
                 std::map<std::string, xbt_edge_t>* edges) override;
-  virtual sg_platf_route_cbarg_t newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
-                                                  NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
-                                                  bool symmetrical, bool change_order);
+  virtual RouteCreationArgs* newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
+                                              NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
+                                              bool symmetrical, bool change_order);
 
 protected:
   void getRouteCheckParams(NetPoint* src, NetPoint* dst);
index c9d1636..03ba0a6 100644 (file)
@@ -91,7 +91,7 @@ void TorusZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   }
 }
 
-void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
+void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
 {
 
   XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
index 0cdad3d..ac04e68 100644 (file)
@@ -22,7 +22,7 @@ class XBT_PRIVATE TorusZone : public ClusterZone {
 public:
   explicit TorusZone(NetZone* father, std::string name);
   void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position) override;
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void parse_specific_arguments(ClusterCreationArgs* cluster) override;
 
 private:
index 3d78b3a..5a0cfd4 100644 (file)
@@ -75,7 +75,7 @@ void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, s
   privateLinks_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
-void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
+void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
 {
   XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
 
index 64ea9bd..794fe7a 100644 (file)
@@ -48,7 +48,7 @@ public:
   explicit VivaldiZone(NetZone* father, std::string name);
 
   void setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, std::string coord);
-  void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
 };
 
 namespace vivaldi {
index c01a8d8..f451fad 100644 (file)
@@ -397,13 +397,13 @@ void sg_platf_new_mount(MountCreationArgs* mount)
   mount_list.insert({mount->name, simgrid::surf::StorageImpl::byName(mount->storageId.c_str())});
 }
 
-void sg_platf_new_route(sg_platf_route_cbarg_t route)
+void sg_platf_new_route(RouteCreationArgs* route)
 {
   routing_get_current()->addRoute(route->src, route->dst, route->gw_src, route->gw_dst, route->link_list,
                                   route->symmetrical);
 }
 
-void sg_platf_new_bypassRoute(sg_platf_route_cbarg_t bypassRoute)
+void sg_platf_new_bypassRoute(RouteCreationArgs* bypassRoute)
 {
   routing_get_current()->addBypassRoute(bypassRoute->src, bypassRoute->dst, bypassRoute->gw_src, bypassRoute->gw_dst,
                                         bypassRoute->link_list, bypassRoute->symmetrical);
index 3a6f7b0..48ed849 100644 (file)
@@ -83,7 +83,8 @@ public:
   tmgr_trace_t state_trace;
 };
 
-struct s_sg_platf_route_cbarg_t {
+class RouteCreationArgs {
+public:
   bool symmetrical     = false;
   sg_netpoint_t src    = nullptr;
   sg_netpoint_t dst    = nullptr;
@@ -91,7 +92,6 @@ struct s_sg_platf_route_cbarg_t {
   sg_netpoint_t gw_dst = nullptr;
   std::vector<simgrid::surf::LinkImpl*> link_list;
 };
-typedef s_sg_platf_route_cbarg_t* sg_platf_route_cbarg_t;
 
 class ClusterCreationArgs {
 public:
@@ -207,8 +207,8 @@ XBT_PUBLIC(void) sg_platf_new_cabinet(CabinetCreationArgs* cabinet);   // Add a
 XBT_PUBLIC(simgrid::kernel::routing::NetPoint*)                        // Add a router    to the current Zone
 sg_platf_new_router(std::string, const char* coords);
 
-XBT_PUBLIC(void) sg_platf_new_route (sg_platf_route_cbarg_t route); // Add a route
-XBT_PUBLIC(void) sg_platf_new_bypassRoute (sg_platf_route_cbarg_t bypassroute); // Add a bypassRoute
+XBT_PUBLIC(void) sg_platf_new_route(RouteCreationArgs* route);             // Add a route
+XBT_PUBLIC(void) sg_platf_new_bypassRoute(RouteCreationArgs* bypassroute); // Add a bypassRoute
 
 XBT_PUBLIC(void) sg_platf_new_trace(TraceCreationArgs* trace);
 
index 272755c..fdb04ed 100644 (file)
@@ -692,7 +692,7 @@ void STag_surfxml_bypassZoneRoute(){
 }
 
 void ETag_surfxml_route(){
-  s_sg_platf_route_cbarg_t route;
+  RouteCreationArgs route;
 
   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
@@ -716,7 +716,7 @@ void ETag_surfxml_ASroute()
 }
 void ETag_surfxml_zoneRoute()
 {
-  s_sg_platf_route_cbarg_t ASroute;
+  RouteCreationArgs ASroute;
 
   ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_src); // tested to not be nullptr in start tag
   ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_dst); // tested to not be nullptr in start tag
@@ -742,7 +742,7 @@ void ETag_surfxml_zoneRoute()
 }
 
 void ETag_surfxml_bypassRoute(){
-  s_sg_platf_route_cbarg_t route;
+  RouteCreationArgs route;
 
   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
@@ -765,7 +765,7 @@ void ETag_surfxml_bypassASroute()
 }
 void ETag_surfxml_bypassZoneRoute()
 {
-  s_sg_platf_route_cbarg_t ASroute;
+  RouteCreationArgs ASroute;
 
   ASroute.src         = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_src);
   ASroute.dst         = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_dst);