double process::total_load_average;
double process::load_diff_threshold;
+std::atomic<int> process::convergence_counter(0);
+
namespace {
void sleep_until_date(double& date, double duration)
proc_mutex->acquire();
process_counter++;
+ convergence_counter++;
total_load_init += real_load;
total_load_running += real_load;
total_load_average = total_load_running / process_counter;
XBT_VERB("current load has diverged: %g (%.4g%%)",
real_load, 100.0 * load_diff / average);
convergence = -1.0;
+ convergence_counter++;
}
} else {
if (converged) {
XBT_VERB("current load has converged: %g (%.4g%%)",
real_load, 100.0 * load_diff / average);
convergence = MSG_get_clock();
+ convergence_counter--;
}
}
}
XBT_VERB("Reached comp_maxiter: %d/%d", comp_iter, opt::comp_maxiter);
last_status = false;
+ } else if (opt::exit_on_convergence && convergence_counter == 0) {
+ XBT_VERB("Global convergence detected");
+ last_status = false;
+
} else if (opt::exit_on_close && close_received) {
XBT_VERB("Close received");
last_status = false;