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 void loba_fairstrategy::load_balance()
22 std::sort(pneigh.begin(), pneigh.end(), compare());
25 //print_loads_p(false, xbt_log_priority_debug);
31 for (unsigned i = 0 ; i < pneigh.size() ; ++i) {
32 if (pneigh[i]->get_load() <= get_load() - 2) {
35 DEBUG1("sent to %s", pneigh[i]->get_name());