Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Corrected some bugs, added the simix support to the other workstation
authorvelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 6 Jul 2007 15:33:53 +0000 (15:33 +0000)
committervelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 6 Jul 2007 15:33:53 +0000 (15:33 +0000)
models: KCCFLN05_Vegas and KCCFLN05_Reno.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3663 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/msg/ping_pong.c
src/msg/msg_config.c
src/simix/smx_config.c
src/simix/smx_environment.c
src/surf/lagrange.c
src/surf/workstation_KCCFLN05.c
testsuite/surf/simeng_usage.c

index dfcec80..b2ed706 100644 (file)
@@ -153,17 +153,26 @@ int main(int argc, char *argv[])
 {
   MSG_error_t res = MSG_OK;
 
 {
   MSG_error_t res = MSG_OK;
 
-  //MSG_config("surf_workstation_model","KCCFLN05_proportional");
   
   MSG_global_init(&argc,argv);
   
   MSG_global_init(&argc,argv);
-  if (argc < 3) 
-{
-     CRITICAL1 ("Usage: %s platform_file deployment_file\n",argv[0]);
-     CRITICAL1 ("example: %s msg_platform.xml msg_deployment.xml\n",argv[0]);
+
+
+  if (argc != 4){
+     CRITICAL1 ("Usage: %s platform_file deployment_file <model>\n",argv[0]);
+     CRITICAL1 ("example: %s msg_platform.xml msg_deployment.xml KCCFLN05_Vegas\n",argv[0]);
      exit(1);
   }
      exit(1);
   }
-  res = test_all(argv[1],argv[2]);
 
 
+  /* Options for the workstation_model:
+
+     KCCFLN05              => for maxmin
+     KCCFLN05_proportional => for proportional (Vegas)
+     KCCFLN05_Vegas        => for TCP Vegas
+     KCCFLN05_Reno         => for TCP Reno
+  */
+  MSG_config("surf_workstation_model", argv[3]);
+
+  res = test_all(argv[1],argv[2]);
 
   INFO1("Total simulation time: %le", MSG_get_clock());
 
 
   INFO1("Total simulation time: %le", MSG_get_clock());
 
index 7685c1a..46fe08d 100644 (file)
  *     Possible values (defaults to "KCCFLN05"):
  *     - "CLM03": realistic TCP behavior + basic CPU model (see [CML03 at CCGrid03]) + support for parallel tasks
  *     - "KCCFLN05": realistic TCP behavior + basic CPU model (see [CML03 at CCGrid03]) + failure handling + interference between communications and computations if precised in the platform file.
  *     Possible values (defaults to "KCCFLN05"):
  *     - "CLM03": realistic TCP behavior + basic CPU model (see [CML03 at CCGrid03]) + support for parallel tasks
  *     - "KCCFLN05": realistic TCP behavior + basic CPU model (see [CML03 at CCGrid03]) + failure handling + interference between communications and computations if precised in the platform file.
+ *     - "KCCFLN05": realistic TCP behavior + basic CPU model (see [CML03 at CCGrid03]) + failure handling + interference between communications and computations if precised in the platform file. Use maxmin for the network.
+ *     - "KCCFLN05_proportional": realistic TCP behavior + basic CPU model (see [CML03 at CCGrid03]) + failure handling + interference between communications and computations if precised in the platform file. Uses the proportional approahc as described in the Corine Touati's PhD Thesis.
+ *     - "KCCFLN05_Vegas": realistic TCP behavior + basic CPU model (see [CML03 at CCGrid03]) + failure handling + interference between communications and computations if precised in the platform file. Uses the fairness adapted to the TCP Vegas flow control.
+ *     - "KCCFLN05_Reno": realistic TCP behavior + basic CPU model (see [CML03 at CCGrid03]) + failure handling + interference between communications and computations if precised in the platform file. Uses the fairness adapted to the TCP Reno flow control.
  * 
  * Example:
  * MSG_config("surf_workstation_model","KCCFLN05");
  * 
  * Example:
  * MSG_config("surf_workstation_model","KCCFLN05");
@@ -34,7 +38,9 @@ void MSG_config(const char *name, ...) {
   va_list pa;
   /*  xbt_cfg_dump("msg_cfg_set","",_msg_cfg_set);*/
   va_start(pa,name);
   va_list pa;
   /*  xbt_cfg_dump("msg_cfg_set","",_msg_cfg_set);*/
   va_start(pa,name);
-       SIMIX_config(name,pa);
+  
+  SIMIX_config(name,pa);
+  
   va_end(pa);
        return;
 }
   va_end(pa);
        return;
 }
index b7cfd7a..ef77dd6 100644 (file)
@@ -26,8 +26,10 @@ static void _simix_cfg_cb__surf_workstation_model(const char *name, int pos)
   /* New Module missing */
   xbt_assert1(!strcmp(val, "CLM03") ||
               !strcmp(val, "KCCFLN05") ||
   /* New Module missing */
   xbt_assert1(!strcmp(val, "CLM03") ||
               !strcmp(val, "KCCFLN05") ||
-             !strcmp(val, "KCCFLN05_proportionnal"),
-              "Unknown workstation model: %s (either 'CLM03' or 'KCCFLN05'",val);
+             !strcmp(val, "KCCFLN05_proportional") ||
+             !strcmp(val, "KCCFLN05_Vegas") ||
+             !strcmp(val, "KCCFLN05_Reno"),
+              "Unknown workstation model: %s (choices are: 'CLM03', 'KCCFLN05', 'KCCFLN05_proportional', 'KCCFLN05_Vegas' and 'KCCFLN05_Reno'",val);
 }
 
 /* create the config set and register what should be */
 }
 
 /* create the config set and register what should be */
