-static void create_hierarchy(routing_component_t current_comp,
- jed_simgrid_container_t current_container) {
- xbt_dict_cursor_t cursor = NULL;
- char *key;
- routing_component_t elem;
- network_element_t network_elem;
-
- if( xbt_dict_length(current_comp->routing_sons) == 0 ) {
- // I am no AS
- // add hosts to jedule platform
- xbt_dynar_t hosts;
-
- hosts = xbt_dynar_new(sizeof(char*), NULL);
-
- xbt_dict_foreach(current_comp->to_index, cursor, key, network_elem) {
- char *hostname;
- DEBUG2("key %s value %p\n", key, network_elem);
- //xbt_dynar_push_as(hosts, char*, key);
- hostname = strdup(key);
- xbt_dynar_push(hosts, &hostname);
- }
-
- jed_simgrid_add_resources(current_container, hosts);
-
- } else {
- xbt_dict_foreach(current_comp->routing_sons, cursor, key, elem) {
- jed_simgrid_container_t child_container;
- jed_simgrid_create_container(&child_container, elem->name);
- jed_simgrid_add_container(current_container, child_container);
- DEBUG1("name : %s\n", elem->name);
- create_hierarchy(elem, child_container);
- }
- }
+static void create_hierarchy(AS_t current_comp,
+ jed_simgrid_container_t current_container) {
+ xbt_dict_cursor_t cursor = NULL;
+ unsigned int dynar_cursor;
+ char *key;
+ AS_t elem;
+ sg_routing_edge_t network_elem;
+
+ if(xbt_dict_is_empty(current_comp->routing_sons)) {
+ // I am no AS
+ // add hosts to jedule platform
+ xbt_dynar_t hosts;
+
+ hosts = xbt_dynar_new(sizeof(char*), NULL);
+
+ xbt_dynar_foreach(current_comp->index_network_elm,
+ dynar_cursor, network_elem) {
+ char *hostname;
+ hostname = strdup(network_elem->name);
+ xbt_dynar_push(hosts, &hostname);
+ }
+
+ jed_simgrid_add_resources(current_container, hosts);
+
+ } else {
+ xbt_dict_foreach(current_comp->routing_sons, cursor, key, elem) {
+ jed_simgrid_container_t child_container;
+ jed_simgrid_create_container(&child_container, elem->name);
+ jed_simgrid_add_container(current_container, child_container);
+ XBT_DEBUG("name : %s\n", elem->name);
+ create_hierarchy(elem, child_container);
+ }
+ }