Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
saner pattern use in the trace files
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 10 Nov 2011 16:20:36 +0000 (17:20 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 10 Nov 2011 17:44:53 +0000 (18:44 +0100)
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

index d176099..658d80c 100644 (file)
@@ -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);