Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'smpi'
[simgrid.git] / src / surf / network.c
index e81a17d..66c1d28 100644 (file)
@@ -45,7 +45,7 @@ int sg_network_crosstraffic = 0;
 xbt_dict_t gap_lookup = NULL;
 
 e_UM_t network_update_mechanism = UM_UNDEFINED;
-static int selective_update = 0;
+static int net_selective_update = 0;
 
 static int net_action_is_suspended(surf_action_t action);
 static void update_action_remaining(double now);
@@ -101,13 +101,6 @@ static double constant_bandwidth_constraint(double rate, double bound,
 /**********************/
 /*   SMPI callbacks   */
 /**********************/
-static double smpi_latency_factor(double size)
-{
-  /* 1 B <= size <= 1 KiB */
-  if (size <= 1024.0) {
-    return 1.0056;
-  }
-
 static double smpi_bandwidth_factor(double size)
 {
 
@@ -330,6 +323,7 @@ static int net_action_unref(surf_action_t action)
 
 static void net_action_cancel(surf_action_t action)
 {
+       XBT_DEBUG("cancel action %p",action);
   surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
   if(network_update_mechanism == UM_LAZY){// remove action from the heap
     xbt_swag_remove(action, net_modified_set);
@@ -584,7 +578,7 @@ static void net_update_actions_state_lazy(double now, double delta)
     XBT_DEBUG("Action %p: finish", action);
     GENERIC_ACTION(action).finish = surf_get_clock();
 
-    // if I am wearing a latency heat
+    // if I am wearing a latency hat
     if( action->hat ==  LATENCY){
         lmm_update_variable_weight(network_maxmin_system, action->variable,
                                            action->weight);
@@ -1000,6 +994,9 @@ static void surf_network_model_init_internal(void)
 #ifdef HAVE_LATENCY_BOUND_TRACKING
   surf_network_model->get_latency_limited = net_get_link_latency_limited;
 #endif
+#ifdef HAVE_TRACING
+  surf_network_model->set_category = net_action_set_category;
+#endif
 
   surf_network_model->model_private->resource_used = net_resource_used;
   if(network_update_mechanism == UM_LAZY) {
@@ -1031,7 +1028,7 @@ static void surf_network_model_init_internal(void)
                  net_create_resource;
 
  if (!network_maxmin_system)
-    network_maxmin_system = lmm_system_new(selective_update);
+    network_maxmin_system = lmm_system_new(net_selective_update);
 
  routing_model_create(sizeof(link_CM02_t),
       net_create_resource("__loopback__",
@@ -1048,15 +1045,19 @@ static void surf_network_model_init_internal(void)
 }
 
 static void set_update_mechanism(void) {
+#ifdef HAVE_TRACING
+  TRACE_set_network_update_mechanism ();
+#endif
+
   char *optim = xbt_cfg_get_string(_surf_cfg_set, "network/optim");
   int select = xbt_cfg_get_int(_surf_cfg_set, "network/maxmin_selective_update");
 
   if(!strcmp(optim,"Full")) {
     network_update_mechanism = UM_FULL;
-    selective_update = select;
+    net_selective_update = select;
   } else if (!strcmp(optim,"Lazy")) {
     network_update_mechanism = UM_LAZY;
-    selective_update = 1;
+    net_selective_update = 1;
     xbt_assert((select==1) || (xbt_cfg_is_default_value(_surf_cfg_set,"network/maxmin_selective_update")),
         "Disabling selective update while using the lazy update mechanism is dumb!");
   } else {