static void routing_parse_Econfig(void); /*config Tag */
static char* replace_random_parameter(char * chaine);
+static void clean_dict_random(void);
/* this lines are only for replace use like index in the model table */
typedef enum {
surfxml_add_callback(STag_surfxml_peer_cb_list,
&routing_parse_Speer);
+ surfxml_add_callback(ETag_surfxml_platform_cb_list,
+ &clean_dict_random);
#ifdef HAVE_TRACING
instr_routing_define_callbacks();
xbt_cfg_set_parse(_surf_cfg_set, cfg);
else
XBT_INFO("The custom configuration '%s' is already define by user!",key);
- }
+ free(cfg);
+ }
XBT_DEBUG("End configuration name = %s",A_surfxml_config_id);
}
xbt_free(temp_cluster_bw);
xbt_free(temp_cluster_lat);
+ xbt_free(temp_cluster_power);
free(link_id);
free(host_id);
break;
xbt_free(string);
string = test_string;
} //In other case take old value (without ${})
-
+ else
+ free(test_string);
return string;
}
+static void clean_dict_random(void)
+{
+ XBT_DEBUG("Clean dict for random");
+ xbt_dict_free(&random_value);
+ xbt_dict_free(&patterns);
+}
+
static void routing_parse_Speer(void)
{
static int AX_ptr = 0;
double mean, std, min, max, seed;
char *random_id = A_surfxml_random_id;
char *random_radical = A_surfxml_random_radical;
+ char *rd_name;
+ char *rd_value;
surf_parse_get_double(&mean,A_surfxml_random_mean);
surf_parse_get_double(&std,A_surfxml_random_std_deviation);
surf_parse_get_double(&min,A_surfxml_random_min);
if(!strcmp(random_radical,""))
{
res = random_generate(random);
- xbt_dict_set(random_value, random_id, bprintf("%f",res), free);
+ rd_value = bprintf("%f",res);
+ xbt_dict_set(random_value, random_id, rd_value, free);
}
else
{
for (i = start; i <= end; i++) {
xbt_assert1(!xbt_dict_get_or_null(random_value,random_id),"Custom Random '%s' already exists !",bprintf("%s%d",random_id,i));
res = random_generate(random);
- tmpbuf = bprintf("%s%d",random_id,i);
+ tmpbuf = bprintf("%s%d",random_id,i);
xbt_dict_set(random_value, tmpbuf, bprintf("%f",res), free);
- xbt_free(tmpbuf);
+ xbt_free(tmpbuf);
}
break;
default:
XBT_INFO("Malformed radical");
}
res = random_generate(random);
- xbt_dict_set(random_value, bprintf("%s_router",random_id), bprintf("%f",res), free);
+ rd_name = bprintf("%s_router",random_id);
+ rd_value = bprintf("%f",res);
+ xbt_dict_set(random_value, rd_name, rd_value, free);
xbt_dynar_free(&radical_ends);
}
+ free(rd_name);
xbt_dynar_free(&radical_elements);
}
}