]> AND Private Git Repository - loba.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Bug fix: only send to a lesser loaded neighbor!
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 25 Jan 2011 11:05:47 +0000 (12:05 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 25 Jan 2011 12:25:35 +0000 (13:25 +0100)
TODO
loba_fairstrategy.cpp

diff --git a/TODO b/TODO
index 2083dab8e9c23f6f735ea1fb28058628ac2c7c09..42ec2773cd0e883694b78e1eebe67735d9653c55 100644 (file)
--- 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.
index 7495655b2b575c733322f42b698859f41bc7317f..9942fac1b1847616a9518788df811ceb2d38cb0e 100644 (file)
@@ -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);