From 394ea1fb2041bd7757cc048e61f4db02fd119a7f Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Thu, 11 Sep 2014 14:16:26 +0200 Subject: [PATCH] Fix bug in lmm_solve, which triggered incorrect die_impossible situation Copyright alvin 2014 --- src/surf/maxmin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } -- 2.20.1