- INFO1("Initial load: %g", load);
- VERB0("Starting...");
- // first send() to inform neighbors about our load (force it)
- prev_load_broadcast = -1;
- iter = 0;
- bool one_more = true;
- do {
- ++iter;
-
- 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);
+ double next_iter_after_date = 0.0;
+ XBT_INFO("Initial load: %g", real_load);
+ XBT_VERB("Starting...");
+ while (true) {
+ if (get_load() > 0.0) {
+ double now = MSG_get_clock();
+ if (now < next_iter_after_date)
+ MSG_process_sleep(next_iter_after_date - now);
+ next_iter_after_date = MSG_get_clock() + opt::min_iter_duration;
+
+ ++lb_iter;
+
+ if (opt::log_rate && lb_iter % opt::log_rate == 0) {
+ if (opt::bookkeeping)
+ XBT_INFO("(%u:%u) current load: %g ; expected: %g",
+ lb_iter, comp_iter, real_load, expected_load);
+ else
+ XBT_INFO("(%u) current load: %g",
+ lb_iter, real_load);
+ }
+
+ load_balance();
+
+ print_loads(true, xbt_log_priority_debug);