3 // FIXME: could cause trouble with multithreaded procs on same host...
4 // FIXME: add benchmarking flag?
6 void smpi_bench_begin()
8 SIMIX_mutex_lock(smpi_global->timer_mutex);
9 xbt_os_timer_start(smpi_global->timer);
17 char computation[] = "computation";
20 xbt_os_timer_stop(smpi_global->timer);
21 duration = xbt_os_timer_elapsed(smpi_global->timer);
22 host = SIMIX_host_self();
23 action = SIMIX_action_execute(host, computation, duration * SMPI_DEFAULT_SPEED);
25 SIMIX_register_action_to_condition(action, smpi_global->timer_cond);
26 SIMIX_cond_wait(smpi_global->timer_cond, smpi_global->timer_mutex);
27 SIMIX_unregister_action_to_condition(action, smpi_global->timer_cond);
29 SIMIX_mutex_unlock(smpi_global->timer_mutex);