var->weight = weight;
var->bound = bound;
var->value = 0.0;
- var->df = 0.0;
+
var->func_f = func_f_def;
var->func_fp = func_fp_def;
xbt_swag_t var_list = NULL;
xbt_swag_t elem_list = NULL;
double min_usage = -1;
+ double min_bound = -1;
if (!(sys->modified))
return;
var, var->bound, var->weight, min_usage,
var->bound * var->weight);
if ((var->bound > 0) && (var->bound * var->weight < min_usage)) {
- min_usage = var->bound * var->weight;
- DEBUG1("Updated min_usage=%f", min_usage);
+ if(min_bound<0)
+ min_bound = var->bound;
+ else
+ min_bound = MIN(min_bound,var->bound);
+ DEBUG1("Updated min_bound=%f", min_bound);
}
}
while ((var = xbt_swag_getFirst(var_list))) {
int i;
- var->value = min_usage / var->weight;
+ if(min_bound<0) {
+ var->value = min_usage / var->weight;
+ } else {
+ if(min_bound == var->bound)
+ var->value = var->bound;
+ else {
+ xbt_swag_remove(var, var_list);
+ continue;
+ }
+ }
DEBUG5("Min usage: %f, Var(%p)->weight: %f, Var(%p)->value: %f ",
min_usage, var, var->weight, var, var->value);
/* Find out which variables reach the maximum */
cnst_list = &(sys->active_constraint_set);
min_usage = -1;
+ min_bound = -1;
xbt_swag_foreach(cnst, cnst_list) {
saturated_constraint_set_update(sys, cnst, &min_usage);
}
var->bound = bound;
}
-/** \brief Add the value delta to var->df (the sum of latencies).
- *
- * \param sys the lmm_system_t associated
- * \param var the lmm_variable_t which need to updated
- * \param delta the variation of the latency
- *
- * Add the value delta to var->df (the sum of latencys associated to the
- * flow). Whenever this function is called a change is signed in the system. To
- * avoid false system changing detection it is a good idea to test
- * (delta != 0) before calling it.
- *
- */
-void lmm_update_variable_latency(lmm_system_t sys, lmm_variable_t var,
- double delta)
-{
- sys->modified = 1;
- var->df += delta;
-}
void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
double weight)