From: Martin Quinson Date: Thu, 10 Nov 2011 16:20:36 +0000 (+0100) Subject: saner pattern use in the trace files X-Git-Tag: exp_20120216~334 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ea97700f4d2ec9adfcd537e8a86e6d146c50a37c?ds=sidebyside saner pattern use in the trace files I guess that previously, the patterns were replaced for the first host, and then reused as is for the next ones. So the traces specified for the first host were used for any ones. --- diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index d1760991ea..658d80c5e4 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -874,8 +874,7 @@ static void routing_parse_cluster(void) if (strcmp(struct_cluster->availability_trace, "")) { xbt_dict_set(patterns, "radical", bprintf("%d", i), xbt_free); char *tmp_availability_file = - xbt_strdup(struct_cluster->availability_trace); - xbt_str_varsubst(tmp_availability_file, patterns); + xbt_str_varsubst(struct_cluster->availability_trace, patterns); XBT_DEBUG("\tavailability_file=\"%s\"", tmp_availability_file); host.power_trace = tmgr_trace_new(tmp_availability_file); xbt_free(tmp_availability_file); @@ -883,8 +882,8 @@ static void routing_parse_cluster(void) XBT_DEBUG("\tavailability_file=\"\""); } if (strcmp(struct_cluster->state_trace, "")) { - char *tmp_state_file = xbt_strdup(struct_cluster->state_trace); - xbt_str_varsubst(tmp_state_file, patterns); + char *tmp_state_file = + xbt_str_varsubst(struct_cluster->state_trace, patterns); XBT_DEBUG("\tstate_file=\"%s\"", tmp_state_file); host.state_trace = tmgr_trace_new(tmp_state_file); xbt_free(tmp_state_file);