4 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(loba);
6 #include "loba_fairstrategy.h"
9 * load balance with a least-loaded neighbor,
10 * without breaking the ping-pong condition
15 bool operator()(const neighbor*a, const neighbor*b) {
16 return a->get_load() > b->get_load();
20 double loba_fairstrategy::load_balance(double my_load)
22 std::sort(pneigh.begin(), pneigh.end(), compare());
31 for (unsigned i = 0 ; i < pneigh.size() ; ++i) {
32 if (pneigh[i]->get_load() <= my_load - 2) {
34 pneigh[i]->add_load(1);
35 pneigh[i]->add_to_send(1);
36 INFO1("sent to %s", pneigh[i]->get_name());