3 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(loba);
5 #include "loba_simple.h"
8 * load balance with a least-loaded neighbor,
9 * without breaking the ping-pong condition
11 void loba_simple::load_balance()
15 double min = get_load();
17 for (unsigned i = 0 ; i < pneigh.size() ; ++i) {
18 double l = pneigh[i]->get_load();
30 if (imin != -1) { // found someone
31 double balance = std::min((get_load() - min) / 2.0,
33 XBT_DEBUG("%d:%g %d:%g %g %g",
34 imin, min, imax, max, get_load(), balance);
35 send(pneigh[imin], balance);