git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6507
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
smx_process_t *main_processes;
xbt_os_timer_t timer;
- smx_mutex_t timer_mutex;
smx_cond_t timer_cond;
// keeps track of previous times
smx_action_t action;
e_surf_action_state_t state;
+ if (duration < 0.001)
+ return;
+ DEBUG1("Sleep for %f to handle real computation time",duration);
SIMIX_mutex_lock(mutex);
action =
void smpi_start_timer()
{
- SIMIX_mutex_lock(smpi_global->timer_mutex);
xbt_os_timer_start(smpi_global->timer);
}
double duration;
xbt_os_timer_stop(smpi_global->timer);
duration = xbt_os_timer_elapsed(smpi_global->timer);
- SIMIX_mutex_unlock(smpi_global->timer_mutex);
return duration;
}
// timers
smpi_global->timer = xbt_os_timer_new();
- smpi_global->timer_mutex = SIMIX_mutex_init();
smpi_global->timer_cond = SIMIX_cond_init();
smpi_global->do_once_duration_nodes = NULL;
xbt_mallocator_free(smpi_global->message_mallocator);
xbt_os_timer_free(smpi_global->timer);
- SIMIX_mutex_destroy(smpi_global->timer_mutex);
SIMIX_cond_destroy(smpi_global->timer_cond);
for (curr = smpi_global->do_once_duration_nodes; NULL != curr; curr = next) {