- // first send() to inform neighbors about our load (force it)
- prev_load_broadcast = !(opt::bookkeeping? expected_load: load);
- send();
- iter = 0;
- while (one_more) {
- if (opt::log_rate && iter % opt::log_rate == 0) {
- if (opt::bookkeeping)
- INFO3("(%u) current load: %g ; expected: %g",
- iter, load, expected_load);
- else
- INFO2("(%u) current load: %g",
- iter, load);
+ comp_iter = lb_iter = 0;
+ while (true) {
+ if (opt::min_iter_duration) {
+ double now = MSG_get_clock();
+ if (now < next_iter_after_date){
+ double delay = next_iter_after_date - now;
+ DEBUG1("sleeping for %g s", delay);
+ MSG_process_sleep(next_iter_after_date - now);
+ }
+ next_iter_after_date = MSG_get_clock() + opt::min_iter_duration;
+ }
+
+ double ld = lb_load();
+ if (ld > 0.0) {
+ ++lb_iter;
+
+ if (opt::log_rate && lb_iter % opt::log_rate == 0) {
+ if (opt::bookkeeping)
+ INFO4("(%u:%u) current load: %g ; expected: %g",
+ lb_iter, comp_iter, load, expected_load);
+ else
+ INFO2("(%u) current load: %g",
+ lb_iter, load);
+ }
+
+ ld -= load_balance(ld);
+
+ print_loads(true, xbt_log_priority_debug);