X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a21681e5aca1a37efb2e9001e5055dec94c5de41..ceeab8813fc0aff89562202f64c29a808e84cb9a:/src/surf/fair_bottleneck.cpp diff --git a/src/surf/fair_bottleneck.cpp b/src/surf/fair_bottleneck.cpp index 0b8a77acfd..684a8cbded 100644 --- a/src/surf/fair_bottleneck.cpp +++ b/src/surf/fair_bottleneck.cpp @@ -1,10 +1,9 @@ -/* Copyright (c) 2007-2011. The SimGrid Team. +/* Copyright (c) 2007-2011, 2013-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ - #include "xbt/sysdep.h" #include "xbt/log.h" #include "maxmin_private.hpp" @@ -92,18 +91,17 @@ void bottleneck_solve(lmm_system_t sys) cnst = (lmm_constraint_t)_cnst; int nb = 0; XBT_DEBUG("Processing cnst %p ", cnst); - elem_list = &(cnst->element_set); + elem_list = &(cnst->enabled_element_set); cnst->usage = 0.0; xbt_swag_foreach(_elem, elem_list) { elem = (lmm_element_t)_elem; - if (elem->variable->weight <= 0) - break; + xbt_assert(elem->variable->weight > 0); if ((elem->value > 0) && xbt_swag_belongs(elem->variable, var_list)) nb++; } XBT_DEBUG("\tThere are %d variables", nb); - if (nb > 0 && !cnst->shared) + if (nb > 0 && !cnst->sharing_policy) nb = 1; if (!nb) { cnst->remaining = 0.0; @@ -137,17 +135,16 @@ void bottleneck_solve(lmm_system_t sys) xbt_swag_foreach_safe(_cnst, _cnst_next, cnst_list) { cnst = (lmm_constraint_t)_cnst; XBT_DEBUG("Updating cnst %p ", cnst); - elem_list = &(cnst->element_set); + elem_list = &(cnst->enabled_element_set); xbt_swag_foreach(_elem, elem_list) { elem = (lmm_element_t)_elem; - if (elem->variable->weight <= 0) - break; - if (cnst->shared) { + xbt_assert(elem->variable->weight > 0); + if (cnst->sharing_policy) { XBT_DEBUG("\tUpdate constraint %p (%g) with variable %p by %g", cnst, cnst->remaining, elem->variable, elem->variable->mu); double_update(&(cnst->remaining), - elem->value * elem->variable->mu); + elem->value * elem->variable->mu, sg_maxmin_precision); } else { XBT_DEBUG ("\tNon-Shared variable. Update constraint usage of %p (%g) with variable %p by %g", @@ -155,11 +152,11 @@ void bottleneck_solve(lmm_system_t sys) cnst->usage = MIN(cnst->usage, elem->value * elem->variable->mu); } } - if (!cnst->shared) { + if (!cnst->sharing_policy) { XBT_DEBUG("\tUpdate constraint %p (%g) by %g", cnst, cnst->remaining, cnst->usage); - double_update(&(cnst->remaining), cnst->usage); + double_update(&(cnst->remaining), cnst->usage, sg_maxmin_precision); } XBT_DEBUG("\tRemaining for %p : %g", cnst, cnst->remaining);