Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Factorize some code in the parser, hide some functions and variables, avoid useless...
[simgrid.git] / src / surf / workstation_ptask_L07.c
index de44851..b72a43d 100644 (file)
@@ -361,7 +361,7 @@ static void update_actions_state(double now, double delta)
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
-                                 double value)
+                                 double value, double date)
 {
   cpu_L07_t cpu = id;
   link_L07_t nw_link = id;
@@ -375,10 +375,11 @@ static void update_resource_state(void *id,
     } else if (event_type == nw_link->lat_event) {
       lmm_variable_t var = NULL;
       surf_action_workstation_L07_t action = NULL;
+      lmm_element_t elem = NULL;
 
       nw_link->lat_current = value;
-      while (lmm_get_var_from_cnst
-            (ptask_maxmin_system, nw_link->constraint, &var)) {
+      while ((var = lmm_get_var_from_cnst
+            (ptask_maxmin_system, nw_link->constraint, &elem))) {
        
 
        action = lmm_variable_id(var);
@@ -867,8 +868,6 @@ static void parse_route_set_endpoints(void)
     dst_id = cpu_tmp->id;
 
   route_action = A_surfxml_route_action;
-
-  route_link_list = xbt_dynar_new(sizeof(char*), &free_string);
 }
 
 static void parse_route_set_route(void)
@@ -937,8 +936,6 @@ static void add_route(void)
        }
        route_new(src_id, dst_id, link_list, nb_link);
    }
-
-   xbt_dict_free(&route_table);
 }
 
 static void add_traces(void) {   
@@ -1043,9 +1040,7 @@ static void define_callbacks(const char *file)
   surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties);
   surfxml_add_callback(STag_surfxml_link_cb_list, &parse_link_init);
   surfxml_add_callback(STag_surfxml_route_cb_list, &parse_route_set_endpoints);
-  surfxml_add_callback(ETag_surfxml_link_c_ctn_cb_list, &parse_route_elem);
   surfxml_add_callback(ETag_surfxml_route_cb_list, &parse_route_set_route);
-  surfxml_add_callback(STag_surfxml_platform_cb_list, &init_data);
   surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_route);
   surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_loopback);
   surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces);
@@ -1166,8 +1161,7 @@ void surf_workstation_model_init_ptask_L07(const char *filename)
   define_callbacks(filename);
 
   update_model_description(surf_workstation_model_description,
-                             surf_workstation_model_description_size,
-                             "ptask_L07",
-                             (surf_model_t) surf_workstation_model);
+                          "ptask_L07",
+                          (surf_model_t) surf_workstation_model);
   xbt_dynar_push(model_list, &surf_workstation_model);
 }