From 3671bfe99e3f5f4dc48d8229eb57f965a1cf6913 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 11 Feb 2016 15:26:13 +0100 Subject: [PATCH 1/1] kill useless code now that As::Seal() exists --- src/surf/surf_private.h | 1 - src/surf/surf_routing.cpp | 27 +++++++++++---------------- src/surf/surf_routing_dijkstra.cpp | 5 ----- src/surf/surf_routing_floyd.cpp | 5 ----- src/surf/surf_routing_full.cpp | 5 ----- src/surf/surf_routing_private.hpp | 3 --- 6 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index 43d0e585b4..df6151d23c 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -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. */ diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index 4578350a26..66f1972b80 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -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; } } diff --git a/src/surf/surf_routing_dijkstra.cpp b/src/surf/surf_routing_dijkstra.cpp index f6fe75f74d..ccdeaadbcd 100644 --- a/src/surf/surf_routing_dijkstra.cpp +++ b/src/surf/surf_routing_dijkstra.cpp @@ -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 { diff --git a/src/surf/surf_routing_floyd.cpp b/src/surf/surf_routing_floyd.cpp index 831b4d3722..ffe8e5a623 100644 --- a/src/surf/surf_routing_floyd.cpp +++ b/src/surf/surf_routing_floyd.cpp @@ -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 { diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index 312eeb77bb..f80b2f6440 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -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() { diff --git a/src/surf/surf_routing_private.hpp b/src/surf/surf_routing_private.hpp index d3caf8d681..36c6f731b8 100644 --- a/src/surf/surf_routing_private.hpp +++ b/src/surf/surf_routing_private.hpp @@ -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); /* ************************************************************************** */ -- 2.20.1