- /* Handle any pending timer */
- while (xbt_heap_size(simix_timers) > 0 && SIMIX_get_clock() >= SIMIX_timer_next()) {
- //FIXME: make the timers being real callbacks
- // (i.e. provide dispatchers that read and expand the args)
- timer = (smx_timer_t) xbt_heap_pop(simix_timers);
- try {
- timer->callback();
- }
- catch(...) {
- xbt_die("Exception throwed ouf of timer callback");
- }
- delete timer;
- }
-
- /* Wake up all processes waiting for a Surf action to finish */
- xbt_dynar_foreach(all_existing_models, iter, model) {
- XBT_DEBUG("Handling process whose action failed");
- while ((action = surf_model_extract_failed_action_set(model))) {
- XBT_DEBUG(" Handling Action %p",action);
- SIMIX_simcall_exit((smx_synchro_t) action->getData());
- }
- XBT_DEBUG("Handling process whose action terminated normally");
- while ((action = surf_model_extract_done_action_set(model))) {
- XBT_DEBUG(" Handling Action %p",action);
- if (action->getData() == nullptr)
- XBT_DEBUG("probably vcpu's action %p, skip", action);
- else
- SIMIX_simcall_exit((smx_synchro_t) action->getData());
- }
- }
-
- /* Autorestart all process */
- char *hostname = nullptr;
- xbt_dynar_foreach(host_that_restart,iter,hostname) {
- XBT_INFO("Restart processes on host: %s",hostname);
- SIMIX_host_autorestart(sg_host_by_name(hostname));
- }
- xbt_dynar_reset(host_that_restart);