Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix initialization order.
[simgrid.git] / src / simix / smx_global.c
index 58397da..e1f793e 100644 (file)
@@ -324,19 +324,20 @@ void SIMIX_run(void)
          ((void (*)(void*))timer->func)(timer->args);
        xbt_free(timer);
     }
+
     /* Wake up all processes waiting for a Surf action to finish */
     xbt_dynar_foreach(model_list, iter, model) {
-      set = model->states.failed_action_set;
+      set = surf_model_failed_action_set(model);
       while ((action = xbt_swag_extract(set)))
-        SIMIX_simcall_post((smx_action_t) action->data);
-      set = model->states.done_action_set;
 
-      while ((action = xbt_swag_extract(set))) {
-        if (action->data == NULL)
+      SIMIX_simcall_post((smx_action_t) surf_action_get_data(action));
+      set = surf_model_done_action_set(model);
+
+      while ((action = xbt_swag_extract(set))) 
+        if (surf_action_get_data(action) == NULL)
           XBT_DEBUG("probably vcpu's action %p, skip", action);
         else
-          SIMIX_simcall_post((smx_action_t) action->data);
-      }
+          SIMIX_simcall_post((smx_action_t) surf_action_get_data(action));
     }
 
     /* Autorestart all process */