+ cluster.availability_trace = A_surfxml_cluster_availability_file;
+ cluster.state_trace = A_surfxml_cluster_state_file;
+ sg_platf_new_cluster(&cluster);
+}
+void ETag_surfxml_cluster(void){
+ /* nothing I can think of */
+}
+
+void STag_surfxml_peer(void){
+ s_sg_platf_peer_cbarg_t peer;
+ memset(&peer,0,sizeof(peer));
+ peer.id = A_surfxml_peer_id;
+ peer.power = surf_parse_get_double(A_surfxml_peer_power);
+ peer.bw_in = surf_parse_get_double(A_surfxml_peer_bw_in);
+ peer.bw_out = surf_parse_get_double(A_surfxml_peer_bw_out);
+ peer.lat = surf_parse_get_double(A_surfxml_peer_lat);
+ peer.coord = A_surfxml_peer_coordinates;
+ peer.availability_trace = tmgr_trace_new(A_surfxml_peer_availability_file);
+ peer.state_trace = tmgr_trace_new(A_surfxml_peer_state_file);
+
+ surfxml_call_cb_functions(STag_surfxml_peer_cb_list);
+ sg_platf_new_peer(&peer);
+}
+void ETag_surfxml_peer(void){
+ /* nothing to do here */
+}
+void STag_surfxml_link(void){
+ s_sg_platf_link_cbarg_t link;
+ memset(&link,0,sizeof(link));
+
+ xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+ link.properties = current_property_set = xbt_dict_new_homogeneous(xbt_free_f);
+
+ link.id = A_surfxml_link_id;
+ link.bandwidth = surf_parse_get_double(A_surfxml_link_bandwidth);
+ link.bandwidth_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
+ link.latency = surf_parse_get_double(A_surfxml_link_latency);
+ link.latency_trace = tmgr_trace_new(A_surfxml_link_latency_file);
+
+ switch (A_surfxml_link_state) {
+ case A_surfxml_link_state_ON:
+ link.state = SURF_RESOURCE_ON;
+ break;
+ case A_surfxml_link_state_OFF:
+ link.state = SURF_RESOURCE_OFF;
+ break;
+ default:
+ surf_parse_error(bprintf("invalid state for link %s",link.id));
+ }
+ link.state_trace = tmgr_trace_new(A_surfxml_link_state_file);
+
+ switch (A_surfxml_link_sharing_policy) {
+ case A_surfxml_link_sharing_policy_SHARED:
+ link.policy = SURF_LINK_SHARED;
+ break;
+ case A_surfxml_link_sharing_policy_FATPIPE:
+ link.policy = SURF_LINK_FATPIPE;
+ break;
+ case A_surfxml_link_sharing_policy_FULLDUPLEX:
+ link.policy = SURF_LINK_FULLDUPLEX;
+ break;
+ default:
+ surf_parse_error(bprintf("Invalid sharing policy in link %s",link.id));
+ }
+
+ sg_platf_new_link(&link);
+}
+void ETag_surfxml_link(void){
+ current_property_set = NULL;
+}
+
+void STag_surfxml_route(void){
+ surfxml_call_cb_functions(STag_surfxml_route_cb_list);
+}
+void STag_surfxml_link_ctn(void){
+ surfxml_call_cb_functions(STag_surfxml_link_ctn_cb_list);
+}
+void STag_surfxml_process(void){
+ surfxml_call_cb_functions(STag_surfxml_process_cb_list);
+}
+void STag_surfxml_argument(void){
+ surfxml_call_cb_functions(STag_surfxml_argument_cb_list);
+}
+void STag_surfxml_prop(void){
+ surfxml_call_cb_functions(STag_surfxml_prop_cb_list);
+}
+void STag_surfxml_trace(void){
+ surfxml_call_cb_functions(STag_surfxml_trace_cb_list);
+}
+void STag_surfxml_trace_connect(void){
+ surfxml_call_cb_functions(STag_surfxml_trace_connect_cb_list);
+}
+void STag_surfxml_AS(void){
+ sg_platf_new_AS_begin(A_surfxml_AS_id,A_surfxml_AS_routing);
+}
+void ETag_surfxml_AS(void){
+ sg_platf_new_AS_end();
+}
+void STag_surfxml_ASroute(void){
+ surfxml_call_cb_functions(STag_surfxml_ASroute_cb_list);
+}
+void STag_surfxml_bypassRoute(void){
+ surfxml_call_cb_functions(STag_surfxml_bypassRoute_cb_list);
+}
+void STag_surfxml_config(void){
+ XBT_DEBUG("START configuration name = %s",A_surfxml_config_id);
+ xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+ current_property_set = xbt_dict_new_homogeneous(xbt_free_f);
+
+}
+void ETag_surfxml_config(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);
+ xbt_dict_free(¤t_property_set);
+}
+void STag_surfxml_random(void){
+ surfxml_call_cb_functions(STag_surfxml_random_cb_list);