From: Arnaud Giersch Date: Thu, 22 Sep 2011 14:30:17 +0000 (+0200) Subject: Temporarily use opt::option_x in algorithms (2)besteffort. X-Git-Tag: exp_20120216~43 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/64c0f9cb9f?ds=sidebyside;hp=ada04f5ebefdfe318749f9ede9ea4bb0de2f0f7c Temporarily use opt::option_x in algorithms (2)besteffort. --- diff --git a/TODO b/TODO index 93df78f..e99ae98 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,6 @@ +* Remove usage of opt::option_x in loba_besteffort.cpp and loba_2besteffort.cpp + Either simply remove it, or change it to a real option. + * Support heterogeneous platforms? Not sure yet. Should be doable if each process also sends its speed to its neighbors. diff --git a/loba_2besteffort.cpp b/loba_2besteffort.cpp index 967476e..820c7a5 100644 --- a/loba_2besteffort.cpp +++ b/loba_2besteffort.cpp @@ -31,6 +31,8 @@ void loba_2besteffort::load_balance() // don't continue if get_load() <= mean, or pneigh[i]->get_load >= mean if (transfer <= 0.0) break; + if (opt::option_x) + transfer /= opt::option_x; // HACK!!! send(pneigh[i], transfer); XBT_DEBUG("sent %g to %s", transfer, pneigh[i]->get_name()); } diff --git a/loba_besteffort.cpp b/loba_besteffort.cpp index fa72730..22343e0 100644 --- a/loba_besteffort.cpp +++ b/loba_besteffort.cpp @@ -26,6 +26,8 @@ void loba_besteffort::load_balance() double mean = sum / (bound + 1); for (unsigned i = 0 ; i < bound ; ++i) { double transfer = mean - pneigh[i]->get_load(); + if (opt::option_x) + transfer /= opt::option_x; // HACK!!! send(pneigh[i], transfer); XBT_DEBUG("sent %g to %s", transfer, pneigh[i]->get_name()); }