Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'smpi'
authorChristophe Thiéry <christopho128@gmail.com>
Fri, 6 Jan 2012 09:26:02 +0000 (10:26 +0100)
committerChristophe Thiéry <christopho128@gmail.com>
Fri, 6 Jan 2012 09:26:02 +0000 (10:26 +0100)
1  2 
src/surf/network.c

diff --combined src/surf/network.c
@@@ -45,7 -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);
@@@ -98,41 -98,39 +98,39 @@@ static double constant_bandwidth_constr
    return rate;
  }
  
  /**********************/
  /*   SMPI callbacks   */
  /**********************/
- static double smpi_latency_factor(double size)
+ static double smpi_bandwidth_factor(double size)
  {
-   /* 1 B <= size <= 1 KiB */
-   if (size <= 1024.0) {
-     return 1.0056;
-   }
-   /* 2 KiB <= size <= 32 KiB */
-   if (size <= 32768.0) {
-     return 1.8805;
-   }
  
-   /* 64 KiB <= size <= 4 MiB */
-   return 22.7111;
+     if (size >= 65472) return 0.940694;
+     if (size >= 15424) return 0.697866;
+     if (size >= 9376) return 0.58729;
+     if (size >= 5776) return 1.08739;
+     if (size >= 3484) return 0.77493;
+     if (size >= 1426) return 0.608902;
+     if (size >= 732) return 0.341987;
+     if (size >= 257) return 0.338112;
+     if (size >= 0) return 0.812084;
+     return 1.0;
  }
  
- static double smpi_bandwidth_factor(double size)
+ static double smpi_latency_factor(double size)
  {
-   /* 1 B <= size <= 1 KiB */
-   if (size <= 1024.0) {
-     return 0.2758;
-   }
-   /* 2 KiB <= size <= 32 KiB */
-   if (size <= 32768.0) {
-     return 0.5477;
-   }
  
-   /* 64 KiB <= size <= 4 MiB */
-   return 0.9359;
+     if (size >= 65472) return 11.6436;
+     if (size >= 15424) return 3.48845;
+     if (size >= 9376) return 2.59299;
+     if (size >= 5776) return 2.18796;
+     if (size >= 3484) return 1.88101;
+     if (size >= 1426) return 1.61075;
+     if (size >= 732) return 1.9503;
+     if (size >= 257) return 1.95341;
+     if (size >= 0) return 2.01467;
+     return 1.0;
  }
+ /**--------- <copy/paste C code snippet in surf/network.c> -----------*/
  
  static double smpi_bandwidth_constraint(double rate, double bound,
                                          double size)
@@@ -325,6 -323,7 +323,7 @@@ static int net_action_unref(surf_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);
@@@ -579,7 -578,7 +578,7 @@@ static void net_update_actions_state_la
      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);
@@@ -995,9 -994,6 +994,9 @@@ static void surf_network_model_init_int
  #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) {
                  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__",
  }
  
  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 {