From: Gabriel Corona Date: Tue, 1 Dec 2015 13:56:50 +0000 (+0100) Subject: [surf] Remove sg_platf_router_cb X-Git-Tag: v3_13~1509 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/67c9b35a2fab920823f98d10d33cdffe6f71eedc [surf] Remove sg_platf_router_cb --- diff --git a/src/include/simgrid/platf_interface.h b/src/include/simgrid/platf_interface.h index b0c1cf00e2..5f1ee7a5b9 100644 --- a/src/include/simgrid/platf_interface.h +++ b/src/include/simgrid/platf_interface.h @@ -49,7 +49,6 @@ XBT_PUBLIC(void) sg_platf_gpu_add_cb(sg_platf_gpu_cb_t); XBT_PUBLIC(void) sg_platf_host_add_cb(sg_platf_host_cb_t); XBT_PUBLIC(void) sg_platf_host_link_add_cb(sg_platf_host_link_cb_t); -XBT_PUBLIC(void) sg_platf_router_add_cb(sg_platf_router_cb_t); XBT_PUBLIC(void) sg_platf_link_add_cb(sg_platf_link_cb_t); XBT_PUBLIC(void) sg_platf_peer_add_cb(sg_platf_peer_cb_t fct); XBT_PUBLIC(void) sg_platf_cluster_add_cb(sg_platf_cluster_cb_t fct); diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 2e37aafe28..4f9979b99d 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -1164,6 +1164,8 @@ int instr_platform_traced (void); xbt_graph_t instr_routing_platform_graph (void); void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename); +XBT_PRIVATE void sg_instr_new_router(sg_platf_router_cbarg_t router); + /********** Routing **********/ void routing_AS_begin(sg_platf_AS_cbarg_t AS); void routing_AS_end(sg_platf_AS_cbarg_t AS); diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index d737c33bf3..b737e875d1 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -318,7 +318,7 @@ static void instr_routing_parse_start_host (sg_platf_host_cbarg_t host) } -static void instr_routing_parse_start_router (sg_platf_router_cbarg_t router) +void sg_instr_new_router(sg_platf_router_cbarg_t router) { container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1); PJ_container_new (router->id, INSTR_ROUTER, father); @@ -347,7 +347,6 @@ void instr_routing_define_callbacks () if (!TRACE_needs_platform()) return; sg_platf_link_add_cb(instr_routing_parse_start_link); sg_platf_host_add_cb(instr_routing_parse_start_host); - sg_platf_router_add_cb(instr_routing_parse_start_router); sg_platf_postparse_add_cb(instr_routing_parse_end_platform); } diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 954c14e1db..d2af7bbcb9 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -21,7 +21,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse); xbt_dynar_t sg_platf_host_cb_list = NULL; // of sg_platf_host_cb_t xbt_dynar_t sg_platf_host_link_cb_list = NULL; // of sg_platf_host_link_cb_t xbt_dynar_t sg_platf_link_cb_list = NULL; // of sg_platf_link_cb_t -xbt_dynar_t sg_platf_router_cb_list = NULL; // of sg_platf_router_cb_t xbt_dynar_t sg_platf_peer_cb_list = NULL; // of sg_platf_peer_cb_t xbt_dynar_t sg_platf_cluster_cb_list = NULL; // of sg_platf_cluster_cb_t xbt_dynar_t sg_platf_cabinet_cb_list = NULL; // of sg_platf_cluster_cb_t @@ -59,7 +58,6 @@ void sg_platf_init(void) { sg_platf_host_cb_list = xbt_dynar_new(sizeof(sg_platf_host_cb_t), NULL); sg_platf_host_link_cb_list = xbt_dynar_new(sizeof(sg_platf_host_link_cb_t), NULL); - sg_platf_router_cb_list = xbt_dynar_new(sizeof(sg_platf_router_cb_t), NULL); sg_platf_link_cb_list = xbt_dynar_new(sizeof(sg_platf_link_cb_t), NULL); sg_platf_peer_cb_list = xbt_dynar_new(sizeof(sg_platf_peer_cb_t), NULL); sg_platf_cluster_cb_list = xbt_dynar_new(sizeof(sg_platf_cluster_cb_t), NULL); @@ -87,7 +85,6 @@ void sg_platf_init(void) { void sg_platf_exit(void) { xbt_dynar_free(&sg_platf_host_cb_list); xbt_dynar_free(&sg_platf_host_link_cb_list); - xbt_dynar_free(&sg_platf_router_cb_list); xbt_dynar_free(&sg_platf_link_cb_list); xbt_dynar_free(&sg_platf_postparse_cb_list); xbt_dynar_free(&sg_platf_peer_cb_list); @@ -194,11 +191,8 @@ void sg_platf_new_router(sg_platf_router_cbarg_t router) XBT_DEBUG("Having set router coordinates for '%s'",router->id); } - unsigned int iterator; - sg_platf_router_cb_t fun; - xbt_dynar_foreach(sg_platf_router_cb_list, iterator, fun) { - fun(router); - } + if (TRACE_is_enabled()) + sg_instr_new_router(router); } void sg_platf_new_link(sg_platf_link_cbarg_t link){ @@ -573,9 +567,6 @@ void sg_platf_host_link_add_cb(sg_platf_host_link_cb_t fct) { void sg_platf_link_add_cb(sg_platf_link_cb_t fct) { xbt_dynar_push(sg_platf_link_cb_list, &fct); } -void sg_platf_router_add_cb(sg_platf_router_cb_t fct) { - xbt_dynar_push(sg_platf_router_cb_list, &fct); -} void sg_platf_peer_add_cb(sg_platf_peer_cb_t fct) { xbt_dynar_push(sg_platf_peer_cb_list, &fct); }