3 // FIXME: could cause trouble with multithreaded procs on same host...
4 void smpi_bench_begin()
6 int rank = smpi_mpi_comm_rank_self(smpi_mpi_global->mpi_comm_world);
8 SIMIX_mutex_lock(smpi_global->timers_mutexes[rank]);
10 xbt_os_timer_start(smpi_global->timers[rank]);
17 int rank = smpi_mpi_comm_rank_self(smpi_mpi_global->mpi_comm_world);
20 char computation[] = "computation";
25 xbt_os_timer_stop(smpi_global->timers[rank]);
27 duration = xbt_os_timer_elapsed(smpi_global->timers[rank]);
29 SIMIX_mutex_unlock(smpi_global->timers_mutexes[rank]);
31 host = smpi_mpi_global->mpi_comm_world->hosts[rank];
32 action = SIMIX_action_execute(host, computation, duration * SMPI_DEFAULT_SPEED);
33 mutex = SIMIX_mutex_init();
34 cond = SIMIX_cond_init();
36 SIMIX_mutex_lock(mutex);
37 SIMIX_register_action_to_condition(action, cond);
38 SIMIX_cond_wait(cond, mutex);
39 SIMIX_unregister_action_to_condition(action, cond);
40 SIMIX_mutex_unlock(mutex);
42 SIMIX_mutex_destroy(mutex);
43 SIMIX_cond_destroy(cond);
44 //SIMIX_action_destroy(action);
46 // FIXME: check for success/failure?