Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
what is that pimple, for god's sake??
[simgrid.git] / src / surf / network.c
index fda3acd..e3bd03a 100644 (file)
@@ -200,7 +200,9 @@ static void net_parse_link_init(sg_platf_link_cbarg_t link)
   XBT_DEBUG("link_CM02");
 
   if (link->policy == SURF_LINK_FULLDUPLEX) {
-    net_create_resource(bprintf("%s_UP", link->id),
+    char *link_id;
+    link_id = bprintf("%s_UP", link->id);
+    net_create_resource(link_id,
                         link->bandwidth,
                         link->bandwidth_trace,
                         link->latency,
@@ -209,7 +211,9 @@ static void net_parse_link_init(sg_platf_link_cbarg_t link)
                         link->state_trace,
                         link->policy,
                         link->properties);
-    net_create_resource(bprintf("%s_DOWN", link->id),
+    xbt_free(link_id);
+    link_id = bprintf("%s_DOWN", link->id);
+    net_create_resource(link_id,
                         link->bandwidth,
                         link->bandwidth_trace,
                         link->latency,
@@ -219,8 +223,9 @@ static void net_parse_link_init(sg_platf_link_cbarg_t link)
                         link->policy,
                         NULL); /* FIXME: We need to deep copy the properties or
                                 * we won't be able to free it */
+    xbt_free(link_id);
   } else {
-    net_create_resource(xbt_strdup(link->id),
+    net_create_resource(link->id,
                         link->bandwidth,
                         link->bandwidth_trace,
                         link->latency,
@@ -313,8 +318,7 @@ static int net_action_unref(surf_action_t action)
 #ifdef HAVE_TRACING
     xbt_free(((surf_action_network_CM02_t) action)->src_name);
     xbt_free(((surf_action_network_CM02_t) action)->dst_name);
-    if (action->category)
-      xbt_free(action->category);
+    xbt_free(action->category);
 #endif
     surf_action_free(&action);
     return 1;
@@ -831,12 +835,11 @@ static void surf_network_model_init_internal(void)
     network_maxmin_system = lmm_system_new();
 
   routing_model_create(sizeof(link_CM02_t),
-                       net_create_resource(xbt_strdup("__loopback__"),
+                       net_create_resource("__loopback__",
                                            498000000, NULL,
                                            0.000015, NULL,
                                            SURF_RESOURCE_ON, NULL,
-                                           SURF_LINK_FATPIPE, NULL),
-                       net_get_link_latency);
+                                           SURF_LINK_FATPIPE, NULL));
 }
 
 
@@ -860,8 +863,6 @@ void surf_network_model_init_SMPI(void)
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/sender_gap", 10e-6);
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
 
-  update_model_description(surf_network_model_description,
-                           "SMPI", surf_network_model);
 }
 
 /************************************************************************/
@@ -882,8 +883,6 @@ void surf_network_model_init_LegrandVelho(void)
                             0.92);
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
 
-  update_model_description(surf_network_model_description,
-                           "LV08_fullupdate", surf_network_model);
 }
 
 /***************************************************************************/
@@ -906,9 +905,6 @@ void surf_network_model_init_CM02(void)
   net_define_callbacks();
   xbt_dynar_push(model_list, &surf_network_model);
   network_solve = lmm_solve;
-
-  update_model_description(surf_network_model_description,
-                           "CM02", surf_network_model);
 }
 
 void surf_network_model_init_Reno(void)
@@ -927,9 +923,6 @@ void surf_network_model_init_Reno(void)
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
                             0.92);
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
-
-  update_model_description(surf_network_model_description,
-                           "Reno", surf_network_model);
 }
 
 
@@ -950,9 +943,6 @@ void surf_network_model_init_Reno2(void)
                             0.92);
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S_parameter",
                             8775);
-
-  update_model_description(surf_network_model_description,
-                           "Reno2", surf_network_model);
 }
 
 void surf_network_model_init_Vegas(void)
@@ -971,7 +961,4 @@ void surf_network_model_init_Vegas(void)
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
                             0.92);
   xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
-
-  update_model_description(surf_network_model_description,
-                           "Vegas", surf_network_model);
 }