+ s_sg_platf_cluster_cbarg_t cluster;
+ memset(&cluster,0,sizeof(cluster));
+ cluster.properties = current_property_set;
+
+ 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);
+
+ switch(AX_surfxml_cluster_topology){
+ case A_surfxml_cluster_topology_FLAT:
+ cluster.topology= SURF_CLUSTER_FLAT ;
+ break;
+ case A_surfxml_cluster_topology_TORUS:
+ cluster.topology= SURF_CLUSTER_TORUS ;
+ break;
+ default:
+ surf_parse_error("Invalid cluster topology for cluster %s",
+ cluster.id);
+ break;
+ }
+ cluster.topo_parameters = A_surfxml_cluster_topo___parameters;
+ 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;
+ }
+
+ cluster.availability_trace = A_surfxml_cluster_availability___file;
+ cluster.state_trace = A_surfxml_cluster_state___file;
+ sg_platf_new_cluster(&cluster);
+
+ current_property_set = NULL;
+}
+
+void STag_surfxml_cluster(void){
+ xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+}
+
+void STag_surfxml_cabinet(void){
+ s_sg_platf_cabinet_cbarg_t cabinet;
+ memset(&cabinet,0,sizeof(cabinet));
+ cabinet.id = A_surfxml_cabinet_id;
+ cabinet.prefix = A_surfxml_cabinet_prefix;
+ cabinet.suffix = A_surfxml_cabinet_suffix;
+ cabinet.power = surf_parse_get_power(A_surfxml_cabinet_power);
+ cabinet.bw = surf_parse_get_bandwidth(A_surfxml_cabinet_bw);
+ cabinet.lat = surf_parse_get_time(A_surfxml_cabinet_lat);
+ cabinet.radical = A_surfxml_cabinet_radical;
+
+ sg_platf_new_cabinet(&cabinet);