Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill useless code now that As::Seal() exists
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 11 Feb 2016 14:26:13 +0000 (15:26 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 11 Feb 2016 14:26:13 +0000 (15:26 +0100)
src/surf/surf_private.h
src/surf/surf_routing.cpp
src/surf/surf_routing_dijkstra.cpp
src/surf/surf_routing_floyd.cpp
src/surf/surf_routing_full.cpp
src/surf/surf_routing_private.hpp

index 43d0e58..df6151d 100644 (file)
@@ -55,7 +55,6 @@ typedef struct s_model_type {
   const char *name;
   const char *desc;
   AS_t (*create) ();
-  void (*end) (AS_t as);
 } s_routing_model_description_t, *routing_model_description_t;
 
 /* This enum used in the routing structure helps knowing in which situation we are. */
index 4578350..66f1972 100644 (file)
@@ -87,27 +87,23 @@ typedef enum {
 struct s_model_type routing_models[] = {
   {"Full",
    "Full routing data (fast, large memory requirements, fully expressive)",
-   model_full_create, model_full_end},
+   model_full_create},
   {"Floyd",
    "Floyd routing data (slow initialization, fast lookup, lesser memory requirements, shortest path routing only)",
-   model_floyd_create, model_floyd_end},
+   model_floyd_create},
   {"Dijkstra",
    "Dijkstra routing data (fast initialization, slow lookup, small memory requirements, shortest path routing only)",
-   model_dijkstra_create, model_dijkstra_both_end},
+   model_dijkstra_create},
   {"DijkstraCache",
    "Dijkstra routing data (fast initialization, fast lookup, small memory requirements, shortest path routing only)",
-   model_dijkstracache_create, model_dijkstra_both_end},
+   model_dijkstracache_create},
   {"none", "No routing (Unless you know what you are doing, avoid using this mode in combination with a non Constant network model).",
-   model_none_create,  NULL},
-  {"Vivaldi", "Vivaldi routing",
-   model_vivaldi_create, NULL},
-  {"Cluster", "Cluster routing",
-   model_cluster_create, NULL},
-  {"Torus_Cluster", "Torus Cluster routing",
-   model_torus_cluster_create, NULL},
-  {"Fat_Tree_Cluster", "Fat Tree Cluster routing",
-   model_fat_tree_cluster_create, NULL},
-  {NULL, NULL, NULL, NULL}
+   model_none_create},
+  {"Vivaldi", "Vivaldi routing", model_vivaldi_create},
+  {"Cluster", "Cluster routing", model_cluster_create},
+  {"Torus_Cluster", "Torus Cluster routing", model_torus_cluster_create},
+  {"Fat_Tree_Cluster", "Fat Tree Cluster routing", model_fat_tree_cluster_create},
+  {NULL, NULL, NULL}
 };
 
 /**
@@ -261,8 +257,7 @@ void routing_AS_end()
   if (current_routing == NULL) {
     THROWF(arg_error, 0, "Close an AS, but none was under construction");
   } else {
-    if (current_routing->p_modelDesc->end)
-      current_routing->p_modelDesc->end(current_routing);
+    current_routing->Seal();
     current_routing = current_routing->p_routingFather;
   }
 }
index f6fe75f..ccdeaad 100644 (file)
@@ -44,11 +44,6 @@ AS_t model_dijkstracache_create(void){
   return new simgrid::surf::AsDijkstra(1);
 }
 
-void model_dijkstra_both_end(AS_t as)
-{
-  as->Seal();
-}
-
 /* Utility functions */
 
 namespace simgrid {
index 831b4d3..ffe8e5a 100644 (file)
@@ -19,11 +19,6 @@ AS_t model_floyd_create(void)
   return new simgrid::surf::AsFloyd();
 }
 
-void model_floyd_end(AS_t current_routing)
-{
-  current_routing->Seal();
-}
-
 namespace simgrid {
 namespace surf {
 
index 312eeb7..f80b2f6 100644 (file)
@@ -17,11 +17,6 @@ AS_t model_full_create(void)
   return new simgrid::surf::AsFull();
 }
 
-void model_full_end(AS_t _routing)
-{
-  _routing->Seal();
-}
-
 namespace simgrid {
 namespace surf {
 void AsFull::Seal() {
index d3caf8d..36c6f73 100644 (file)
@@ -60,7 +60,6 @@ void generic_src_dst_check(AS_t rc, sg_netcard_t src,
 /* ************************************************************************** */
 /* *************************** FLOYD ROUTING ******************************** */
 XBT_PRIVATE AS_t model_floyd_create(void);  /* create structures for floyd routing model */
-XBT_PRIVATE void model_floyd_end(AS_t as);      /* finalize the creation of floyd routing model */
 XBT_PRIVATE void model_floyd_parse_route(AS_t rc, sg_platf_route_cbarg_t route);
 
 /* ************************************************** */
@@ -82,13 +81,11 @@ XBT_PRIVATE AS_t model_vivaldi_create(void);      /* create structures for vival
 XBT_PRIVATE AS_t model_dijkstra_both_create(int cached);    /* create by calling dijkstra or dijkstracache */
 XBT_PRIVATE AS_t model_dijkstra_create(void);       /* create structures for dijkstra routing model */
 XBT_PRIVATE AS_t model_dijkstracache_create(void);  /* create structures for dijkstracache routing model */
-XBT_PRIVATE void model_dijkstra_both_end(AS_t as);      /* finalize the creation of dijkstra routing model */
 XBT_PRIVATE void model_dijkstra_both_parse_route (AS_t rc, sg_platf_route_cbarg_t route);
 
 /* ************************************************************************** */
 /* *************************** FULL ROUTING ********************************* */
 XBT_PRIVATE AS_t model_full_create(void);   /* create structures for full routing model */
-XBT_PRIVATE void model_full_end(AS_t as);       /* finalize the creation of full routing model */
 XBT_PRIVATE void model_full_set_route(  /* Set the route and ASroute between src and dst */
     AS_t rc, sg_platf_route_cbarg_t route);
 /* ************************************************************************** */