-/**
- * \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->suspend(action->execution.surf_exec);
+}
+
+void SIMIX_execution_finish(smx_action_t action)
+{
+ xbt_fifo_item_t item;
+ smx_req_t req;
+
+ xbt_fifo_foreach(action->request_list, item, req, smx_req_t) {
+
+ switch (action->state) {
+
+ case SIMIX_DONE:
+ /* do nothing, action done*/
+ XBT_DEBUG("SIMIX_execution_finished: execution successful");
+ break;
+
+ case SIMIX_FAILED:
+ TRY {
+ XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", req->issuer->smx_host->name);
+ THROWF(host_error, 0, "Host failed");
+ }
+ CATCH(req->issuer->running_ctx->exception) {
+ req->issuer->doexception = 1;
+ }
+ break;
+
+ case SIMIX_CANCELED:
+ TRY {
+ XBT_DEBUG("SIMIX_execution_finished: execution canceled");
+ THROWF(cancel_error, 0, "Canceled");
+ }
+ CATCH(req->issuer->running_ctx->exception) {
+ req->issuer->doexception = 1;
+ }
+ break;
+
+ default:
+ THROW_IMPOSSIBLE;
+ }
+ req->issuer->waiting_action = NULL;
+ req->host_execution_wait.result = action->state;
+ SIMIX_request_answer(req);
+ }
+
+ /* We no longer need it */
+ SIMIX_host_execution_destroy(action);
+}
+
+void SIMIX_post_host_execute(smx_action_t action)