Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a new weight field to actions so that we do not confuse it anymore with the late_...
authorvelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 16 Oct 2008 14:32:14 +0000 (14:32 +0000)
committervelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 16 Oct 2008 14:32:14 +0000 (14:32 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5997 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/network.c
src/surf/network_private.h

index 7f207d0..e5f8a1f 100644 (file)
@@ -21,7 +21,6 @@ xbt_dict_t network_card_set = NULL;
 double latency_factor = 1.0; /* default value */
 double bandwidth_factor = 1.0; /* default value */
 
 double latency_factor = 1.0; /* default value */
 double bandwidth_factor = 1.0; /* default value */
 
-
 int card_number = 0;
 int host_number = 0;
 link_CM02_t **routing_table = NULL;
 int card_number = 0;
 int host_number = 0;
 link_CM02_t **routing_table = NULL;
@@ -404,7 +403,7 @@ static void update_actions_state(double now, double delta)
       }
       if ((action->latency == 0.0) && !(action->suspended))
        lmm_update_variable_weight(network_maxmin_system, action->variable,
       }
       if ((action->latency == 0.0) && !(action->suspended))
        lmm_update_variable_weight(network_maxmin_system, action->variable,
-                                  action->lat_current);
+                                  action->weight);
     }
     double_update(&(action->generic_action.remains),
                  lmm_variable_getvalue(action->variable) * deltap);
     }
     double_update(&(action->generic_action.remains),
                  lmm_variable_getvalue(action->variable) * deltap);
@@ -449,6 +448,7 @@ static void update_resource_state(void *id,
           (network_maxmin_system, nw_link->constraint, &elem))) {
       action = lmm_variable_id(var);
       action->lat_current += delta;
           (network_maxmin_system, nw_link->constraint, &elem))) {
       action = lmm_variable_id(var);
       action->lat_current += delta;
+      action->weight += delta;
       if (action->rate < 0)
        lmm_update_variable_bound(network_maxmin_system, action->variable,
                                  SG_TCP_CTE_GAMMA / (2.0 *
       if (action->rate < 0)
        lmm_update_variable_bound(network_maxmin_system, action->variable,
                                  SG_TCP_CTE_GAMMA / (2.0 *
@@ -462,7 +462,7 @@ static void update_resource_state(void *id,
                                                          lat_current)));
       if (!(action->suspended))
        lmm_update_variable_weight(network_maxmin_system, action->variable,
                                                          lat_current)));
       if (!(action->suspended))
        lmm_update_variable_weight(network_maxmin_system, action->variable,
-                                  action->lat_current);
+                                  action->weight);
 
     }
   } else if (event_type == nw_link->state_event) {
 
     }
   } else if (event_type == nw_link->state_event) {
@@ -545,6 +545,7 @@ static surf_action_t communicate(void *src, void *dst, double size,
   /* LARGE PLATFORMS HACK:
      Add src->link and dst->link latencies */
   action->lat_current = action->latency;
   /* LARGE PLATFORMS HACK:
      Add src->link and dst->link latencies */
   action->lat_current = action->latency;
+  action->weight = action->latency;
   action->latency *= latency_factor;
 
 
   action->latency *= latency_factor;
 
 
@@ -645,7 +646,7 @@ static void action_resume(surf_action_t action)
                               ((surf_action_network_CM02_t) action)->
                               variable,
                               ((surf_action_network_CM02_t) action)->
                               ((surf_action_network_CM02_t) action)->
                               variable,
                               ((surf_action_network_CM02_t) action)->
-                              lat_current);
+                              weight);
     ((surf_action_network_CM02_t) action)->suspended = 0;
   }
 }
     ((surf_action_network_CM02_t) action)->suspended = 0;
   }
 }
index 2d84d82..b22d08a 100644 (file)
@@ -38,6 +38,7 @@ typedef struct surf_action_network_CM02 {
   s_surf_action_t generic_action;
   double latency;
   double lat_current;
   s_surf_action_t generic_action;
   double latency;
   double lat_current;
+  double weight;
   lmm_variable_t variable;
   double rate;
   int suspended;
   lmm_variable_t variable;
   double rate;
   int suspended;