Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics + warning
authorArnaud Legrand <arnaud.legrand@imag.fr>
Mon, 5 Mar 2012 10:09:57 +0000 (11:09 +0100)
committerArnaud Legrand <arnaud.legrand@imag.fr>
Mon, 5 Mar 2012 11:05:30 +0000 (12:05 +0100)
src/surf/cpu_cas01.c
src/surf/network.c

index c94bf46..3d00787 100644 (file)
@@ -314,15 +314,12 @@ static double cpu_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_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
index e2d92fd..0e1bcab 100644 (file)
@@ -509,15 +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_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