Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix tracing broken by recent modifications.
[simgrid.git] / src / surf / network.c
index d64df51..67044e4 100644 (file)
@@ -509,16 +509,12 @@ static double net_share_resources_lazy(double now)
               GENERIC_ACTION(action).start, now + value,
               GENERIC_ACTION(action).max_duration);
 
-    if (action->index_heap >= 0) {
-      heap_remove(action);
-    }
-
     if (min != -1) {
-      heap_insert((surf_action_network_CM02_t) action, min,
-                  max_dur_flag ? MAX_DURATION : NORMAL);
+      heap_remove(action);
+      heap_insert(action, min, max_dur_flag ? MAX_DURATION : NORMAL);
       XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min,
                 now);
-    }
+    } else DIE_IMPOSSIBLE;
   }
 
   //hereafter must have already the min value for this resource model
@@ -567,12 +563,11 @@ static void net_update_actions_state_full(double now, double delta)
       unsigned int i;
       xbt_dynar_foreach(route, i, link) {
         TRACE_surf_link_set_utilization(link->lmm_resource.
-                                        generic_resource.name,
-                                        (((surf_action_t)action)->data,
-                                        (surf_action_t) action,
-                                        lmm_variable_getvalue(action->
-                                                              variable),
-                                        now - delta, delta);
+            generic_resource.name,
+            GENERIC_ACTION(action).data,
+            (surf_action_t) action,
+            lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable),
+            now - delta, delta);
       }
     }
 #endif