Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fixed typo in documentation of surf_routing.hpp
[simgrid.git] / src / surf / network_cm02.cpp
index 637a243..37fc271 100644 (file)
@@ -138,7 +138,7 @@ void surf_network_model_init_Reno2(void)
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 10.4);
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor",
                             0.92);
-  xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S_parameter",
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S",
                             8775);
 }
 
@@ -233,7 +233,6 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
          && (double_equals(xbt_heap_maxkey(p_actionHeap), now, sg_surf_precision))) {
     action = (NetworkCm02ActionPtr) xbt_heap_pop(p_actionHeap);
     XBT_DEBUG("Something happened to action %p", action);
-#ifdef HAVE_TRACING
     if (TRACE_is_enabled()) {
       int n = lmm_get_number_of_cnst_from_var(p_maxminSystem, action->getVariable());
       int i;
@@ -252,7 +251,6 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
                                         now - action->getLastUpdate());
       }
     }
-#endif
 
     // if I am wearing a latency hat
     if (action->getHat() == LATENCY) {
@@ -303,7 +301,6 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
           lmm_update_variable_weight(p_maxminSystem, action->getVariable(),
               action->m_weight);
       }
-  #ifdef HAVE_TRACING
       if (TRACE_is_enabled()) {
         int n = lmm_get_number_of_cnst_from_var(p_maxminSystem, action->getVariable());
         int i;
@@ -322,7 +319,6 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
                                         now - action->getLastUpdate());
         }
       }
-  #endif
       if (!lmm_get_number_of_cnst_from_var
           (p_maxminSystem, action->getVariable())) {
         /* There is actually no link used, hence an infinite bandwidth.
@@ -614,6 +610,9 @@ void NetworkCm02Link::updateBandwidth(double value, double date){
                  (p_power.peak * p_power.scale);
   lmm_variable_t var = NULL;
   lmm_element_t elem = NULL;
+  lmm_element_t nextelem = NULL;
+  int numelem = 0;
+
   NetworkCm02ActionPtr action = NULL;
 
   p_power.peak = value;
@@ -621,11 +620,9 @@ void NetworkCm02Link::updateBandwidth(double value, double date){
                               getConstraint(),
                               sg_bandwidth_factor *
                               (p_power.peak * p_power.scale));
-#ifdef HAVE_TRACING
   TRACE_surf_link_set_bandwidth(date, getName(), sg_bandwidth_factor * p_power.peak * p_power.scale);
-#endif
   if (sg_weight_S_parameter > 0) {
-    while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
+    while ((var = lmm_get_var_from_cnst_safe(getModel()->getMaxminSystem(), getConstraint(), &elem, &nextelem, &numelem))) {
       action = (NetworkCm02ActionPtr) lmm_variable_id(var);
       action->m_weight += delta;
       if (!action->isSuspended())
@@ -638,10 +635,12 @@ void NetworkCm02Link::updateLatency(double value, double date){
   double delta = value - m_latCurrent;
   lmm_variable_t var = NULL;
   lmm_element_t elem = NULL;
+  lmm_element_t nextelem = NULL;
+  int numelem = 0;
   NetworkCm02ActionPtr action = NULL;
 
   m_latCurrent = value;
-  while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
+  while ((var = lmm_get_var_from_cnst_safe(getModel()->getMaxminSystem(), getConstraint(), &elem, &nextelem, &numelem))) {
     action = (NetworkCm02ActionPtr) lmm_variable_id(var);
     action->m_latCurrent += delta;
     action->m_weight += delta;