- continue;
- if (l < min) {
- imin = i;
- min = l;
- }
- if (l > max) {
- imax = i;
- max = l;
- }
- }
- if (imin != -1) {
- // found someone
- double balance = (my_load - max) / 2;
- DEBUG6("%d:%g %d:%g %g %g", imin, min, imax, max, my_load, balance);
- pneigh[imin]->set_to_send(balance);
- return balance;
- } else {
- return 0.0;
- }
+ continue;
+ if(l<my_load+2) {
+ found=true;
+ pneigh[i]->set_load(l+1);
+ pneigh[i]->add_to_send(1);
+ INFO1("sent to %s",pneigh[i]->get_name());
+ my_load--;
+ sum_sent++;
+ }
+ }
+ }
+
+
+
+ return sum_sent;
+