A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stupid me! Bug fix in the maxmin algorithm (occurs only when using
[simgrid.git]
/
src
/
surf
/
maxmin.c
diff --git
a/src/surf/maxmin.c
b/src/surf/maxmin.c
index
9a01021
..
5396bee
100644
(file)
--- a/
src/surf/maxmin.c
+++ b/
src/surf/maxmin.c
@@
-419,21
+419,22
@@
void lmm_solve(lmm_system_t sys)
cnst->remaining = cnst->bound;
cnst->usage = 0;
elem_list = &(cnst->element_set);
cnst->remaining = cnst->bound;
cnst->usage = 0;
elem_list = &(cnst->element_set);
+ cnst->usage = 0.0;
xbt_swag_foreach(elem, elem_list) {
if(elem->variable->weight <=0) break;
if ((elem->value > 0)) {
if(cnst->shared)
cnst->usage += elem->value / elem->variable->weight;
else
xbt_swag_foreach(elem, elem_list) {
if(elem->variable->weight <=0) break;
if ((elem->value > 0)) {
if(cnst->shared)
cnst->usage += elem->value / elem->variable->weight;
else
- cnst->usage = 1;
+ if(cnst->usage<elem->value / elem->variable->weight)
+ cnst->usage = elem->value / elem->variable->weight;
+ DEBUG2("Constraint Usage %p : %f",cnst,cnst->usage);
make_elem_active(elem);
}
}
make_elem_active(elem);
}
}
-
/* Saturated constraints update */
saturated_constraint_set_update(sys, cnst, &min_usage);
}
/* Saturated constraints update */
saturated_constraint_set_update(sys, cnst, &min_usage);
}
-
saturated_variable_set_update(sys);
/* Saturated variables update */
saturated_variable_set_update(sys);
/* Saturated variables update */
@@
-458,6
+459,8
@@
void lmm_solve(lmm_system_t sys)
int i;
var->value = min_usage / var->weight;
int i;
var->value = min_usage / var->weight;
+ DEBUG5("Min usage: %f, Var(%p)->weight: %f, Var(%p)->value: %f ",min_usage,var,var->weight,var,var->value);
+
/* Update usage */
/* Update usage */