Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix: Initialize variable and remove from heap when action is suspended.
authordonassbr <donassbr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 16 Nov 2009 15:41:27 +0000 (15:41 +0000)
committerdonassbr <donassbr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 16 Nov 2009 15:41:27 +0000 (15:41 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6839 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/cpu_im.c
src/surf/cpu_ti.c

index f6c0be8..34d4542 100644 (file)
@@ -407,6 +407,8 @@ static void action_suspend(surf_action_t action)
     lmm_update_variable_weight(cpu_im_maxmin_system,
                                ((surf_action_lmm_t) action)->variable, 0.0);
     ((surf_action_lmm_t) action)->suspended = 1;
+    xbt_heap_remove(action_heap,
+                    ((surf_action_cpu_Cas01_im_t) action)->index_heap);
     xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
   }
   XBT_OUT;
index bdd1033..166a91c 100644 (file)
@@ -402,6 +402,7 @@ static void cpu_update_action_finish_date(cpu_ti_t cpu, double now)
   cpu->sum_priority = sum_priority;
 
   xbt_swag_foreach(action, cpu->action_set) {
+    min_finish = -1;
     /* action not running, skip it */
     if (GENERIC_ACTION(action).state_set !=
         surf_cpu_model->states.running_action_set)
@@ -617,6 +618,7 @@ static void action_suspend(surf_action_t action)
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 1;
+    xbt_heap_remove(action_heap, ((surf_action_cpu_ti_t) action)->index_heap);
     xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
   }
   XBT_OUT;