Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Incredible bug fix in function lmm_get_var_from_cnst with bad consequences on trace...
[simgrid.git] / src / surf / workstation_ptask_L07.c
index 2633d46..6c68352 100644 (file)
@@ -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);
@@ -400,7 +401,7 @@ static void update_resource_state(void *id,
     if (event_type == cpu->power_event) {
       cpu->power_current = value;
       lmm_update_constraint_bound(ptask_maxmin_system, cpu->constraint,
-                                 cpu->power_current);
+                                 cpu->power_current * cpu->power_scale);
     } else if (event_type == cpu->state_event) {
       if (value > 0)
        cpu->state_current = SURF_CPU_ON;