X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3507930c130404d05f982cf9fe960fb95f7eb4b..027f3abe8f56d9729fa87329b559a5723e34aed5:/src/surf/workstation_KCCFLN05.c diff --git a/src/surf/workstation_KCCFLN05.c b/src/surf/workstation_KCCFLN05.c index 5e972d83c3..601f9b9ebf 100644 --- a/src/surf/workstation_KCCFLN05.c +++ b/src/surf/workstation_KCCFLN05.c @@ -740,8 +740,7 @@ static surf_action_t execute_parallel_task(int workstation_nb, int nb_host = 0; if (parallel_task_link_set == NULL) { - parallel_task_link_set = - xbt_dict_new_ext(workstation_nb * workstation_nb * 10); + parallel_task_link_set = xbt_dict_new(); } /* Compute the number of affected resources... */ @@ -910,6 +909,7 @@ static cpu_KCCFLN05_t cpu_new(const char *name, double power_scale, xbt_dict_t cpu_properties_k) { cpu_KCCFLN05_t cpu = xbt_new0(s_cpu_KCCFLN05_t, 1); + xbt_assert1(! xbt_dict_get_or_null(workstation_set, name), "Host '%s' declared several times in the platform file.",name); @@ -1150,6 +1150,7 @@ static void parse_route_set_endpoints(void) surf_parse_get_double(&impact_on_dst_with_other_send, A_surfxml_route_impact_on_dst_with_other_send); + route_action = A_surfxml_route_action; route_link_list = xbt_dynar_new(sizeof(char *), &free_string); @@ -1159,9 +1160,7 @@ static void parse_route_set_route(void) { char* name; if (src_id != -1 && dst_id != -1) { - name = bprintf("%x#%x#%lf#%lf#%lf#%lf",src_id, dst_id,impact_on_src, - impact_on_dst, impact_on_src_with_other_recv, - impact_on_dst_with_other_send); + name = bprintf("%x#%x",src_id, dst_id); manage_route(route_table, name, route_action, 0); free(name); @@ -1195,9 +1194,10 @@ static void add_route(void) int link_list_capacity = 0; link_KCCFLN05_t *link_list = NULL; xbt_dict_cursor_t cursor = NULL; - char *key,*data; + char *key,*data, *end; const char *sep = "#"; xbt_dynar_t links, keys; + char* link = NULL; if (routing_table == NULL) create_routing_table(); @@ -1209,14 +1209,15 @@ static void add_route(void) link_list_capacity = xbt_dynar_length(links); link_list = xbt_new(link_KCCFLN05_t, link_list_capacity); - src_id = atoi(xbt_dynar_get_as(keys, 0, char*)); - dst_id = atoi(xbt_dynar_get_as(keys, 1, char*)); - impact_on_src = atof(xbt_dynar_get_as(keys, 2, char*)); - impact_on_dst = atof(xbt_dynar_get_as(keys, 3, char*)); - impact_on_src_with_other_recv = atof(xbt_dynar_get_as(keys, 4, char*)); - impact_on_dst_with_other_send = atof(xbt_dynar_get_as(keys, 5, char*)); + src_id = strtol(xbt_dynar_get_as(keys, 0, char*), &end, 16); + dst_id = strtol(xbt_dynar_get_as(keys, 1, char*), &end, 16); + /*ATTRIBUTES NOT USED ANYMORE. WILL BE REMOVED FROM MODEL.*/ + impact_on_src = 0;//atof(xbt_dynar_get_as(keys, 2, char*)); + impact_on_dst = 0; //atof(xbt_dynar_get_as(keys, 3, char*)); + impact_on_src_with_other_recv = 0;//atof(xbt_dynar_get_as(keys, 4, char*)); + impact_on_dst_with_other_send = 0;//atof(xbt_dynar_get_as(keys, 5, char*)); - char* link = NULL; + xbt_dynar_foreach (links, cpt, link) { TRY { link_list[nb_link++] = xbt_dict_get(link_set, link); @@ -1228,7 +1229,6 @@ static void add_route(void) route_new(src_id, dst_id, link_list, nb_link,impact_on_src, impact_on_dst, impact_on_src_with_other_recv, impact_on_dst_with_other_send); - xbt_dynar_free(&links); } xbt_dict_free(&route_table);