Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
some simple cleanups in the routing code
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 13 Jan 2016 23:01:00 +0000 (00:01 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 13 Jan 2016 23:38:23 +0000 (00:38 +0100)
Overrides where needed, initialize the fields at declaration, kill
dead comments and dupplicated fields. As usual.

Muuuuch more cleanups to come in that area.

19 files changed:
src/include/surf/surf.h
src/surf/network_ns3.cpp
src/surf/sg_platf.cpp
src/surf/surf_routing.cpp
src/surf/surf_routing.hpp
src/surf/surf_routing_cluster.cpp
src/surf/surf_routing_cluster.hpp
src/surf/surf_routing_cluster_fat_tree.hpp
src/surf/surf_routing_dijkstra.cpp
src/surf/surf_routing_dijkstra.hpp
src/surf/surf_routing_floyd.hpp
src/surf/surf_routing_full.cpp
src/surf/surf_routing_full.hpp
src/surf/surf_routing_generic.cpp
src/surf/surf_routing_generic.hpp
src/surf/surf_routing_none.cpp
src/surf/surf_routing_none.hpp
src/surf/surf_routing_vivaldi.cpp
src/surf/surf_routing_vivaldi.hpp

index d6cd014..275ac07 100644 (file)
@@ -35,10 +35,10 @@ extern XBT_PRIVATE int sg_network_crosstraffic;
 extern XBT_PRIVATE xbt_dynar_t surf_path;
 
 typedef enum {
-  SURF_NETWORK_ELEMENT_NULL = 0,        /* NULL */
-  SURF_NETWORK_ELEMENT_HOST,    /* host type */
-  SURF_NETWORK_ELEMENT_ROUTER,  /* router type */
-  SURF_NETWORK_ELEMENT_AS       /* AS type */
+  SURF_NETWORK_ELEMENT_NULL = 0, /* NULL */
+  SURF_NETWORK_ELEMENT_HOST,     /* host type */
+  SURF_NETWORK_ELEMENT_ROUTER,   /* router type */
+  SURF_NETWORK_ELEMENT_AS        /* AS type */
 } e_surf_network_element_type_t;
 
 #ifdef __cplusplus
index 67576e0..8649f82 100644 (file)
@@ -231,7 +231,7 @@ static void parse_ns3_end_platform(void)
 static void define_callbacks_ns3(void)
 {
   simgrid::s4u::Host::onCreation.connect(simgrid_ns3_add_host);
-  simgrid::surf::routingEdgeCreatedCallbacks.connect(simgrid_ns3_add_router);
+  simgrid::surf::netcardCreatedCallbacks.connect(simgrid_ns3_add_router);
   sg_platf_link_add_cb (&parse_ns3_add_link);
   sg_platf_cluster_add_cb (&parse_ns3_add_cluster);
   simgrid::surf::asCreatedCallbacks.connect(parse_ns3_add_AS);
index 09f9f45..a42a5d2 100644 (file)
@@ -95,7 +95,7 @@ void sg_platf_new_router(sg_platf_router_cbarg_t router)
   info->setId(current_routing->parsePU(info));
   xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, (void *) info);
   XBT_DEBUG("Having set name '%s' id '%d'", router->id, info->getId());
-  simgrid::surf::routingEdgeCreatedCallbacks(info);
+  simgrid::surf::netcardCreatedCallbacks(info);
 
   if (router->coord && strcmp(router->coord, "")) {
     unsigned int cursor;
index 71d2e46..b9a584f 100644 (file)
@@ -23,7 +23,7 @@
 namespace simgrid {
 namespace surf {
 
-simgrid::xbt::signal<void(simgrid::surf::NetCard*)> routingEdgeCreatedCallbacks;
+simgrid::xbt::signal<void(simgrid::surf::NetCard*)> netcardCreatedCallbacks;
 simgrid::xbt::signal<void(simgrid::surf::As*)> asCreatedCallbacks;
 
 }
@@ -61,7 +61,7 @@ simgrid::surf::NetCard *sg_netcard_by_name_or_null(const char *name)
   sg_host_t h = sg_host_by_name(name);
   simgrid::surf::NetCard *net_elm = h==NULL?NULL: h->pimpl_netcard;
   if (!net_elm)
-       net_elm = (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
+    net_elm = (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
   return net_elm;
 }
 
@@ -172,7 +172,7 @@ simgrid::surf::NetCard *routing_add_host(
   sg_host_t h = sg_host_by_name_or_create(host->id);
   h->pimpl_netcard = netcard;
   XBT_DEBUG("Having set name '%s' id '%d'", host->id, netcard->getId());
-  simgrid::surf::routingEdgeCreatedCallbacks(netcard);
+  simgrid::surf::netcardCreatedCallbacks(netcard);
 
   if(mount_list){
     xbt_lib_set(storage_lib, host->id, ROUTING_STORAGE_HOST_LEVEL, (void *) mount_list);
@@ -339,9 +339,9 @@ void routing_AS_begin(sg_platf_AS_cbarg_t AS)
 
   /* set the new current component of the tree */
   current_routing = new_as;
-  current_routing->p_netElem = info;
+  current_routing->p_netcard = info;
 
-  simgrid::surf::routingEdgeCreatedCallbacks(info);
+  simgrid::surf::netcardCreatedCallbacks(info);
   simgrid::surf::asCreatedCallbacks(new_as);
 }
 
@@ -495,10 +495,10 @@ static void _get_route_and_latency(
 
   route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
   // Find the net_card corresponding to father
-  simgrid::surf::NetCard *src_father_net_elm = src_father->p_netElem;
-  simgrid::surf::NetCard *dst_father_net_elm = dst_father->p_netElem;
+  simgrid::surf::NetCard *src_father_netcard = src_father->p_netcard;
+  simgrid::surf::NetCard *dst_father_netcard = dst_father->p_netcard;
 
-  common_father->getRouteAndLatency(src_father_net_elm, dst_father_net_elm,
+  common_father->getRouteAndLatency(src_father_netcard, dst_father_netcard,
                                     &route, latency);
 
   xbt_assert((route.gw_src != NULL) && (route.gw_dst != NULL),
@@ -516,7 +516,6 @@ static void _get_route_and_latency(
   if (dst_gateway_net_elm != dst)
     _get_route_and_latency(dst_gateway_net_elm, dst, links, latency);
 
-  // if vivaldi latency+=vivaldi(src_gateway,dst_gateway)
 }
 
 AS_t surf_platf_get_root(routing_platf_t platf){
@@ -544,12 +543,10 @@ namespace surf {
  * walk through the routing components tree and find a route between hosts
  * by calling each "get_route" function in each routing component.
  */
-void RoutingPlatf::getRouteAndLatency(
-  simgrid::surf::NetCard *src, simgrid::surf::NetCard *dst,
-  xbt_dynar_t* route, double *latency)
+void RoutingPlatf::getRouteAndLatency(NetCard *src, NetCard *dst, xbt_dynar_t* route, double *latency)
 {
   XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName());
-  if (!*route) {
+  if (NULL == *route) {
     xbt_dynar_reset(routing_platf->p_lastRoute);
     *route = routing_platf->p_lastRoute;
   }
index 600edf1..c380129 100644 (file)
@@ -55,7 +55,7 @@ public:
   char *p_name = nullptr;
   As *p_routingFather = nullptr;
   xbt_dict_t p_routingSons = xbt_dict_new_homogeneous(NULL);
-  NetCard *p_netElem;
+  NetCard *p_netcard;
   xbt_dynar_t p_linkUpDownList = NULL;
 
   /**
@@ -71,8 +71,8 @@ public:
     xbt_dynar_free(&p_indexNetworkElm);
     xbt_dynar_free(&p_linkUpDownList);
     xbt_free(p_name);
-    if (p_netElem)
-      delete p_netElem;
+    if (p_netcard)
+      delete p_netcard;
   };
 
   /**
@@ -161,7 +161,7 @@ public:
  * Callbacks *
  *************/
 
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(NetCard*)>) routingEdgeCreatedCallbacks;
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(NetCard*)>) netcardCreatedCallbacks;
 XBT_PUBLIC_DATA(simgrid::xbt::signal<void(As*)>) asCreatedCallbacks;
 
 }
index 4c92419..6c284fc 100644 (file)
@@ -21,17 +21,6 @@ AS_t model_cluster_create(void)
 namespace simgrid {
 namespace surf {
 
-/* Creation routing model functions */
-AsCluster::AsCluster() : AsNone()
-{
-  p_backbone = 0;
-  p_loopback = 0;
-  p_router = 0;
-  p_has_limiter = 0;
-  p_has_loopback = 0;
-  p_nb_links_per_node = 1;
-}
-
 /* Business methods */
 void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat)
 {
index 4cdb430..ce935c5 100644 (file)
@@ -26,29 +26,21 @@ class XBT_PRIVATE AsCluster;
 
 class AsCluster: public AsNone {
 public:
-  AsCluster();
-
-  virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency);
-  //xbt_dynar_t getOneLinkRoutes();
-  //void parseRoute(sg_platf_route_cbarg_t route);
-  //void parseASroute(sg_platf_route_cbarg_t route);
-
-  void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
-
-  /* The parser calls the following functions to inform the routing models
-   * that a new element is added to the AS currently built.
-   *
-   * Of course, only the routing model of this AS is informed, not every ones */
-  int parsePU(NetCard *elm); /* A host or a router, whatever */
-  int parseAS(NetCard *elm);
+  AsCluster() {}
+
+  virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
+  void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
+
+  int parsePU(NetCard *elm) override; /* A host or a router, whatever */
+  int parseAS(NetCard *elm) override;
   virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
-  Link* p_backbone;
-  void *p_loopback;
-  NetCard *p_router;
-  int p_has_limiter;
-  int p_has_loopback;
-  int p_nb_links_per_node;
+
+  Link* p_backbone = nullptr;
+  void *p_loopback = nullptr;
+  NetCard *p_router = nullptr;
+  int p_has_limiter = 0;
+  int p_has_loopback = 0;
+  int p_nb_links_per_node = 1;
 
 };
 
index 3025387..9b5d887 100644 (file)
@@ -80,17 +80,13 @@ class FatTreeLink {
 public:
   FatTreeLink(sg_platf_cluster_cbarg_t cluster, FatTreeNode *source,
               FatTreeNode *destination);
-  /** Link going up in the tree
-   */
+  /** Link going up in the tree */
   Link *upLink; 
-  /** Link going down in the tree
-   */
+  /** Link going down in the tree */
   Link *downLink;
-  /** Upper end of the link
-   */
+  /** Upper end of the link */
   FatTreeNode *upNode;
-  /** Lower end of the link
-   */
+  /** Lower end of the link */
   FatTreeNode *downNode;
 };
 
@@ -121,7 +117,7 @@ public:
   ~AsClusterFatTree();
   virtual void getRouteAndLatency(NetCard *src, NetCard *dst,
                                   sg_platf_route_cbarg_t into,
-                                  double *latency);
+                                  double *latency) override;
 
   /** \brief Generate the fat tree
    * 
@@ -135,8 +131,6 @@ public:
    * It will also store the cluster for future use.
    */
   void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster);
-  /** \brief Add a processing node.
-   */
   void addProcessingNode(int id);
   void generateDotFile(const std::string& filename = "fatTree.dot") const;
 
index 62776a1..c6afb1f 100644 (file)
@@ -176,7 +176,7 @@ void AsDijkstra::addLoopback() {
   }
 }
 
-xbt_dynar_t AsDijkstra::getOnelinkRoutes()
+xbt_dynar_t AsDijkstra::getOneLinkRoutes()
 {
   xbt_dynar_t ret = xbt_dynar_new(sizeof(Onelink*), xbt_free_f);
   sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t,1);
@@ -409,13 +409,10 @@ AsDijkstra::~AsDijkstra()
 
 /* Creation routing model functions */
 
-AsDijkstra::AsDijkstra() : AsGeneric(), m_cached(0) {
-  p_routeGraph = NULL;
-  p_graphNodeMap = NULL;
-  p_routeCache = NULL;
+AsDijkstra::AsDijkstra() : AsGeneric() {
 }
 
-AsDijkstra::AsDijkstra(int cached) : AsGeneric(), m_cached(cached)
+AsDijkstra::AsDijkstra(bool cached) : AsGeneric(), m_cached(cached)
 {
   p_routeGraph = NULL;
   p_graphNodeMap = NULL;
index 9450b2e..a5ef07e 100644 (file)
@@ -37,7 +37,7 @@ class XBT_PRIVATE AsDijkstra;
 class AsDijkstra : public AsGeneric {
 public:
   AsDijkstra();
-  AsDijkstra(int cached);
+  AsDijkstra(bool cached);
   ~AsDijkstra();
        xbt_node_t routeGraphNewNode(int id, int graph_id);
        graph_node_map_element_t nodeMapSearch(int id);
@@ -55,17 +55,17 @@ public:
      * will have a loopback attached to it.
      */
        void addLoopback();
-       void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat);
-       xbt_dynar_t getOnelinkRoutes();
-       void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat);
-       void parseASroute(sg_platf_route_cbarg_t route);
-       void parseRoute(sg_platf_route_cbarg_t route);
+       void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) override;
+       xbt_dynar_t getOneLinkRoutes() override;
+       void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); // FIXME: this function is dangerously not overriding because of diverging prototype
+       void parseASroute(sg_platf_route_cbarg_t route) override;
+       void parseRoute(sg_platf_route_cbarg_t route) override;
        void end();
 
-  xbt_graph_t p_routeGraph;      /* xbt_graph */
-  xbt_dict_t p_graphNodeMap;    /* map */
-  xbt_dict_t p_routeCache;       /* use in cache mode */
-  int m_cached;
+  xbt_graph_t p_routeGraph = nullptr;      /* xbt_graph */
+  xbt_dict_t p_graphNodeMap = nullptr;    /* map */
+  xbt_dict_t p_routeCache = nullptr;       /* use in cache mode */
+  bool m_cached = false;
 };
 
 }
index 1302a84..5f498f4 100644 (file)
@@ -25,26 +25,14 @@ public:
   AsFloyd();
   ~AsFloyd();
 
-  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency);
-  xbt_dynar_t getOneLinkRoutes();
-  void parseASroute(sg_platf_route_cbarg_t route);
-  void parseRoute(sg_platf_route_cbarg_t route);
+  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
+  xbt_dynar_t getOneLinkRoutes() override;
+  void parseASroute(sg_platf_route_cbarg_t route) override;
+  void parseRoute(sg_platf_route_cbarg_t route) override;
   void end();
-  //void parseASroute(sg_platf_route_cbarg_t route);
 
-  //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
-
-  /* The parser calls the following functions to inform the routing models
-   * that a new element is added to the AS currently built.
-   *
-   * Of course, only the routing model of this AS is informed, not every ones */
-  //int parsePU(RoutingEdge *elm); /* A host or a router, whatever */
-  //int parseAS(RoutingEdge *elm);
-
-  //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
-
-  /* vars for calculate the floyd algorith. */
+private:
+  /* vars to compute the Floyd algorithm. */
   int *p_predecessorTable;
   double *p_costTable;
   sg_platf_route_cbarg_t *p_linkTable;
index cf8fc2b..a3ffd03 100644 (file)
@@ -49,10 +49,6 @@ void model_full_end(AS_t _routing)
 namespace simgrid {
 namespace surf {
 
-AsFull::AsFull(){
-  p_routingTable = 0;
-}
-
 AsFull::~AsFull(){
   if (p_routingTable) {
     int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
index 4a6676f..c7b6624 100644 (file)
@@ -21,27 +21,16 @@ class XBT_PRIVATE AsFull;
 
 class AsFull: public AsGeneric {
 public:
-  sg_platf_route_cbarg_t *p_routingTable;
 
-  AsFull();
+  AsFull() {}
   ~AsFull();
 
-  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency);
-  xbt_dynar_t getOneLinkRoutes();
-  void parseRoute(sg_platf_route_cbarg_t route);
-  void parseASroute(sg_platf_route_cbarg_t route);
+  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
+  xbt_dynar_t getOneLinkRoutes() override;
+  void parseRoute(sg_platf_route_cbarg_t route) override;
+  void parseASroute(sg_platf_route_cbarg_t route) override;
 
-  //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
-
-  /* The parser calls the following functions to inform the routing models
-   * that a new element is added to the AS currently built.
-   *
-   * Of course, only the routing model of this AS is informed, not every ones */
-  //virtual int parsePU(RoutingEdge *elm)=0; /* A host or a router, whatever */
-  //virtual int parseAS( RoutingEdge *elm)=0;
-
-  //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
+  sg_platf_route_cbarg_t *p_routingTable = nullptr;
 };
 
 }
index 3173d9c..982038d 100644 (file)
@@ -156,11 +156,6 @@ xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d,
 namespace simgrid {
 namespace surf {
 
-xbt_dynar_t AsGeneric::getOneLinkRoutes() { // FIXME: kill that stub
-  xbt_die("\"generic_get_onelink_routes\" not implemented yet");
-  return NULL;
-}
-
 void AsGeneric::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 {
   int src, dst;
index 69ba2e9..96ffd16 100644 (file)
@@ -21,20 +21,19 @@ public:
   AsGeneric();
   ~AsGeneric();
 
-  virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency);
-  virtual xbt_dynar_t getOneLinkRoutes();
-  virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  virtual sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst, double *lat);
+  virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
+  virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
+  virtual sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst, double *lat) override;
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  virtual int parsePU(NetCard *elm); /* A host or a router, whatever */
-  virtual int parseAS(NetCard *elm);
-  virtual void parseRoute(sg_platf_route_cbarg_t route);
-  virtual void parseASroute(sg_platf_route_cbarg_t route);
-  virtual void parseBypassroute(sg_platf_route_cbarg_t e_route);
+  virtual int parsePU(NetCard *elm) override; /* A host or a router, whatever */
+  virtual int parseAS(NetCard *elm) override;
+  virtual void parseRoute(sg_platf_route_cbarg_t route) override;
+  virtual void parseASroute(sg_platf_route_cbarg_t route) override;
+  virtual void parseBypassroute(sg_platf_route_cbarg_t e_route) override;
 
   virtual sg_platf_route_cbarg_t newExtendedRoute(e_surf_routing_hierarchy_t hierarchy, sg_platf_route_cbarg_t routearg, int change_order);
   virtual As *asExist(As *to_find);
index 989730d..4ba9287 100644 (file)
@@ -51,7 +51,7 @@ int AsNone::parseAS(NetCard *elm) {
 }
 
 void AsNone::parseRoute(sg_platf_route_cbarg_t /*route*/){
-  THROW_IMPOSSIBLE;
+  THROW_IMPOSSIBLE; /* No. */
 }
 
 void AsNone::parseASroute(sg_platf_route_cbarg_t /*route*/){
@@ -61,12 +61,5 @@ void AsNone::parseBypassroute(sg_platf_route_cbarg_t /*e_route*/){
   THROW_IMPOSSIBLE;
 }
 
-/* Creation routing model functions */
-AsNone::AsNone() {
-}
-
-AsNone::~AsNone() {
-}
-
 }
 }
index a7f1cc9..b706f89 100644 (file)
@@ -16,23 +16,23 @@ namespace surf {
 
 class XBT_PRIVATE AsNone : public As {
 public:
-  AsNone();
-  ~AsNone();
+  AsNone() {}
+  ~AsNone() {}
 
-  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency);
-  xbt_dynar_t getOneLinkRoutes();
-  void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst, double *lat);
+  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
+  xbt_dynar_t getOneLinkRoutes() override;
+  void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
+  sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst, double *lat) override;
 
   /* The parser calls the following functions to inform the routing models
    * that a new element is added to the AS currently built.
    *
    * Of course, only the routing model of this AS is informed, not every ones */
-  int parsePU(NetCard *elm); /* A host or a router, whatever */
-  int parseAS( NetCard *elm);
-  void parseRoute(sg_platf_route_cbarg_t route);
-  void parseASroute(sg_platf_route_cbarg_t route);
-  void parseBypassroute(sg_platf_route_cbarg_t e_route);
+  int parsePU(NetCard *elm) override; /* A host or a router, whatever */
+  int parseAS( NetCard *elm) override;
+  void parseRoute(sg_platf_route_cbarg_t route) override;
+  void parseASroute(sg_platf_route_cbarg_t route) override;
+  void parseBypassroute(sg_platf_route_cbarg_t e_route) override;
 };
 
 }
