Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Adding debug messages
authorArnaud Legrand <arnaud.legrand@imag.fr>
Wed, 8 Apr 2015 13:01:07 +0000 (15:01 +0200)
committerArnaud Legrand <arnaud.legrand@imag.fr>
Wed, 8 Apr 2015 16:00:06 +0000 (18:00 +0200)
src/simix/smx_context_thread.c
src/simix/smx_global.c
src/simix/smx_process.c

index fbde818..1995a3f 100644 (file)
@@ -188,6 +188,7 @@ static void smx_ctx_thread_runall_serial(void)
   unsigned int cursor;
 
   xbt_dynar_foreach(simix_global->process_to_run, cursor, process) {
+    XBT_DEBUG("Handling %p",process);
     xbt_os_sem_release(((smx_ctx_thread_t) process->context)->begin);
     xbt_os_sem_acquire(((smx_ctx_thread_t) process->context)->end);
   }
index cb99d35..317ea15 100644 (file)
@@ -407,9 +407,11 @@ void SIMIX_run(void)
     }
 
     time = SIMIX_timer_next();
-    if (time != -1.0 || xbt_swag_size(simix_global->process_list) != 0)
+    if (time != -1.0 || xbt_swag_size(simix_global->process_list) != 0) {
+      XBT_DEBUG("Calling surf_solve");
       time = surf_solve(time);
-
+      XBT_DEBUG("Moving time ahead : %g", time);
+    }
     /* Notify all the hosts that have failed */
     /* FIXME: iterate through the list of failed host and mark each of them */
     /* as failed. On each host, signal all the running processes with host_fail */
@@ -426,14 +428,19 @@ void SIMIX_run(void)
 
     /* Wake up all processes waiting for a Surf action to finish */
     xbt_dynar_foreach(model_list, iter, model) {
-      while ((action = surf_model_extract_failed_action_set(model)))
+      XBT_DEBUG("Handling process whose action failed");
+      while ((action = surf_model_extract_failed_action_set(model))) {
+        XBT_DEBUG("   Handling Action %p",action);
         SIMIX_simcall_exit((smx_synchro_t) surf_action_get_data(action));
-
-      while ((action = surf_model_extract_done_action_set(model)))
+      }
+      XBT_DEBUG("Handling process whose action terminated normally");
+      while ((action = surf_model_extract_done_action_set(model))) {
+        XBT_DEBUG("   Handling Action %p",action);
         if (surf_action_get_data(action) == NULL)
           XBT_DEBUG("probably vcpu's action %p, skip", action);
         else
           SIMIX_simcall_exit((smx_synchro_t) surf_action_get_data(action));
+      }
     }
 
     /* Autorestart all process */
index b0c51cd..ce66e94 100644 (file)
@@ -86,6 +86,7 @@ void SIMIX_process_cleanup(smx_process_t process)
     }
   }
 
+  XBT_DEBUG("%p should not be run anymore",process);
   xbt_swag_remove(process, simix_global->process_list);
   xbt_swag_remove(process, SIMIX_host_priv(process->smx_host)->process_list);
   xbt_swag_insert(process, simix_global->process_to_destroy);
@@ -103,6 +104,8 @@ void SIMIX_process_empty_trash(void)
   smx_process_t process = NULL;
 
   while ((process = xbt_swag_extract(simix_global->process_to_destroy))) {
+    XBT_DEBUG("Getting rid of %p",process);
+
     SIMIX_context_free(process->context);
 
     /* Free the exception allocated at creation time */
@@ -367,6 +370,7 @@ void SIMIX_process_kill(smx_process_t process, smx_process_t issuer) {
     }
   }
   if(!xbt_dynar_member(simix_global->process_to_run, &(process)) && process != issuer) {
+    XBT_DEBUG("Inserting %s in the to_run list", process->name);
     xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process);
   }