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 / network.c
index 771b7cd..f8690a8 100644 (file)
@@ -8,7 +8,7 @@
 #include "network_private.h"
 #include "xbt/log.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(network, surf,
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
                                "Logging specific to the SURF network module");
 
 surf_network_resource_t surf_network_resource = NULL;
@@ -311,7 +311,8 @@ static void update_actions_state(double now, double delta)
        action->latency = 0.0;
       }
       if ((action->latency == 0.0) && !(action->suspended)) 
-       lmm_update_variable_weight(maxmin_system, action->variable, 1.0);
+       lmm_update_variable_weight(maxmin_system, action->variable, 
+                                  action->lat_current);
     }
     surf_double_update(&(action->generic_action.remains),
        lmm_variable_getvalue(action->variable) * deltap);
@@ -377,6 +378,9 @@ static void update_resource_state(void *id,
       else 
        lmm_update_variable_bound(maxmin_system, action->variable,
                                  min(action->rate,SG_TCP_CTE_GAMMA / (2.0 * action->lat_current)));
+      if(!(action->suspended))
+       lmm_update_variable_weight(maxmin_system, action->variable, 
+                                  action->lat_current);
     }
   } else if (event_type == nw_link->state_event) {
     if (value > 0)
@@ -464,7 +468,8 @@ static void action_suspend(surf_action_t action)
 static void action_resume(surf_action_t action)
 {
   lmm_update_variable_weight(maxmin_system,
-                            ((surf_action_network_CM02_t) action)->variable, 1.0);
+                            ((surf_action_network_CM02_t) action)->variable, 
+                            ((surf_action_network_CM02_t) action)->lat_current);
   ((surf_action_network_CM02_t) action)->suspended = 0;
 }