X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/eabe7ba29733550e5a69d42533644d8367738343..ec7af36e7c9b3abaae057dace500df700c2620e3:/src/surf/surf_routing.c diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index af28025a48..bc1c332fd3 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -1717,12 +1717,8 @@ static void routing_parse_Speer(void) surfxml_bufferstack_push(1); - SURFXML_BUFFER_SET(AS_id, struct_peer->id); - - SURFXML_BUFFER_SET(AS_routing, "Full"); XBT_DEBUG("", struct_peer->id); - - SURFXML_START_TAG(AS); + sg_platf_new_AS_open(struct_peer->id, "Full"); XBT_DEBUG(" "); host_id = HOST_PEER(struct_peer->id); @@ -1734,46 +1730,38 @@ static void routing_parse_Speer(void) link_backbone = bprintf("%s_backbone", struct_peer->id); XBT_DEBUG("", host_id, struct_peer->power); - A_surfxml_host_state = A_surfxml_host_state_ON; - SURFXML_BUFFER_SET(host_id, host_id); - SURFXML_BUFFER_SET(host_power, struct_peer->power); - SURFXML_BUFFER_SET(host_availability, "1.0"); - SURFXML_BUFFER_SET(host_availability_file, struct_peer->availability_trace); - SURFXML_BUFFER_SET(host_state_file, struct_peer->state_trace); - SURFXML_BUFFER_SET(host_coordinates, ""); - SURFXML_BUFFER_SET(host_core, "1.0"); - SURFXML_START_TAG(host); - SURFXML_END_TAG(host); + s_sg_platf_host_cbarg_t host; + memset(&host,0,sizeof(host)); + host.initial_state = SURF_RESOURCE_ON; + host.id = host_id; + host.power_peak = surf_parse_get_double(struct_peer->power); + host.power_scale = 1.0; + host.power_trace = tmgr_trace_new(struct_peer->availability_trace); + host.state_trace = tmgr_trace_new(struct_peer->state_trace); + host.core_amount = 1; + sg_platf_new_host(&host); + XBT_DEBUG("", router_id, struct_peer->coord); - SURFXML_BUFFER_SET(router_id, router_id); - SURFXML_BUFFER_SET(router_coordinates, struct_peer->coord); - SURFXML_START_TAG(router); - SURFXML_END_TAG(router); + s_sg_platf_router_cbarg_t router; + memset(&router,0,sizeof(router)); + router.id = router_id; + router.coord = struct_peer->coord; + sg_platf_new_router(&router); XBT_DEBUG("", link_id_up, struct_peer->bw_in, struct_peer->lat); - A_surfxml_link_state = A_surfxml_link_state_ON; - A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED; - SURFXML_BUFFER_SET(link_id, link_id_up); - SURFXML_BUFFER_SET(link_bandwidth, struct_peer->bw_in); - SURFXML_BUFFER_SET(link_latency, struct_peer->lat); - SURFXML_BUFFER_SET(link_bandwidth_file, ""); - SURFXML_BUFFER_SET(link_latency_file, ""); - SURFXML_BUFFER_SET(link_state_file, ""); - SURFXML_START_TAG(link); - SURFXML_END_TAG(link); + s_sg_platf_link_cbarg_t link; + memset(&link,0,sizeof(link)); + link.state = SURF_RESOURCE_ON; + link.policy = SURF_LINK_SHARED; + link.id = link_id_up; + link.bandwidth = surf_parse_get_double(struct_peer->bw_in); + link.latency = surf_parse_get_double(struct_peer->lat); + sg_platf_new_link(&link); XBT_DEBUG("", link_id_down, struct_peer->bw_out, struct_peer->lat); - A_surfxml_link_state = A_surfxml_link_state_ON; - A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED; - SURFXML_BUFFER_SET(link_id, link_id_down); - SURFXML_BUFFER_SET(link_bandwidth, struct_peer->bw_out); - SURFXML_BUFFER_SET(link_latency, struct_peer->lat); - SURFXML_BUFFER_SET(link_bandwidth_file, ""); - SURFXML_BUFFER_SET(link_latency_file, ""); - SURFXML_BUFFER_SET(link_state_file, ""); - SURFXML_START_TAG(link); - SURFXML_END_TAG(link); + link.id = link_id_down; + sg_platf_new_link(&link); XBT_DEBUG(" "); @@ -1812,7 +1800,7 @@ static void routing_parse_Speer(void) SURFXML_END_TAG(route); XBT_DEBUG(""); - SURFXML_END_TAG(AS); + sg_platf_new_AS_close(); XBT_DEBUG(" "); //xbt_dynar_free(&tab_elements_num);