Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added the update for the Df parameter (lmm_variable_t), which means the sum of all
[simgrid.git] / src / surf / maxmin.c
index 3e9b4a4..2131d8f 100644 (file)
@@ -173,6 +173,7 @@ lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
   var->weight = weight;
   var->bound = bound;
   var->value = 0.0;
+  var->df    = 0.0;
   if(weight) xbt_swag_insert_at_head(var,&(sys->variable_set));
   else xbt_swag_insert_at_tail(var,&(sys->variable_set));
   XBT_OUT;
@@ -378,8 +379,8 @@ void lmm_print(lmm_system_t sys)
     }
     DEBUG1("%s",trace_buf);
     trace_buf[0]='\000';
-    xbt_assert2((sum<=cnst->bound), "Incorrect value (%f is not smaller than %f)",
-               sum,cnst->bound);
+    xbt_assert3((sum<=cnst->bound), "Incorrect value (%f is not smaller than %f): %g",
+               sum,cnst->bound,sum-cnst->bound);
   }
 
   /* Printing Result */
@@ -533,6 +534,13 @@ void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var,
   var->bound = bound;
 }
 
+void lmm_update_variable_latency(lmm_system_t sys, lmm_variable_t var,
+                              double delta)
+{
+  sys->modified = 1;
+  var->df += delta;
+}
+
 void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
                                double weight)
 {