index f5ae8aa..b31f273 100644 (file)
@@ -9,6 +9,10 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_vivaldi, surf, "Routing part of surf");
 
+#define HOST_PEER(peername) bprintf("peer_%s", peername)
+#define ROUTER_PEER(peername) bprintf("router_%s", peername)
+#define LINK_PEER(peername) bprintf("link_%s", peername)
+
 static XBT_INLINE double euclidean_dist_comp(int index, xbt_dynar_t src, xbt_dynar_t dst) {
   double src_coord, dst_coord;
 
index 9ad8f53..3641a13 100644 (file)
@@ -14,9 +14,6 @@
 /* ************************************************** */
 /* **************  Vivaldi ROUTING   **************** */
 XBT_PRIVATE AS_t model_vivaldi_create(void);      /* create structures for vivaldi routing model */
-#define HOST_PEER(peername) bprintf("peer_%s", peername)
-#define ROUTER_PEER(peername) bprintf("router_%s", peername)
-#define LINK_PEER(peername) bprintf("link_%s", peername)
 
 namespace simgrid {
 namespace surf {
@@ -28,23 +25,11 @@ class XBT_PRIVATE AsVivaldi;
 
 class AsVivaldi: public AsGeneric {
 public:
-  sg_platf_route_cbarg_t *p_routingTable;
-
   AsVivaldi() : AsGeneric() {};
   ~AsVivaldi() {};
 
-  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency);
-  //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
-  //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat);
-
-  /* The parser calls the following functions to inform the routing models
-   * that a new element is added to the AS currently built.
-   *
-   * Of course, only the routing model of this AS is informed, not every ones */
-  int parsePU(NetCard *elm); /* A host or a router, whatever */
-  //virtual int parseAS( RoutingEdge *elm)=0;
-
-  //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
+  void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
+  int parsePU(NetCard *elm) override;
 };
 
 }