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
{
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]);
- 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());
* 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");
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);
+
/* 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 */
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 {
* 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;
/*
- 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);
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);
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);
}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;
sigma_mu += (var->cnsts[i].constraint)->lambda;
//compute sigma_i + mu_i
sigma_mu += (var->cnsts[i].constraint)->lambda;
//compute sigma_i + mu_i
//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) ;
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;
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);
}
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);
}
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);
}
DEBUG0("***** Test 1 (Max-Min) ***** \n");
test1(MAXMIN);
#ifdef HAVE_SDP
DEBUG0("***** Test 1 (Max-Min) ***** \n");
test1(MAXMIN);
#ifdef HAVE_SDP
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
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);
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);