Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a SIMIX_process_count() that SMPI needs
[simgrid.git] / src / simix / smx_process.c
index 76643e8..9326ac2 100644 (file)
@@ -385,7 +385,7 @@ void SIMIX_process_resume(smx_process_t process)
   simdata = process->simdata;
   if (simdata->mutex) {
     DEBUG0("Resume process blocked on a mutex");
-    simdata->suspended = 0;     /* He'll wake up by itself */
+    simdata->suspended = 0;     /* It'll wake up by itself when mutex releases */
     return;
   } else if (simdata->cond) {
     /* temporaries variables */
@@ -438,3 +438,13 @@ int SIMIX_process_is_suspended(smx_process_t process)
 
   return (process->simdata->suspended);
 }
+
+/**
+ * \brief Returns the amount of SIMIX processes in the system
+ *
+ * Maestro internal process is not counted, only user code processes are
+ */
+int SIMIX_process_count() {
+       return xbt_swag_size(simix_global->process_list);
+}
+