Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added Reno2, a model that takes 2W/RTT as the utility parameter in the Low proposed...
authorvelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 9 Jun 2008 11:26:22 +0000 (11:26 +0000)
committervelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 9 Jun 2008 11:26:22 +0000 (11:26 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5575 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/include/surf/maxmin.h
src/include/surf/surf.h
src/surf/lagrange.c
src/surf/network.c
src/surf/surf.c

index 7766147..2677743 100644 (file)
@@ -107,6 +107,10 @@ XBT_PUBLIC(double func_reno_f)  (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_reno_fp) (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_reno_fpi)(lmm_variable_t var, double x);
 
 XBT_PUBLIC(double func_reno_fp) (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_reno_fpi)(lmm_variable_t var, double x);
 
+XBT_PUBLIC(double func_reno2_f)  (lmm_variable_t var, double x);
+XBT_PUBLIC(double func_reno2_fp) (lmm_variable_t var, double x);
+XBT_PUBLIC(double func_reno2_fpi)(lmm_variable_t var, double x);
+
 XBT_PUBLIC(double func_vegas_f)  (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_fp) (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_fpi)(lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_f)  (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_fp) (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_fpi)(lmm_variable_t var, double x);
index 469348a..f77959c 100644 (file)
@@ -344,6 +344,21 @@ XBT_PUBLIC(void) surf_network_model_init_GTNETS(const char *filename);
  */
 XBT_PUBLIC(void) surf_network_model_init_Reno(const char *filename);
 
  */
 XBT_PUBLIC(void) surf_network_model_init_Reno(const char *filename);
 
+/** \brief Initializes the platform with the network model Reno2
+ *  \ingroup SURF_models
+ *  \param filename XML platform file name
+ *
+ *  The problem is related to max( sum( arctan(C * Df * xi) ) ).
+ *
+ *  Reference:
+ *  [LOW01] S. H. Low. A duality model of TCP and queue management algorithms.
+ *  IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
+ *
+ *  Call this function only if you plan using surf_workstation_model_init_compound.
+ *
+ */
+XBT_PUBLIC(void) surf_network_model_init_Reno2(const char *filename);
+
 /** \brief Initializes the platform with the network model Vegas
  *  \ingroup SURF_models
  *  \param filename XML platform file name
 /** \brief Initializes the platform with the network model Vegas
  *  \ingroup SURF_models
  *  \param filename XML platform file name
index a870166..479a91a 100644 (file)
@@ -608,3 +608,37 @@ double func_reno_fpi(lmm_variable_t var, double x)
 /*   xbt_assert0(res_fpi>0.0,"Don't call me with stupid values!"); */
   return sqrt(res_fpi);
 }
 /*   xbt_assert0(res_fpi>0.0,"Don't call me with stupid values!"); */
   return sqrt(res_fpi);
 }
+
+
+/* Implementing new Reno-2
+ * For Reno-2:  $f(x)   = U_f(x_f) = \frac{{2}{D_f}}*ln(2+x*D_f)$
+ * Therefore:   $fp(x)  = 2/(Df*x + 2)
+ * Therefore:   $fpi(x) = (2*Df)/x - 4
+ */
+#define RENO2_SCALING 1.0
+double func_reno2_f(lmm_variable_t var, double x)
+{
+  xbt_assert0(var->df > 0.0, "Don't call me with stupid values!");
+  return RENO2_SCALING * (1.0/var->df) * log((x*var->df)/(2.0*x*var->df+3.0));
+}
+
+double func_reno2_fp(lmm_variable_t var, double x)
+{
+  return RENO2_SCALING * 3.0/(var->df*x*(2.0*var->df*x+3.0));
+}
+
+double func_reno2_fpi(lmm_variable_t var, double x)
+{
+  double res_fpi;
+  double tmp;
+
+  xbt_assert0(x > 0.0, "Don't call me with stupid values!");
+  tmp= x*var->df*var->df;
+  res_fpi= tmp*(9.0*x+24.0);
+  
+  if (res_fpi <= 0.0)
+    return 0.0;
+
+  res_fpi = RENO2_SCALING * (-3.0*tmp + sqrt(res_fpi))/(4.0*tmp);
+  return res_fpi;
+}
index 50de0dd..3535d2b 100644 (file)
@@ -385,6 +385,8 @@ static double share_resources(double now)
                                       network_maxmin_system,
                                       network_solve);
 
                                       network_maxmin_system,
                                       network_solve);
 
+#define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + xbt_swag_offset(s_action, variable)  )))
+  
   xbt_swag_foreach(action, running_actions) {
     if (action->latency > 0) {
       if (min < 0)
   xbt_swag_foreach(action, running_actions) {
     if (action->latency > 0) {
       if (min < 0)
@@ -823,6 +825,25 @@ void surf_network_model_init_Reno(const char *filename)
                              (surf_model_t) surf_network_model);
 }
 
                              (surf_model_t) surf_network_model);
 }
 
+
+void surf_network_model_init_Reno2(const char *filename)
+{
+  if (surf_network_model)
+    return;
+  surf_network_model_init_internal();
+  parse_file(filename);
+
+  xbt_dynar_push(model_list, &surf_network_model);
+  lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
+                                   func_reno2_fpi);
+  network_solve = lagrange_solve;
+
+  update_model_description(surf_network_model_description,
+                             surf_network_model_description_size,
+                             "Reno2",
+                             (surf_model_t) surf_network_model);
+}
+
 void surf_network_model_init_Vegas(const char *filename)
 {
   if (surf_network_model)
 void surf_network_model_init_Vegas(const char *filename)
 {
   if (surf_network_model)
index d85df52..9381096 100644 (file)
@@ -125,6 +125,15 @@ const char *surf_action_state_names[6] = {
   "SURF_ACTION_NOT_IN_THE_SYSTEM"
 };
 
   "SURF_ACTION_NOT_IN_THE_SYSTEM"
 };
 
+int surf_network_model_description_size = 5
+#ifdef HAVE_GTNETS
+    + 1
+#endif
+#ifdef HAVE_SDP
+    + 1
+#endif
+    ;
+
 s_surf_model_description_t surf_network_model_description[surf_network_model_description_size] = {
   {"Constant", NULL, surf_network_model_init_Constant},
   {"CM02", NULL, surf_network_model_init_CM02},
 s_surf_model_description_t surf_network_model_description[surf_network_model_description_size] = {
   {"Constant", NULL, surf_network_model_init_Constant},
   {"CM02", NULL, surf_network_model_init_CM02},
@@ -135,6 +144,7 @@ s_surf_model_description_t surf_network_model_description[surf_network_model_des
   {"SDP", NULL, surf_network_model_init_SDP},
 #endif
   {"Reno", NULL, surf_network_model_init_Reno},
   {"SDP", NULL, surf_network_model_init_SDP},
 #endif
   {"Reno", NULL, surf_network_model_init_Reno},
+  {"Reno2", NULL, surf_network_model_init_Reno2},
   {"Vegas", NULL, surf_network_model_init_Vegas}
 };
 
   {"Vegas", NULL, surf_network_model_init_Vegas}
 };
 
@@ -211,8 +221,6 @@ double generic_maxmin_share_resources(xbt_swag_t running_actions,
   } else
     min = action->max_duration;
 
   } else
     min = action->max_duration;
 
-  DEBUG5("Found action (%p: duration = %f, remains = %f, value = %f) ! %f",
-        action, action->max_duration, action->remains, value, min);
 
   for (action = xbt_swag_getNext(action, running_actions->offset);
        action;
 
   for (action = xbt_swag_getNext(action, running_actions->offset);
        action;