3 int smpi_gettimeofday(struct timeval *tv, struct timezone *tz)
11 now = SIMIX_get_clock();
13 tv->tv_usec = ((now - (double)tv->tv_sec) * 1000000.0);
19 unsigned int smpi_sleep(unsigned int seconds)
27 host = SIMIX_host_self();
28 action = SIMIX_action_sleep(host, seconds);
29 mutex = SIMIX_mutex_init();
30 cond = SIMIX_cond_init();
32 SIMIX_mutex_lock(mutex);
33 SIMIX_register_action_to_condition(action, cond);
34 SIMIX_cond_wait(cond, mutex);
35 SIMIX_unregister_action_to_condition(action, cond);
36 SIMIX_mutex_unlock(mutex);
38 SIMIX_mutex_destroy(mutex);
39 SIMIX_cond_destroy(cond);
40 //SIMIX_action_destroy(action);
46 void smpi_exit(int status)
49 SIMIX_mutex_lock(smpi_global->running_hosts_count_mutex);
50 smpi_global->running_hosts_count--;
51 SIMIX_mutex_unlock(smpi_global->running_hosts_count_mutex);
52 SIMIX_process_kill(SIMIX_process_self());