3 // FIXME: could cause trouble with multithreaded procs on same host...
4 // FIXME: add benchmarking flag?
6 void smpi_bench_begin()
8 int index = smpi_host_index();
10 SIMIX_mutex_lock(smpi_global->timers_mutexes[index]);
12 xbt_os_timer_start(smpi_global->timers[index]);
19 int index = smpi_host_index();
22 char computation[] = "computation";
27 xbt_os_timer_stop(smpi_global->timers[index]);
29 duration = xbt_os_timer_elapsed(smpi_global->timers[index]);
31 SIMIX_mutex_unlock(smpi_global->timers_mutexes[index]);
33 host = smpi_global->hosts[index];
34 action = SIMIX_action_execute(host, computation, duration * SMPI_DEFAULT_SPEED);
35 mutex = SIMIX_mutex_init();
36 cond = SIMIX_cond_init();
38 SIMIX_mutex_lock(mutex);
39 SIMIX_register_action_to_condition(action, cond);
40 SIMIX_cond_wait(cond, mutex);
41 SIMIX_unregister_action_to_condition(action, cond);
42 SIMIX_mutex_unlock(mutex);
44 SIMIX_mutex_destroy(mutex);
45 SIMIX_cond_destroy(cond);
46 //SIMIX_action_destroy(action);