Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update workstation handling in SimDag. Change the prefix of SimDag functions with...
[simgrid.git] / src / surf / workstation_KCCFLN05.c
index f0ba1e6..056ef5c 100644 (file)
@@ -9,7 +9,7 @@
 #include "xbt/dict.h"
 #include "workstation_KCCFLN05_private.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(workstation_KCCFLN05, surf,
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
                                "Logging specific to the SURF workstation module (KCCFLN05)");
 
 static int nb_workstation = 0;
@@ -257,8 +257,13 @@ static void update_actions_state(double now, double delta)
        surf_double_update(&(deltap), action->latency);
        action->latency = 0.0;
       }
-      if ((action->latency == 0.0) && !(action->suspended))
-       lmm_update_variable_weight(maxmin_system, action->variable, 1.0);
+      if ((action->latency == 0.0) && !(action->suspended)) {
+       if((action)->lat_current==0.0)
+         lmm_update_variable_weight(maxmin_system,action->variable, 1.0);
+       else
+         lmm_update_variable_weight(maxmin_system, action->variable, 
+                                    action->lat_current);
+      }
     }
     surf_double_update(&(action->generic_action.remains),
                       lmm_variable_getvalue(action->variable) * deltap);
@@ -896,6 +901,7 @@ static void resource_init_internal(void)
   surf_workstation_resource->extension_public->execute = execute;
   surf_workstation_resource->extension_public->sleep = action_sleep;
   surf_workstation_resource->extension_public->get_state = resource_get_state;
+  surf_workstation_resource->extension_public->get_speed = get_speed;
   surf_workstation_resource->extension_public->communicate = communicate;
   surf_workstation_resource->extension_public->execute_parallel_task = execute_parallel_task;