- surf_parse_get_int(&start, xbt_dynar_get_as(radical_ends, 0, char *));
- host_id = bprintf("%s%d%s", struct_cluster->V_cluster_prefix, start, struct_cluster->V_cluster_suffix);
- link_id = bprintf("%s_link_%d", struct_cluster->V_cluster_id, start);
-
- XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
- struct_host = xbt_new0(s_hostSG_t, 1);
- struct_host->V_host_id = host_id;
- if(strcmp(struct_cluster->V_cluster_availability_file,"")){
- xbt_dict_set(patterns, "radical", bprintf("%d", start), 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(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
- {A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FULLDUPLEX;}
- if(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_link_t, 1);
- struct_lnk->V_link_id = 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();
-
- xbt_dict_set(cluster_host_link,host_id,strdup(link_id),free);
-// XBT_INFO("key '%s' Value '%s'",host_id,link_id);
- ETag_surfxml_host();
- ETag_surfxml_link();
-
- break;
-
- case 2:
-
- surf_parse_get_int(&start,
- xbt_dynar_get_as(radical_ends, 0, char *));
- surf_parse_get_int(&end, xbt_dynar_get_as(radical_ends, 1, char *));
- for (i = start; i <= end; i++) {
- 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_hostSG_t, 1);
- struct_host->V_host_id = 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(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
- {A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FULLDUPLEX;}
- if(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_link_t, 1);
- struct_lnk->V_link_id = 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();
-
- xbt_dict_set(cluster_host_link,host_id,strdup(link_id),free);
-// XBT_INFO("key '%s' Value '%s'",host_id,link_id);
-
- ETag_surfxml_host();
- ETag_surfxml_link();
+ start=surf_parse_get_int(xbt_dynar_get_as(radical_ends, 0, char *));
+ host_id = bprintf("%s%d%s", struct_cluster->prefix, start, struct_cluster->suffix);
+ link_id = bprintf("%s_link_%d", struct_cluster->id, start);
+
+ XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->power);
+ host.id = host_id;
+ if(strcmp(struct_cluster->availability_trace,"")){
+ xbt_dict_set(patterns, "radical", bprintf("%d", start), xbt_free);
+ char* tmp_availability_file = xbt_strdup(struct_cluster->availability_trace);
+ xbt_str_varsubst(tmp_availability_file,patterns);
+ XBT_DEBUG("\tavailability_file=\"%s\"",tmp_availability_file);
+ host.power_trace = tmgr_trace_new(tmp_availability_file);
+ xbt_free(tmp_availability_file);
+ }
+ else
+ {
+ 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);
+ XBT_DEBUG("\tstate_file=\"%s\"",tmp_state_file);
+ host.state_trace = tmgr_trace_new(tmp_state_file);
+ xbt_free(tmp_state_file);
+ }
+ else
+ {
+ XBT_DEBUG("\tstate_file=\"\"");
+ }
+
+ host.power_peak = struct_cluster->power;
+ host.power_scale = 1.0;
+ host.core_amount = struct_cluster->core_amount;
+ host.initial_state = SURF_RESOURCE_ON;
+ host.coord = "";
+ sg_platf_new_host(&host);
+ XBT_DEBUG("</host>");
+