+ using std::tr1::bind;
+ using std::tr1::placeholders::_1;
+
+ double next_iter_after_date = 0.0;
+ while (still_running()) {
+ // receive
+ double sleep_duration = real_load
+ ? std::max(MSG_get_clock() - next_iter_after_date, 0.0)
+ : opt::min_comp_iter_duration;
+ data_receive(sleep_duration);
+
+ comm.data_flush(false);
+
+ if (real_load == 0.0)
+ continue;
+
+ // send
+ std::for_each(neigh.begin(), neigh.end(),
+ bind(&process::data_send, this, _1));
+
+ // compute
+ ++comp_iter;
+ double flops = opt::comp_cost(real_load);
+ m_task_t task = MSG_task_create("computation", flops, 0.0, NULL);
+ TRACE_msg_set_task_category(task, TRACE_CAT_COMP);
+ XBT_DEBUG("compute %g flop%s", flops, ESSE(flops));
+ MSG_task_execute(task);
+ comp += flops;
+ MSG_task_destroy(task);
+
+ next_iter_after_date = MSG_get_clock() + opt::min_comp_iter_duration;
+ }