index fe57ebf..7119d22 100644 (file)
@@ -45,8 +45,12 @@ void SIMIX_create_environment(const char *file)
   DEBUG1("Model : %s", workstation_model_name);
   if (!strcmp(workstation_model_name,"KCCFLN05")) {
     surf_workstation_resource_init_KCCFLN05(file);
   DEBUG1("Model : %s", workstation_model_name);
   if (!strcmp(workstation_model_name,"KCCFLN05")) {
     surf_workstation_resource_init_KCCFLN05(file);
-  } else if (!strcmp(workstation_model_name,"KCCFLN05_proportionnal")) {
-    surf_workstation_resource_init_KCCFLN05_proportionnal(file);
+  } else if (!strcmp(workstation_model_name,"KCCFLN05_proportional")) {
+    surf_workstation_resource_init_KCCFLN05_proportional(file);
+  } else if (!strcmp(workstation_model_name,"KCCFLN05_Vegas")) {
+    surf_workstation_resource_init_KCCFLN05_Vegas(file);
+  } else if (!strcmp(workstation_model_name,"KCCFLN05_Reno")) {
+    surf_workstation_resource_init_KCCFLN05_Reno(file);
   } else if (!strcmp(workstation_model_name,"CLM03")) {
     surf_workstation_resource_init_CLM03(file);
   } else {
   } else if (!strcmp(workstation_model_name,"CLM03")) {
     surf_workstation_resource_init_CLM03(file);
   } else {
index 8190dfb..e656c70 100644 (file)
@@ -41,8 +41,8 @@ void lagrange_solve(lmm_system_t sys)
    * Lagrange Variables.
    */
   int max_iterations= 10000;
    * Lagrange Variables.
    */
   int max_iterations= 10000;
-  double epsilon_min_error  = 1e-4;
-  double dicotomi_min_error = 1e-8;
+  double epsilon_min_error  = 1e-6;
+  double dicotomi_min_error = 1e-6;
   double overall_error = 1;
 
   /*
   double overall_error = 1;
 
   /*
@@ -160,7 +160,7 @@ void lagrange_solve(lmm_system_t sys)
        
        var->value = tmp;
       }
        
        var->value = tmp;
       }
-      DEBUG4("======> value of var %s (%p)  = %e, overall_error = %e", (char *)var->id, var, var->value, overall_error);       
+      DEBUG3("======> value of var (%p)  = %e, overall_error = %e", var, var->value, overall_error);       
     }
   }
 
     }
   }
 
@@ -178,7 +178,7 @@ void lagrange_solve(lmm_system_t sys)
     tmp = tmp - cnst->bound;
 
     if(tmp > epsilon_min_error){
     tmp = tmp - cnst->bound;
 
     if(tmp > epsilon_min_error){
-      WARN4("The link %s(%p) doesn't match the KKT property, expected less than %e and got %e", (char *)cnst->id, cnst, epsilon_min_error, tmp);
+      WARN3("The link (%p) doesn't match the KKT property, expected less than %e and got %e", cnst, epsilon_min_error, tmp);
     }
   
   }
     }
   
   }
@@ -190,8 +190,8 @@ void lagrange_solve(lmm_system_t sys)
     tmp = (var->value - var->bound);
 
     
     tmp = (var->value - var->bound);
 
     
-    if(tmp != 0 ||  var->mu != 0){
-      WARN4("The flow %s(%p) doesn't match the KKT property, value expected (=0) got (lambda=%e) (sum_rho=%e)", (char *)var->id, var, var->mu, tmp);
+    if(tmp != 0.0 ||  var->mu != 0.0){
+      WARN3("The flow (%p) doesn't match the KKT property, value expected (=0) got (lambda=%e) (sum_rho=%e)", var, var->mu, tmp);
     }
 
   }
     }
 
   }
@@ -260,7 +260,10 @@ double dicotomi(double init, double diff(double, void*), void *var_cnst, double
     }else if( min_diff < 0 && max_diff > 0 ){
       middle = (max + min)/2.0;
       middle_diff = diff(middle, var_cnst);
     }else if( min_diff < 0 && max_diff > 0 ){
       middle = (max + min)/2.0;
       middle_diff = diff(middle, var_cnst);
-      overall_error = fabs(min - max);
+
+      if(max != 0.0 && min != 0.0){
+       overall_error = fabs(min - max)/max;
+      }
 
       if( middle_diff < 0 ){
        min = middle;
 
       if( middle_diff < 0 ){
        min = middle;
@@ -300,7 +303,7 @@ double partial_diff_mu(double mu, void *param_var){
     sigma_mu += (var->cnsts[i].constraint)->lambda;
   
   //compute sigma_i + mu_i
     sigma_mu += (var->cnsts[i].constraint)->lambda;
   
   //compute sigma_i + mu_i
-  sigma_mu += var->mu;
+  sigma_mu += mu;
   
   //use auxiliar function passing (sigma_i + mu_i)
   mu_partial = diff_aux(var, sigma_mu) ;
   
   //use auxiliar function passing (sigma_i + mu_i)
   mu_partial = diff_aux(var, sigma_mu) ;
@@ -326,7 +329,7 @@ double partial_diff_lambda(double lambda, void *param_cnst){
 
   elem_list = &(cnst->element_set);
 
 
   elem_list = &(cnst->element_set);
 
-  DEBUG2("Computting diff of cnst (%p) %s", cnst, (char *)cnst->id);
+  DEBUG1("Computting diff of cnst (%p)", cnst);
   
   xbt_swag_foreach(elem, elem_list) {
     var = elem->variable;
   
   xbt_swag_foreach(elem, elem_list) {
     var = elem->variable;
index e3878a2..09b44c4 100644 (file)
@@ -1068,14 +1068,14 @@ void surf_workstation_resource_init_KCCFLN05(const char *filename)
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
 
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
 
-void surf_workstation_resource_init_KCCFLN05_proportionnal(const char *filename)
+void surf_workstation_resource_init_KCCFLN05_proportional(const char *filename)
 {
   xbt_assert0(!surf_cpu_resource, "CPU resource type already defined");
   xbt_assert0(!surf_network_resource, "network resource type already defined");
   resource_init_internal();
   parse_file(filename);
 
 {
   xbt_assert0(!surf_cpu_resource, "CPU resource type already defined");
   xbt_assert0(!surf_network_resource, "network resource type already defined");
   resource_init_internal();
   parse_file(filename);
 
-  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (proportionnal)";
+  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (proportional)";
   use_sdp_solver=1;
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
   use_sdp_solver=1;
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
@@ -1089,7 +1089,7 @@ void surf_workstation_resource_init_KCCFLN05_Vegas(const char *filename)
 
   lmm_set_default_protocol_functions(func_vegas_f, func_vegas_fp, func_vegas_fpi, func_vegas_fpip);
 
 
   lmm_set_default_protocol_functions(func_vegas_f, func_vegas_fp, func_vegas_fpi, func_vegas_fpip);
 
-  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (proportionnal)";
+  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (Vegas)";
   use_lagrange_solver=1;
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
   use_lagrange_solver=1;
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
@@ -1103,7 +1103,7 @@ void surf_workstation_resource_init_KCCFLN05_Reno(const char *filename)
 
   lmm_set_default_protocol_functions(func_reno_f, func_reno_fp, func_reno_fpi, func_reno_fpip);
 
 
   lmm_set_default_protocol_functions(func_reno_f, func_reno_fp, func_reno_fpi, func_reno_fpip);
 
-  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (proportionnal)";
+  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (Reno)";
   use_lagrange_solver=1;
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
   use_lagrange_solver=1;
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
index c541747..71b71bc 100644 (file)
@@ -365,6 +365,8 @@ int main(int argc, char **argv)
 {
   xbt_init(&argc,argv);
 
 {
   xbt_init(&argc,argv);
 
+
+
   DEBUG0("***** Test 1 (Max-Min) ***** \n");
   test1(MAXMIN);
 #ifdef HAVE_SDP
   DEBUG0("***** Test 1 (Max-Min) ***** \n");
   test1(MAXMIN);
 #ifdef HAVE_SDP
@@ -376,8 +378,6 @@ int main(int argc, char **argv)
   DEBUG0("***** Test 1 (Lagrange - Reno) ***** \n");
   test1(LAGRANGE_RENO);
 
   DEBUG0("***** Test 1 (Lagrange - Reno) ***** \n");
   test1(LAGRANGE_RENO);
 
-
-
   DEBUG0("***** Test 2 (Max-Min) ***** \n");
   test2(MAXMIN);
 #ifdef HAVE_SDP
   DEBUG0("***** Test 2 (Max-Min) ***** \n");
   test2(MAXMIN);
 #ifdef HAVE_SDP
@@ -389,17 +389,16 @@ int main(int argc, char **argv)
   DEBUG0("***** Test 2 (Lagrange - Reno) ***** \n");
   test2(LAGRANGE_RENO);
 
   DEBUG0("***** Test 2 (Lagrange - Reno) ***** \n");
   test2(LAGRANGE_RENO);
 
-
   DEBUG0("***** Test 3 (Max-Min) ***** \n");
   test3(MAXMIN);
 #ifdef HAVE_SDP
   DEBUG0("***** Test 3 (SDP) ***** \n");
   test3(SDP);
   DEBUG0("***** Test 3 (Max-Min) ***** \n");
   test3(MAXMIN);
 #ifdef HAVE_SDP
   DEBUG0("***** Test 3 (SDP) ***** \n");
   test3(SDP);
-#endif 
+#endif
   DEBUG0("***** Test 3 (Lagrange - Vegas) ***** \n");
   test3(LAGRANGE_VEGAS);
   DEBUG0("***** Test 3 (Lagrange - Vegas) ***** \n");
   test3(LAGRANGE_VEGAS);
-  DEBUG0("***** Test 3 (Lagrange - Reno) ***** \n"); 
-  test3(LAGRANGE_RENO); 
+  DEBUG0("***** Test 3 (Lagrange - Reno) ***** \n");
+  test3(LAGRANGE_RENO);
 
   return 0;
 }
 
   return 0;
 }