From ea97700f4d2ec9adfcd537e8a86e6d146c50a37c Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 10 Nov 2011 17:20:36 +0100 Subject: [PATCH] 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. --- src/surf/surf_routing.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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); -- 2.20.1