From: Gabriel Corona Date: Wed, 2 Dec 2015 14:00:52 +0000 (+0100) Subject: [surf] Move the basic cluster creation logic out of the callbacks X-Git-Tag: v3_13~1495 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/59edffecb0a76e4bc29b38a7562e7179a59a8c4a [surf] Move the basic cluster creation logic out of the callbacks --- diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 9085bf2d63..40ae60ea81 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -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) { diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index e4c9e5a11e..f0f70840df 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -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? diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index 63daeda9a5..e50939ced3 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -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);