+void ETag_surfxml_host(void) {
+ s_sg_platf_host_cbarg_t host;
+ memset(&host,0,sizeof(host));
+
+ host.properties = current_property_set;
+
+ host.id = A_surfxml_host_id;
+ host.power_peak = get_cpu_power(A_surfxml_host_power);
+ host.power_scale = surf_parse_get_double( A_surfxml_host_availability);
+ host.core_amount = surf_parse_get_int(A_surfxml_host_core);
+ host.power_trace = tmgr_trace_new_from_file(A_surfxml_host_availability___file);
+ host.state_trace = tmgr_trace_new_from_file(A_surfxml_host_state___file);
+ xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
+ (A_surfxml_host_state == A_surfxml_host_state_OFF), "Invalid state");
+ if (A_surfxml_host_state == A_surfxml_host_state_ON)
+ host.initial_state = SURF_RESOURCE_ON;
+ if (A_surfxml_host_state == A_surfxml_host_state_OFF)
+ host.initial_state = SURF_RESOURCE_OFF;
+ host.coord = A_surfxml_host_coordinates;
+
+ sg_platf_new_host(&host);
+ current_property_set = NULL;
+}
+
+void STag_surfxml_host___link(void){
+ XBT_DEBUG("Create a Host_link for %s",A_surfxml_host___link_id);
+ s_sg_platf_host_link_cbarg_t host_link;
+ memset(&host_link,0,sizeof(host_link));
+
+ host_link.id = A_surfxml_host___link_id;
+ host_link.link_up = A_surfxml_host___link_up;
+ host_link.link_down = A_surfxml_host___link_down;
+ sg_platf_new_host_link(&host_link);
+}
+
+void STag_surfxml_router(void){
+ s_sg_platf_router_cbarg_t router;
+ memset(&router, 0, sizeof(router));
+
+ router.id = A_surfxml_router_id;
+ router.coord = A_surfxml_router_coordinates;
+
+ sg_platf_new_router(&router);
+}
+
+void STag_surfxml_cluster(void){
+ s_sg_platf_cluster_cbarg_t cluster;
+ memset(&cluster,0,sizeof(cluster));
+ cluster.id = A_surfxml_cluster_id;
+ cluster.prefix = A_surfxml_cluster_prefix;
+ cluster.suffix = A_surfxml_cluster_suffix;
+ cluster.radical = A_surfxml_cluster_radical;
+ cluster.power = surf_parse_get_power(A_surfxml_cluster_power);
+ cluster.core_amount = surf_parse_get_int(A_surfxml_cluster_core);
+ cluster.bw = surf_parse_get_bandwidth(A_surfxml_cluster_bw);
+ cluster.lat = surf_parse_get_time(A_surfxml_cluster_lat);
+ if(strcmp(A_surfxml_cluster_bb___bw,""))
+ cluster.bb_bw = surf_parse_get_bandwidth(A_surfxml_cluster_bb___bw);
+ if(strcmp(A_surfxml_cluster_bb___lat,""))
+ cluster.bb_lat = surf_parse_get_time(A_surfxml_cluster_bb___lat);
+ if(strcmp(A_surfxml_cluster_limiter___link,""))
+ cluster.limiter_link = surf_parse_get_double(A_surfxml_cluster_limiter___link);
+ if(strcmp(A_surfxml_cluster_loopback___bw,""))
+ cluster.loopback_bw = surf_parse_get_bandwidth(A_surfxml_cluster_loopback___bw);
+ if(strcmp(A_surfxml_cluster_loopback___lat,""))
+ cluster.loopback_lat = surf_parse_get_time(A_surfxml_cluster_loopback___lat);
+ cluster.router_id = A_surfxml_cluster_router___id;
+
+ switch (AX_surfxml_cluster_sharing___policy) {
+ case A_surfxml_cluster_sharing___policy_SHARED:
+ cluster.sharing_policy = SURF_LINK_SHARED;
+ break;
+ case A_surfxml_cluster_sharing___policy_FULLDUPLEX:
+ cluster.sharing_policy = SURF_LINK_FULLDUPLEX;
+ break;
+ case A_surfxml_cluster_sharing___policy_FATPIPE:
+ cluster.sharing_policy = SURF_LINK_FATPIPE;
+ break;
+ default:
+ surf_parse_error("Invalid cluster sharing policy for cluster %s",
+ cluster.id);
+ break;
+ }
+ switch (AX_surfxml_cluster_bb___sharing___policy) {
+ case A_surfxml_cluster_bb___sharing___policy_FATPIPE:
+ cluster.bb_sharing_policy = SURF_LINK_FATPIPE;
+ break;
+ case A_surfxml_cluster_bb___sharing___policy_SHARED:
+ cluster.bb_sharing_policy = SURF_LINK_SHARED;
+ break;
+ default:
+ surf_parse_error("Invalid bb sharing policy in cluster %s",
+ cluster.id);
+ break;
+ }