Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Remove sg_platf_router_cb
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 1 Dec 2015 13:56:50 +0000 (14:56 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 1 Dec 2015 14:06:29 +0000 (15:06 +0100)
src/include/simgrid/platf_interface.h
src/include/surf/surf.h
src/surf/instr_routing.cpp
src/surf/sg_platf.cpp

index b0c1cf0..5f1ee7a 100644 (file)
@@ -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);
index 2e37aaf..4f9979b 100644 (file)
@@ -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);
index d737c33..b737e87 100644 (file)
@@ -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);
 }
index 954c14e..d2af7bb 100644 (file)
@@ -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);
 }