Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix bug #17132 (surf.c:366: The Impossible Did Happen (yet again)).
authorArnaud Legrand <arnaud.legrand@imag.fr>
Thu, 3 Apr 2014 15:44:46 +0000 (17:44 +0200)
committerArnaud Legrand <arnaud.legrand@imag.fr>
Thu, 3 Apr 2014 15:44:46 +0000 (17:44 +0200)
This occured only when a fatpipe had two (or more) flows with different bandwidth bounds. Only one would get bandwidth and because of early termination in this loop, the constraint was never considered ever again, hence the other flow would stay with a share of 0.

src/surf/maxmin.cpp

index c2d5e55..8f88519 100644 (file)
@@ -746,8 +746,8 @@ void lmm_solve(lmm_system_t sys)
           elem_list = &(cnst->element_set);
           xbt_swag_foreach(_elem, elem_list) {
                elem = (lmm_element_t)_elem;
-            if (elem->variable->weight <= 0 || elem->variable->value > 0)
-              break;
+            if (elem->variable->weight <= 0) break;
+            if (elem->variable->value > 0) continue;
             if (elem->value > 0)
               cnst->usage = MAX(cnst->usage, elem->value / elem->variable->weight);
           }