Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SURF: Embeed every fields of common_public directly into s_surf_model_t
[simgrid.git] / src / simdag / sd_global.c
index 431dae5..932c915 100644 (file)
@@ -162,7 +162,8 @@ void SD_create_environment(const char *platform_file)
   parse_platform_file(platform_file);
 
   /* now let's create the SD wrappers for workstations and links */
-  xbt_dict_foreach(workstation_set, cursor, name, surf_workstation) {
+  xbt_dict_foreach(surf_model_resource_set(surf_workstation_model), cursor,
+                   name, surf_workstation) {
     __SD_workstation_create(surf_workstation, NULL);
   }
 
@@ -208,8 +209,8 @@ SD_task_t *SD_simulate(double how_long)
   }
 
   if (how_long > 0) {
-    surf_timer_model->extension_public->set(surf_get_clock() + how_long,
-                                            NULL, NULL);
+    surf_timer_model->extension.timer.set(surf_get_clock() + how_long,
+                                          NULL, NULL);
   }
   sd_global->watch_point_reached = 0;
 
@@ -240,9 +241,7 @@ SD_task_t *SD_simulate(double how_long)
 
     /* let's see which tasks are done */
     xbt_dynar_foreach(model_list, iter, model) {
-      while ((action =
-              xbt_swag_extract(model->common_public->states.
-                               done_action_set))) {
+      while ((action = xbt_swag_extract(model->states.done_action_set))) {
         task = action->data;
         INFO1("Task '%s' done", SD_task_get_name(task));
         DEBUG0("Calling __SD_task_just_done");
@@ -271,13 +270,11 @@ SD_task_t *SD_simulate(double how_long)
       }
 
       /* let's see which tasks have just failed */
-      while ((action =
-              xbt_swag_extract(model->common_public->states.
-                               failed_action_set))) {
+      while ((action = xbt_swag_extract(model->states.failed_action_set))) {
         task = action->data;
         INFO1("Task '%s' failed", SD_task_get_name(task));
         __SD_task_set_state(task, SD_FAILED);
-        surf_workstation_model->common_public->action_free(action);
+        surf_workstation_model->action_free(action);
         task->surf_action = NULL;
 
         if (!xbt_dynar_member(changed_tasks, &task))
@@ -285,7 +282,7 @@ SD_task_t *SD_simulate(double how_long)
       }
     }
 
-    while (surf_timer_model->extension_public->get(&fun, (void *) &arg)) {
+    while (surf_timer_model->extension.timer.get(&fun, (void *) &arg)) {
     }
   }