statistics ctrl_recv_amount;
statistics ctrl_send_count;
statistics ctrl_recv_count;
+ statistics idle_duration;
statistics convergence;
}
ctrl_recv_amount.push(proc->get_ctrl_recv_amount());
ctrl_send_count.push(proc->get_ctrl_send_count());
ctrl_recv_count.push(proc->get_ctrl_recv_count());
+ idle_duration.push(proc->get_idle_duration());
double c = proc->get_convergence();
if (c != -1.0)
convergence.push(c);
PR_STATS("Computation", comps);
PR_STATS("Comp. iterations", comp_iterations);
PR_STATS("X-Comp. iterations", all_comp_iterations);
+ PR_STATS("Idle duration", idle_duration);
PR_STATS("Data send amount", data_send_amount);
PR_STATS("Data recv amount", data_recv_amount);
PR_STATS("Data send count", data_send_count);
total_load_init += real_load;
received_load = 0.0;
+ idle_duration = 0.0;
convergence = -1.0;
process_counter++;
using std::placeholders::_1;
double next_iter_after_date = MSG_get_clock() + opt::min_comp_iter_duration;
+ double idle_since_date = 0.0;
while (still_running()) {
do {
convergence_check();
// compute
+ idle_duration += MSG_get_clock() - idle_since_date;
++comp_iter;
double flops = opt::comp_cost(real_load);
m_task_t task = MSG_task_create("computation", flops, 0.0, NULL);
add_comp_amount(flops);
MSG_task_destroy(task);
+ idle_since_date = MSG_get_clock();
+
sleep_until_date(next_iter_after_date, opt::min_comp_iter_duration);
}
double get_ctrl_recv_amount() const { return acc.ctrl_recv.amount; }
unsigned get_ctrl_send_count() const { return acc.ctrl_send.count; }
unsigned get_ctrl_recv_count() const { return acc.ctrl_recv.count; }
+ double get_idle_duration() const { return idle_duration; }
double get_convergence() const { return convergence; }
int run();
double expected_load; // expected load in bookkeeping mode
double received_load; // load received from neighbors
+ double idle_duration; // how long we had nothing to compute
double convergence; // date when convergence was achieved, or -1.0
mutex_t mutex; // synchronization between threads