-/**
- * \brief Return the state of a workstation
- *
- * Return the state of a workstation. Two states are possible, 1 if the host is active or 0 if it has crashed.
- * \param host The SIMIX host
- * \return 1 if host is available or 0 if not.
- */
-int SIMIX_host_get_state(smx_host_t host)
+void SIMIX_host_execution_resume(smx_action_t action)
+{
+ if(action->execution.surf_exec)
+ surf_workstation_model->resume(action->execution.surf_exec);
+}
+
+void SIMIX_execution_finish(smx_action_t action)
+{
+ xbt_fifo_item_t item;
+ smx_simcall_t simcall;
+
+ xbt_fifo_foreach(action->simcalls, item, simcall, smx_simcall_t) {
+
+ switch (action->state) {
+
+ case SIMIX_DONE:
+ /* do nothing, action done */
+ XBT_DEBUG("SIMIX_execution_finished: execution successful");
+ break;
+
+ case SIMIX_FAILED:
+ XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->smx_host->name);
+ SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
+ break;
+
+ case SIMIX_CANCELED:
+ XBT_DEBUG("SIMIX_execution_finished: execution canceled");
+ SMX_EXCEPTION(simcall->issuer, cancel_error, 0, "Canceled");
+ break;
+
+ default:
+ xbt_die("Internal error in SIMIX_execution_finish: unexpected action state %d",
+ (int)action->state);
+ }
+ simcall->issuer->waiting_action = NULL;
+ simcall->host_execution_wait.result = action->state;
+ SIMIX_simcall_answer(simcall);
+ }
+
+ /* We no longer need it */
+ SIMIX_host_execution_destroy(action);
+}
+
+void SIMIX_post_host_execute(smx_action_t action)