From: Augustin Degomme Date: Thu, 11 Sep 2014 12:16:26 +0000 (+0200) Subject: Fix bug in lmm_solve, which triggered incorrect die_impossible situation X-Git-Tag: v3_12~828 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/394ea1fb2041bd7757cc048e61f4db02fd119a7f Fix bug in lmm_solve, which triggered incorrect die_impossible situation Copyright alvin 2014 --- diff --git a/src/surf/maxmin.cpp b/src/surf/maxmin.cpp index d30d207aee..7310cb0802 100644 --- a/src/surf/maxmin.cpp +++ b/src/surf/maxmin.cpp @@ -692,9 +692,9 @@ void lmm_solve(lmm_system_t sys) var->bound * var->weight); if ((var->bound > 0) && (var->bound * var->weight < min_usage)) { if (min_bound < 0) - min_bound = var->bound; + min_bound = var->bound*var->weight; else - min_bound = MIN(min_bound, var->bound); + min_bound = MIN(min_bound, (var->bound*var->weight)); XBT_DEBUG("Updated min_bound=%f", min_bound); } } @@ -709,7 +709,7 @@ void lmm_solve(lmm_system_t sys) XBT_DEBUG("Setting %p (%d) value to %f\n", var, var->id_int, var->value); } else { //If there exist a variable that can reach its bound, only update it (and other with the same bound) for now. - if (min_bound == var->bound) { + if (min_bound == var->bound*var->weight) { var->value = var->bound; XBT_DEBUG("Setting %p (%d) value to %f\n", var, var->id_int, var->value); }