Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] use the lmm system to get ids to trace resource utilization
authorschnorr <Lucas.Schnorr@imag.fr>
Tue, 6 Mar 2012 23:42:41 +0000 (00:42 +0100)
committerschnorr <Lucas.Schnorr@imag.fr>
Tue, 6 Mar 2012 23:42:41 +0000 (00:42 +0100)
details:
- we have a performance gain since we don't call routing_get_route_and_latency
for every update for every action in surf level

src/surf/network.c

index c925f3b..de14baa 100644 (file)
@@ -557,12 +557,13 @@ static void net_update_actions_state_full(double now, double delta)
     }
 #ifdef HAVE_TRACING
     if (TRACE_is_enabled()) {
     }
 #ifdef HAVE_TRACING
     if (TRACE_is_enabled()) {
-      xbt_dynar_t route = NULL;
-      routing_get_route_and_latency(action->src_name, action->dst_name,
-                                    &route, NULL);
-      link_CM02_t link;
+      int n = lmm_get_number_of_cnst_from_var(network_maxmin_system, GENERIC_LMM_ACTION(action).variable);
       unsigned int i;
       unsigned int i;
-      xbt_dynar_foreach(route, i, link) {
+      for (i = 0; i < n; i++){
+        lmm_constraint_t constraint = lmm_get_cnst_from_var(network_maxmin_system,
+                                                            GENERIC_LMM_ACTION(action).variable,
+                                                            i);
+        link_CM02_t link = lmm_constraint_id(constraint);
         TRACE_surf_link_set_utilization(link->lmm_resource.generic_resource.name,
                                         ((surf_action_t)action)->category,
                                         lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable),
         TRACE_surf_link_set_utilization(link->lmm_resource.generic_resource.name,
                                         ((surf_action_t)action)->category,
                                         lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable),