Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This commit partially reverts commit 4e0c8570051df3f7114e0097bf888a99946b6138.
[simgrid.git] / src / simix / smx_process.c
index d2228e9..7ea92f3 100644 (file)
@@ -56,7 +56,7 @@ void SIMIX_process_cleanup(smx_process_t process)
 
     if (action->comm.src_proc == process) {
       XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p",
-          action, action->comm.detached, action->state, action->comm.src_proc, action->comm.dst_proc);
+          action, action->comm.detached, (int)action->state, action->comm.src_proc, action->comm.dst_proc);
       action->comm.src_proc = NULL;
 
       if (action->comm.detached) {
@@ -76,7 +76,7 @@ void SIMIX_process_cleanup(smx_process_t process)
     }
     else if (action->comm.dst_proc == process){
       XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p",
-          action, action->state, action->comm.src_proc, action->comm.dst_proc);
+          action, (int)action->state, action->comm.src_proc, action->comm.dst_proc);
       action->comm.dst_proc = NULL;
 
       if (action->comm.detached && action->comm.refcount == 1
@@ -370,7 +370,7 @@ void SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
 
         default:
           xbt_die("Internal error in SIMIX_process_suspend: unexpected action type %d",
-              process->waiting_action->type);
+              (int)process->waiting_action->type);
       }
     }
   }
@@ -380,11 +380,6 @@ void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
 {
   xbt_assert((process != NULL), "Invalid parameters");
 
-  if (!process->suspended) {
-    XBT_DEBUG("Process '%s' is not suspended", process->name);
-    return;
-  }
-
   process->suspended = 0;
 
   /* If we are resuming another process, resume the action it was waiting for
@@ -410,7 +405,7 @@ void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
 
         default:
           xbt_die("Internal error in SIMIX_process_resume: unexpected action type %d",
-              process->waiting_action->type);
+              (int)process->waiting_action->type);
       }
     }
     else {
@@ -662,3 +657,13 @@ smx_process_t SIMIX_process_from_PID(int PID)
        }
        return NULL;
 }
+
+/** @brief returns a dynar containg all currently existing processes */
+xbt_dynar_t SIMIX_processes_as_dynar(void) {
+  smx_process_t proc;
+  xbt_dynar_t res = xbt_dynar_new(sizeof(smx_process_t),NULL);
+  xbt_swag_foreach(proc, simix_global->process_list) {
+    xbt_dynar_push(res,&proc);
+  }
+  return res;
+}