From: Arnaud Giersch Date: Tue, 25 Jan 2011 11:05:47 +0000 (+0100) Subject: Bug fix: only send to a lesser loaded neighbor! X-Git-Tag: v0.1~188^2~10 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/9380d7c32eed77c15a12068a4c37d78705271837?hp=-c Bug fix: only send to a lesser loaded neighbor! --- 9380d7c32eed77c15a12068a4c37d78705271837 diff --git a/TODO b/TODO index 2083dab..42ec277 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,7 @@ +* BUG + ./loba cluster1000.xml -N64 -L100 -i100 -a fair -T hcube + leads to deadlock + * review receive with timeout. * verify bookkeeping version. diff --git a/loba_fairstrategy.cpp b/loba_fairstrategy.cpp index 7495655..9942fac 100644 --- a/loba_fairstrategy.cpp +++ b/loba_fairstrategy.cpp @@ -29,10 +29,7 @@ double loba_fairstrategy::load_balance(double my_load) while (found) { found = false; for (unsigned i = 0 ; i < pneigh.size() ; ++i) { - double l = pneigh[i]->get_load(); - if (l >= my_load) - continue; - if (l < my_load + 2) { + if (pneigh[i]->get_load() <= my_load - 2) { found = true; pneigh[i]->add_load(1); pneigh[i]->add_to_send(1);