Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Move the basic cluster creation logic out of the callbacks
authorGabriel Corona <gabriel.corona@loria.fr>
Wed, 2 Dec 2015 14:00:52 +0000 (15:00 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Wed, 2 Dec 2015 14:01:18 +0000 (15:01 +0100)
src/surf/sg_platf.cpp
src/surf/surf_private.h
src/surf/surf_routing.cpp

index 9085bf2..40ae60e 100644 (file)
@@ -129,7 +129,10 @@ void sg_platf_new_link(sg_platf_link_cbarg_t link){
   }
 }
 
-void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster){
+void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
+{
+  routing_new_cluster(cluster);
+
   unsigned int iterator;
   sg_platf_cluster_cb_t fun;
   xbt_dynar_foreach(sg_platf_cluster_cb_list, iterator, fun) {
index e4c9e5a..f0f7084 100644 (file)
@@ -69,6 +69,8 @@ XBT_PUBLIC(void) routing_model_create(void *loopback);
 XBT_PUBLIC(void) routing_exit(void);
 XBT_PUBLIC(void) storage_register_callbacks(void);
 
+XBT_PRIVATE void routing_new_cluster(sg_platf_cluster_cbarg_t cluster);
+
 XBT_PUBLIC(void) routing_register_callbacks(void);
 XBT_PUBLIC(void) generic_free_route(sg_platf_route_cbarg_t route); // FIXME rename to routing_route_free
  // FIXME: make previous function private to routing again?
index 63daeda..e50939c 100644 (file)
@@ -736,7 +736,7 @@ void sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet)
   xbt_dynar_free(&radical_elements);
 }
 
-static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
+void routing_new_cluster(sg_platf_cluster_cbarg_t cluster)
 {
   char *host_id, *groups, *link_id = NULL;
   xbt_dict_t patterns = NULL;
@@ -1215,8 +1215,6 @@ static void check_disk_attachment()
 
 void routing_register_callbacks()
 {
-  sg_platf_cluster_add_cb(routing_parse_cluster);
-
   sg_platf_postparse_add_cb(routing_parse_postparse);
   sg_platf_postparse_add_cb(check_disk_attachment);