-static void routing_parse_Sconfig(void)
-{
- XBT_DEBUG("START configuration name = %s",A_surfxml_config_id);
-}
-
-static void routing_parse_Econfig(void)
-{
- xbt_dict_cursor_t cursor = NULL;
- char *key;
- char *elem;
- char *cfg;
- xbt_dict_foreach(current_property_set, cursor, key, elem) {
- cfg = bprintf("%s:%s",key,elem);
- if(xbt_cfg_is_default_value(_surf_cfg_set, key))
- xbt_cfg_set_parse(_surf_cfg_set, cfg);
- else
- XBT_INFO("The custom configuration '%s' is already defined by user!",key);
- free(cfg);
- }
- XBT_DEBUG("End configuration name = %s",A_surfxml_config_id);
-}
-
-static void parse_create_host_link(int i)
-{
- char *host_id, *link_id = NULL;
-
- host_id = bprintf("%s%d%s", struct_cluster->V_cluster_prefix, i, struct_cluster->V_cluster_suffix);
- link_id = bprintf("%s_link_%d", struct_cluster->V_cluster_id, i);
-
- A_surfxml_host_state = A_surfxml_host_state_ON;
-
- XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
- struct_host = xbt_new0(s_surf_parsing_host_arg_t, 1);
- struct_host->V_host_id = xbt_strdup(host_id);
- if(strcmp(struct_cluster->V_cluster_availability_file,"")){
- xbt_dict_set(patterns, "radical", bprintf("%d", i), xbt_free);
- 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);
- xbt_free(tmp_availability_file);
- }
- else
- {
- XBT_DEBUG("\tavailability_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);
- xbt_free(tmp_state_file);
- }
- else
- {
- XBT_DEBUG("\tstate_file=\"\"");
- }
-
- struct_host->V_host_power_peak = struct_cluster->S_cluster_power;
- 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 = "";
- STag_surfxml_host_cluster();
- XBT_DEBUG("</host>");
-
- A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
- if(AX_surfxml_cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
- {A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FULLDUPLEX;}
- if(AX_surfxml_cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FATPIPE)
- {A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;}
-
- XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
-
- struct_lnk = xbt_new0(s_surf_parsing_link_arg_t, 1);
- struct_lnk->V_link_id = xbt_strdup(link_id);
- struct_lnk->V_link_bandwidth = struct_cluster->S_cluster_bw;
- struct_lnk->V_link_latency = struct_cluster->S_cluster_lat;
- struct_lnk->V_link_bandwidth_file = NULL;
- struct_lnk->V_link_latency_file = NULL;
- struct_lnk->V_link_state_file = NULL;
- struct_lnk->V_link_state = SURF_RESOURCE_ON;
- struct_lnk->V_link_sharing_policy = A_surfxml_link_sharing_policy;
-
- if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
- struct_lnk->V_policy_initial_link = SURF_LINK_SHARED;
- else
- {
- if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FATPIPE)
- struct_lnk->V_policy_initial_link = SURF_LINK_FATPIPE;
- else if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
- struct_lnk->V_policy_initial_link = SURF_LINK_FULLDUPLEX;
- }
- STag_surfxml_link_cluster();
-
- ETag_surfxml_host();
- ETag_surfxml_link();
-
- surf_parsing_link_up_down_t info = xbt_new0(s_surf_parsing_link_up_down_t, 1);
-
- if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX){
- char* tmp_link = bprintf("%s_UP",link_id);
- info->link_up = xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL);
- free(tmp_link);
- tmp_link = bprintf("%s_DOWN",link_id);
- info->link_down = xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL);
- free(tmp_link);
- }
- else{
- info->link_up = xbt_lib_get_or_null(link_lib, link_id, SURF_LINK_LEVEL);
- info->link_down = info->link_up;
- }
- xbt_dict_set(cluster_host_link,host_id,info,xbt_free);
- xbt_free(link_id);
- xbt_free(host_id);
-}
-