Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix raw contextes for supernovae and for parallel execution
[simgrid.git] / src / simix / smx_process.c
index f22b2cc..d3353c2 100644 (file)
@@ -14,7 +14,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix,
                                 "Logging specific to SIMIX (process)");
 
-static unsigned long simix_process_count = 0;
+static unsigned long simix_process_maxpid = 0;
 
 /**
  * \brief Returns the current agent.
@@ -76,11 +76,12 @@ void SIMIX_create_maestro_process()
 
   /* Create maestro process and intilialize it */
   maestro = xbt_new0(s_smx_process_t, 1);
-  maestro->pid = simix_process_count++;
+  maestro->pid = simix_process_maxpid++;
   maestro->name = (char *) "";
   maestro->running_ctx = xbt_new(xbt_running_ctx_t, 1);
   XBT_RUNNING_CTX_INITIALIZE(maestro->running_ctx);
   maestro->context = SIMIX_context_new(NULL, 0, NULL, NULL, maestro);
+  maestro->request.issuer = maestro;
 
   simix_global->maestro_process = maestro;
   return;
@@ -149,7 +150,7 @@ smx_process_t SIMIX_process_create(const char *name,
     xbt_assert0(((code != NULL) && (host != NULL)), "Invalid parameters");
 
     /* Process data */
-    process->pid = simix_process_count++;
+    process->pid = simix_process_maxpid++;
     process->name = xbt_strdup(name);
     process->smx_host = host;
     process->data = data;
@@ -213,7 +214,7 @@ void SIMIX_process_kill(smx_process_t process, smx_process_t killer) {
        break;
 
       case SIMIX_ACTION_SYNCHRO:
-       SIMIX_synchro_stop_waiting(process, process->request);
+       SIMIX_synchro_stop_waiting(process, &process->request);
        SIMIX_synchro_destroy(process->waiting_action);
        break;
 
@@ -342,6 +343,9 @@ void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
   }
 }
 
+int SIMIX_process_get_maxpid(void) {
+  return simix_process_maxpid;
+}
 int SIMIX_process_count(void)
 {
   return xbt_swag_size(simix_global->process_list);
@@ -399,7 +403,7 @@ int SIMIX_process_is_suspended(smx_process_t process)
 
 int SIMIX_process_is_enabled(smx_process_t process)
 {
-  if (process->request && SIMIX_request_is_enabled(process->request))
+  if (process->request.call != REQ_NO_REQ && SIMIX_request_is_enabled(&process->request))
     return TRUE;
 
   return FALSE;