X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dd77d806f578b2bab80b049bd2935ada37adadad..15b64b5edc827167522ab08cf9efd17cf1b69830:/src/surf/surf_routing.c diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index b9bb99ae22..471de49609 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -1508,19 +1508,18 @@ void routing_parse_Scluster(void) static int AX_ptr = 0; char *host_id, *groups, *link_id = NULL; - char *availability_file = xbt_strdup(A_surfxml_cluster_availability_file); - char *state_file = xbt_strdup(A_surfxml_cluster_state_file); - if( !strcmp(A_surfxml_cluster_state_file,"") || !strcmp(A_surfxml_cluster_availability_file,"") ){ + if( strcmp(struct_cluster->V_cluster_availability_file,"") + || strcmp(struct_cluster->V_cluster_state_file,"") ) + { if(xbt_dict_size(patterns)==0) patterns = xbt_dict_new(); - + XBT_INFO("'%s' '%s'",A_surfxml_cluster_state_file,struct_cluster->V_cluster_availability_file); xbt_dict_set(patterns,"id",struct_cluster->V_cluster_id,NULL); xbt_dict_set(patterns,"prefix",struct_cluster->V_cluster_prefix,NULL); xbt_dict_set(patterns,"suffix",struct_cluster->V_cluster_suffix,NULL); } - char *route_src_dst; unsigned int iter; int start, end, i; xbt_dynar_t radical_elements; @@ -1554,9 +1553,9 @@ void routing_parse_Scluster(void) XBT_DEBUG("", host_id, struct_cluster->S_cluster_power); struct_host = xbt_new0(s_hostSG_t, 1); struct_host->V_host_id = host_id; - if(!strcmp(A_surfxml_cluster_availability_file,"")){ + if(strcmp(struct_cluster->V_cluster_availability_file,"")){ xbt_dict_set(patterns, "radical", bprintf("%d", start), xbt_free); - char* tmp_availability_file = xbt_strdup(availability_file); + char* tmp_availability_file = xbt_strdup(struct_cluster->V_cluster_availability_file); xbt_str_varsubst(tmp_availability_file,patterns); XBT_DEBUG("\tavailability_file=\"%s\"",tmp_availability_file); struct_host->V_host_power_trace = tmgr_trace_new(tmp_availability_file); @@ -1566,8 +1565,8 @@ void routing_parse_Scluster(void) { XBT_DEBUG("\tavailability_file=\"\""); } - if(!strcmp(A_surfxml_cluster_state_file,"")){ - char *tmp_state_file = xbt_strdup(state_file); + if(strcmp(struct_cluster->V_cluster_state_file,"")){ + char *tmp_state_file = xbt_strdup(struct_cluster->V_cluster_state_file); xbt_str_varsubst(tmp_state_file,patterns); XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file); struct_host->V_host_state_trace = tmgr_trace_new(tmp_state_file); @@ -1618,13 +1617,7 @@ void routing_parse_Scluster(void) xbt_dict_set(cluster_host_link,host_id,strdup(link_id),free); // XBT_INFO("key '%s' Value '%s'",host_id,link_id); ETag_surfxml_host(); - xbt_free(struct_host->V_host_id); - xbt_free(struct_host->V_host_coord); - xbt_free(struct_host); - ETag_surfxml_link(); - xbt_free(struct_lnk->V_link_id); - xbt_free(struct_lnk); break; @@ -1642,9 +1635,9 @@ void routing_parse_Scluster(void) XBT_DEBUG("", host_id, struct_cluster->S_cluster_power); struct_host = xbt_new0(s_hostSG_t, 1); struct_host->V_host_id = host_id; - if(!strcmp(A_surfxml_cluster_availability_file,"")){ + if(strcmp(struct_cluster->V_cluster_availability_file,"")){ xbt_dict_set(patterns, "radical", bprintf("%d", i), xbt_free); - char* tmp_availability_file = xbt_strdup(availability_file); + char* tmp_availability_file = xbt_strdup(struct_cluster->V_cluster_availability_file); xbt_str_varsubst(tmp_availability_file,patterns); XBT_DEBUG("\tavailability_file=\"%s\"",tmp_availability_file); struct_host->V_host_power_trace = tmgr_trace_new(tmp_availability_file); @@ -1654,8 +1647,8 @@ void routing_parse_Scluster(void) { XBT_DEBUG("\tavailability_file=\"\""); } - if(!strcmp(A_surfxml_cluster_state_file,"")){ - char *tmp_state_file = xbt_strdup(state_file); + if(strcmp(struct_cluster->V_cluster_state_file,"")){ + char *tmp_state_file = xbt_strdup(struct_cluster->V_cluster_state_file); xbt_str_varsubst(tmp_state_file,patterns); XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file); struct_host->V_host_state_trace = tmgr_trace_new(tmp_state_file); @@ -1670,7 +1663,7 @@ void routing_parse_Scluster(void) struct_host->V_host_power_scale = 1.0; struct_host->V_host_core = struct_cluster->S_cluster_core; struct_host->V_host_state_initial = SURF_RESOURCE_ON; - struct_host->V_host_coord = xbt_strdup(""); + struct_host->V_host_coord = ""; STag_surfxml_host_cluster(); XBT_DEBUG(""); @@ -1707,13 +1700,8 @@ void routing_parse_Scluster(void) // XBT_INFO("key '%s' Value '%s'",host_id,link_id); ETag_surfxml_host(); - xbt_free(struct_host->V_host_id); - xbt_free(struct_host->V_host_coord); - xbt_free(struct_host); - ETag_surfxml_link(); - xbt_free(struct_lnk->V_link_id); - xbt_free(struct_lnk); + } break; @@ -1763,7 +1751,6 @@ void routing_parse_Scluster(void) STag_surfxml_link_cluster(); ETag_surfxml_link(); - free(link_backbone); } XBT_DEBUG(" "); @@ -1781,10 +1768,9 @@ void routing_parse_Scluster(void) xbt_dynar_free(&radical_elements); xbt_free(new_suffix); - xbt_free(availability_file); - xbt_free(state_file); - if( !strcmp(A_surfxml_cluster_state_file,"") || !strcmp(A_surfxml_cluster_availability_file,"") ) + if( strcmp(struct_cluster->V_cluster_availability_file,"") + || strcmp(struct_cluster->V_cluster_state_file,"") ) xbt_dict_free(&patterns); XBT_DEBUG("");