+/* needs to be public and without request because it is called
+ by exceptions and logging events */
+const char* SIMIX_process_self_get_name(void) {
+
+ smx_process_t process = SIMIX_process_self();
+ if (process == NULL || process == simix_global->maestro_process)
+ return "";
+
+ return SIMIX_process_get_name(process);
+}
+
+const char* SIMIX_process_get_name(smx_process_t process)
+{
+ return process->name;
+}
+
+int SIMIX_process_is_suspended(smx_process_t process)
+{
+ return process->suspended;
+}
+
+xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
+{
+ return process->properties;
+}
+
+void SIMIX_pre_process_sleep(smx_req_t req)
+{
+ if (MC_IS_ENABLED) {
+ MC_process_clock_add(req->issuer, req->process_sleep.duration);
+ req->process_sleep.result = SIMIX_DONE;
+ SIMIX_request_answer(req);
+ return;
+ }
+ smx_action_t action = SIMIX_process_sleep(req->issuer, req->process_sleep.duration);
+ xbt_fifo_push(action->request_list, req);
+ req->issuer->waiting_action = action;
+}
+
+smx_action_t SIMIX_process_sleep(smx_process_t process, double duration)
+{
+ smx_action_t action;
+ smx_host_t host = process->smx_host;
+
+ /* check if the host is active */
+ if (surf_workstation_model->extension.
+ workstation.get_state(host->host) != SURF_RESOURCE_ON) {
+ THROW1(host_error, 0, "Host %s failed, you cannot call this function",
+ host->name);
+ }
+
+ action = xbt_new0(s_smx_action_t, 1);
+ action->type = SIMIX_ACTION_SLEEP;
+ action->request_list = xbt_fifo_new();
+ action->name = xbt_strdup("sleep");
+#ifdef HAVE_TRACING
+ action->category = NULL;
+#endif
+
+ action->sleep.host = host;
+ action->sleep.surf_sleep =
+ surf_workstation_model->extension.workstation.sleep(host->host, duration);
+
+ surf_workstation_model->action_data_set(action->sleep.surf_sleep, action);
+ DEBUG1("Create sleep action %p", action);
+
+ return action;
+}
+
+void SIMIX_post_process_sleep(smx_action_t action)