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)
27 std::sort(pneigh.begin(),pneigh.end(),compare());
36 for (unsigned i = 0 ; i < pneigh.size() ; ++i) {
37 double l = pneigh[i]->get_load();
42 pneigh[i]->set_load(l+1);
43 pneigh[i]->add_to_send(1);
44 INFO1("sent to %s",pneigh[i]->get_name());