X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7a3353b9b1941eb4186036b347e440b3f97bdb62..814d4af13ed8d7d2c2cd914013ea09231f1ee0ff:/src/surf/maxmin.c diff --git a/src/surf/maxmin.c b/src/surf/maxmin.c index 5396beecab..3e9b4a4d5b 100644 --- a/src/surf/maxmin.c +++ b/src/surf/maxmin.c @@ -370,6 +370,12 @@ void lmm_print(lmm_system_t sys) sprintf(print_buf,"0 <= %f ('%p')",cnst->bound,cnst); trace_buf = xbt_realloc(trace_buf,strlen(trace_buf)+strlen(print_buf)+1); strcat(trace_buf, print_buf); + + if(!cnst->shared) { + sprintf(print_buf," [MAX-Constraint]"); + trace_buf = xbt_realloc(trace_buf,strlen(trace_buf)+strlen(print_buf)+1); + strcat(trace_buf, print_buf); + } DEBUG1("%s",trace_buf); trace_buf[0]='\000'; xbt_assert2((sum<=cnst->bound), "Incorrect value (%f is not smaller than %f)", @@ -470,8 +476,21 @@ void lmm_solve(lmm_system_t sys) if(cnst->shared) { double_update(&(cnst->remaining), elem->value * var->value); double_update(&(cnst->usage), elem->value / var->weight); + make_elem_inactive(elem); + } else { /* FIXME one day: We recompute usage.... :( */ + cnst->usage = 0.0; + make_elem_inactive(elem); + xbt_swag_foreach(elem, elem_list) { + if(elem->variable->weight <=0) break; + if(elem->variable->value > 0) break; + if ((elem->value > 0)) { + if(cnst->usagevalue / elem->variable->weight) + cnst->usage = elem->value / elem->variable->weight; + DEBUG2("Constraint Usage %p : %f",cnst,cnst->usage); + make_elem_active(elem); + } + } } - make_elem_inactive(elem); } xbt_swag_remove(var, var_list); }