+void SIMIX_process_change_host(smx_process_t process,
+ smx_host_t dest)
+{
+ xbt_assert((process != NULL), "Invalid parameters");
+ xbt_swag_remove(process, process->smx_host->process_list);
+ process->smx_host = dest;
+ xbt_swag_insert(process, dest->process_list);
+}
+
+void SIMIX_pre_process_change_host(smx_process_t process, smx_host_t dest)
+{
+ process->new_host = dest;
+}
+
+void SIMIX_pre_process_suspend(smx_req_t req)
+{
+ smx_process_t process = req->process_suspend.process;
+ SIMIX_process_suspend(process, req->issuer);
+
+ if (process != req->issuer) {
+ SIMIX_request_answer(req);
+ }
+ /* If we are suspending ourselves, then just do not replay the request. */
+}
+
+void SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
+{
+ process->suspended = 1;
+
+ /* If we are suspending another process, and it is waiting on an action,
+ suspend it's action. */
+ if (process != issuer) {
+
+ if (process->waiting_action) {
+
+ switch (process->waiting_action->type) {
+
+ case SIMIX_ACTION_EXECUTE:
+ case SIMIX_ACTION_PARALLEL_EXECUTE:
+ SIMIX_host_execution_suspend(process->waiting_action);
+ break;
+
+ case SIMIX_ACTION_COMMUNICATE:
+ SIMIX_comm_suspend(process->waiting_action);
+ break;
+
+ case SIMIX_ACTION_SLEEP:
+ SIMIX_process_sleep_suspend(process->waiting_action);
+ break;
+
+ default:
+ THROW_IMPOSSIBLE;
+ }
+ }
+ }
+}
+
+void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
+{
+ xbt_assert((process != NULL), "Invalid parameters");
+
+ process->suspended = 0;
+
+ /* If we are resuming another process, resume the action it was waiting for
+ if any. Otherwise add it to the list of process to run in the next round. */
+ if (process != issuer) {
+
+ if (process->waiting_action) {
+
+ switch (process->waiting_action->type) {
+
+ case SIMIX_ACTION_EXECUTE:
+ case SIMIX_ACTION_PARALLEL_EXECUTE:
+ SIMIX_host_execution_resume(process->waiting_action);
+ break;
+
+ case SIMIX_ACTION_COMMUNICATE:
+ SIMIX_comm_resume(process->waiting_action);
+ break;
+
+ case SIMIX_ACTION_SLEEP:
+ SIMIX_process_sleep_resume(process->waiting_action);
+ break;
+
+ default:
+ THROW_IMPOSSIBLE;
+ }
+ }
+ else {
+ xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process);
+ }
+ }
+}
+
+int SIMIX_process_get_maxpid(void) {
+ return simix_process_maxpid;
+}
+
+int SIMIX_process_count(void)