X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/545f0b9843546b80c87905a6ccc637506ecee6d9..180febe078089bb7d5e6ee141fc17115c2f8a0a1:/src/surf/surfxml_parse.c diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 4d4bbb2741..933996d9c7 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -709,7 +709,6 @@ static void parse_host_foreach(void){ const char *surfxml_host_availability_file = A_surfxml_host_availability_file; const char *surfxml_host_state_file = A_surfxml_host_state_file; - xbt_dict_t cluster_host_props = current_property_set; names = xbt_dict_get_or_null(set_list, foreach_set_name); @@ -1167,6 +1166,9 @@ static void add_randomness(void) xbt_dict_set(random_data_list, random_id, (void *) random, NULL); } +/** + * create CPU resource via CPU Model + */ void surf_host_create_resource(char *name, double power_peak, double power_scale, tmgr_trace_t power_trace, @@ -1178,8 +1180,24 @@ void surf_host_create_resource(char *name, double power_peak, create_resource(name,power_peak,power_scale,power_trace,state_initial,state_trace,cpu_properties); } +/* + * create CPU resource via worsktation_ptask_L07 model + */ -void surf_link_create_resouce(char *name, +void surf_wsL07_host_create_resource(char *name, double power_peak, + double power_scale, + tmgr_trace_t power_trace, + e_surf_resource_state_t state_initial, + tmgr_trace_t state_trace, + xbt_dict_t cpu_properties) +{ + surf_workstation_model->extension.workstation. + cpu_create_resource(name,power_peak,power_scale,power_trace,state_initial,state_trace,cpu_properties); +} +/* + * create link resource via network Model + */ +void surf_link_create_resource(char *name, double bw_initial, double lat_initial) { @@ -1188,6 +1206,19 @@ void surf_link_create_resouce(char *name, } +/* + * create link resource via workstation_ptask_L07 model + */ + +void surf_wsL07_link_create_resource(char *name, + double bw_initial, + double lat_initial) +{ + return surf_workstation_model->extension.workstation. + link_create_resource(name,bw_initial,lat_initial); +} + + /** * Route: add route element bypassing the parser : * same job as parse_route_elem @@ -1195,5 +1226,53 @@ void surf_link_create_resouce(char *name, void surf_add_route_element(char* link_ctn_id) { - xbt_dynar_push(route_link_list,&link_ctn_id); + char *val; + val = xbt_strdup(link_ctn_id); + xbt_dynar_push(route_link_list,&val); } +/** + * set route + */ +void surf_route_set_resource(char *source_id,char *destination_id,xbt_dynar_t links_id,int action) +{ + route_link_list = xbt_dynar_new(sizeof(char *), NULL); + routing_add_route(source_id,destination_id,links_id,action); + +} + +/** + * add host to routing host list + */ +void surf_route_add_host(char *host_id) +{ + routing_add_host(host_id); +} + +/* + * Add Traces + */ +void surf_add_host_traces(void) +{ + return surf_cpu_model->extension.cpu. + add_traces(); +} + +void surf_add_link_traces(void) +{ + return surf_network_model->extension.network. + add_traces(); +} + +void surf_wsL07_add_traces(void) +{ + return surf_workstation_model->extension.workstation. + add_traces(); +} +/** + * set routes + */ +void surf_set_routes(void) +{ + routing_set_routes(); +} +