From 9380d7c32eed77c15a12068a4c37d78705271837 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 25 Jan 2011 12:05:47 +0100 Subject: [PATCH] Bug fix: only send to a lesser loaded neighbor! --- TODO | 4 ++++ loba_fairstrategy.cpp | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) 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); -- 2.39.5