Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a clock per process when running in MC mode.
[simgrid.git] / src / simix / smx_process.c
index 136a1f6..eff7ab7 100644 (file)
@@ -246,6 +246,7 @@ void SIMIX_process_killall(void)
     SIMIX_process_kill(p, SIMIX_process_self());
 
   SIMIX_context_runall(simix_global->process_to_run);
+
   SIMIX_process_empty_trash();
 }
 
@@ -402,14 +403,6 @@ int SIMIX_process_is_suspended(smx_process_t process)
   return process->suspended;
 }
 
-int SIMIX_process_is_enabled(smx_process_t process)
-{
-  if (process->request.call != REQ_NO_REQ && SIMIX_request_is_enabled(&process->request))
-    return TRUE;
-
-  return FALSE;
-}
-
 xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
 {
   return process->properties;
@@ -418,8 +411,10 @@ xbt_dict_t SIMIX_process_get_properties(smx_process_t process)
 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);
@@ -510,8 +505,10 @@ void SIMIX_process_yield(void)
   /* Ok, maestro returned control to us */
   DEBUG1("Maestro returned control to me: '%s'", self->name);
 
-  if (self->context->iwannadie)
+  if (self->context->iwannadie){
+    DEBUG0("I wanna die!");
     SIMIX_context_stop(self->context);
+  }
 
   if (self->doexception) {
     DEBUG0("Wait, maestro left me an exception");