Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The variable-constraint graph is already traversed, and there is no
authorNavarrop <Pierre.Navarro@imag.fr>
Fri, 6 Jan 2012 15:01:33 +0000 (16:01 +0100)
committerNavarrop <Pierre.Navarro@imag.fr>
Fri, 6 Jan 2012 15:30:40 +0000 (16:30 +0100)
commit07382145819134d7bbbc2eec66a0f5c285ac84f0
tree8c3cc9de3ce1408fc7b806d899d691e524837875
parent9fdf4cc5eefe3534a8689d5093801ddaded6cb8c
The variable-constraint graph is already traversed, and there is no
need to call lmm_update_modified_set for each constraint of a variable.

Note: the fix in lmm_update_variable_weight may change the order of the
elements in modified_constraint_set, and some timings may slightly vary.
If it is really important, the following patch fixes that:

--- a/src/surf/maxmin.c
+++ b/src/surf/maxmin.c
@@ -716,13 +716,13 @@ void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
       xbt_swag_insert_at_head(elem, &(elem->constraint->element_set));
     else
       xbt_swag_insert_at_tail(elem, &(elem->constraint->element_set));
+
+    if (i == 0)
+      lmm_update_modified_set(sys, elem->constraint);
   }
   if (!weight)
     var->value = 0.0;

-  if (var->cnsts_number)
-    lmm_update_modified_set(sys, var->cnsts[0].constraint);
-
   XBT_OUT();
 }
src/surf/maxmin.c