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 double l = pneigh[i]->get_load();
35 if (l < my_load + 2) {
37 pneigh[i]->add_load(1);
38 pneigh[i]->add_to_send(1);
39 INFO1("sent to %s", pneigh[i]->get_name());