o cpu_model -> cpu/model
o network_model -> network/model
o workstation_model -> workstation/model
+ * New configuration variables:
+ o network/bandwidth_factor: correction to bandwith
+ o network/latency_factor: correction to latency
+ o netwotk/weight_S: correction to the weight of competing streams
SMPI:
* Implement MPI_Get_count, MPI_MAXLOC, MPI_MINLOC
XBT:
static lmm_system_t network_maxmin_system = NULL;
static void (*network_solve) (lmm_system_t) = NULL;
-double latency_factor = 1.0; /* default value */
-double bandwidth_factor = 1.0; /* default value */
-double weight_S_parameter = 0.0; /* default value */
+double sg_latency_factor = 1.0; /* default value; can be set by model or from command line */
+double sg_bandwidth_factor = 1.0; /* default value; can be set by model or from command line */
+double sg_weight_S_parameter = 0.0;/* default value; can be set by model or from command line */
double sg_tcp_gamma = 0.0;
surf_resource_lmm_new(sizeof(s_link_CM02_t),
surf_network_model, name, properties,
network_maxmin_system,
- bandwidth_factor * bw_initial,
+ sg_bandwidth_factor * bw_initial,
history,
state_initial, state_trace,
bw_initial, bw_trace);
if (event_type == nw_link->lmm_resource.power.event) {
double delta =
- weight_S_parameter / value - weight_S_parameter /
+ sg_weight_S_parameter / value - sg_weight_S_parameter /
(nw_link->lmm_resource.power.peak * nw_link->lmm_resource.power.scale);
lmm_variable_t var = NULL;
lmm_element_t elem = NULL;
nw_link->lmm_resource.power.peak = value;
lmm_update_constraint_bound(network_maxmin_system,
nw_link->lmm_resource.constraint,
- bandwidth_factor *
+ sg_bandwidth_factor *
(nw_link->lmm_resource.power.peak *
nw_link->lmm_resource.power.scale));
- if (weight_S_parameter > 0) {
+ if (sg_weight_S_parameter > 0) {
while ((var = lmm_get_var_from_cnst
(network_maxmin_system, nw_link->lmm_resource.constraint,
&elem))) {
action->latency += link->lat_current;
action->weight +=
link->lat_current +
- weight_S_parameter /
+ sg_weight_S_parameter /
(link->lmm_resource.power.peak * link->lmm_resource.power.scale);
}
/* LARGE PLATFORMS HACK:
Add src->link and dst->link latencies */
action->lat_current = action->latency;
- action->latency *= latency_factor;
+ action->latency *= sg_latency_factor;
/* LARGE PLATFORMS HACK:
lmm_variable_new(..., total_route_size) */
xbt_dynar_push(model_list, &surf_network_model);
network_solve = lmm_solve;
- latency_factor = 10.4;
- bandwidth_factor = 0.92;
- weight_S_parameter = 8775;
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor",10.4);
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
update_model_description(surf_network_model_description,
"LV08", surf_network_model);
lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
network_solve = lagrange_solve;
- latency_factor = 10.4;
- bandwidth_factor = 0.92;
- weight_S_parameter = 8775;
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
update_model_description(surf_network_model_description,
"Reno", surf_network_model);
func_reno2_fpi);
network_solve = lagrange_solve;
- latency_factor = 10.4;
- bandwidth_factor = 0.92;
- weight_S_parameter = 8775;
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S_parameter", 8775);
update_model_description(surf_network_model_description,
"Reno2", surf_network_model);
func_vegas_fpi);
network_solve = lagrange_solve;
- latency_factor = 10.4;
- bandwidth_factor = 0.92;
- weight_S_parameter = 8775;
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
+ xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
update_model_description(surf_network_model_description,
"Vegas", surf_network_model);
-/* $Id$ */
-
-/* Copyright (c) 2009 The SimGrid team. All rights reserved. */
+/* Copyright (c) 2009-2010 The SimGrid team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
find_model_description(surf_network_model_description, val);
}
-/* callback of the tcp gamma variable */
-static void _surf_cfg_cb__tcp_gamma(const char *name, int pos)
-{
+
+/* callbacks of the network models values */
+static void _surf_cfg_cb__tcp_gamma(const char *name, int pos) {
sg_tcp_gamma = xbt_cfg_get_double(_surf_cfg_set, name);
}
+static void _surf_cfg_cb__latency_factor(const char *name, int pos) {
+ sg_latency_factor = xbt_cfg_get_double(_surf_cfg_set, name);
+}
+static void _surf_cfg_cb__bandwidth_factor(const char *name, int pos) {
+ sg_bandwidth_factor = xbt_cfg_get_double(_surf_cfg_set, name);
+}
+static void _surf_cfg_cb__weight_S(const char *name, int pos) {
+ sg_weight_S_parameter = xbt_cfg_get_double(_surf_cfg_set, name);
+}
+static void _surf_cfg_cb__surf_maxmin_selective_update(const char *name, int pos) {
+ sg_maxmin_selective_update = xbt_cfg_get_int(_surf_cfg_set, name);
+}
-static void _surf_cfg_cb__surf_path(const char *name, int pos)
-{
+/* callback of the inclusion path */
+static void _surf_cfg_cb__surf_path(const char *name, int pos) {
char *path = xbt_cfg_get_string_at(_surf_cfg_set, name, pos);
xbt_dynar_push(surf_path, &path);
}
-static void _surf_cfg_cb__surf_maxmin_selective_update(const char *name, int pos)
-{
- sg_maxmin_selective_update = xbt_cfg_get_int(_surf_cfg_set, name);
-}
#ifdef HAVE_GTNETS
static void _surf_cfg_cb__gtnets_jitter(const char *name, int pos){
char *description = xbt_malloc(1024), *p = description;
char *default_value;
+ double double_default_value;
int default_value_int;
int i;
default_value = xbt_strdup("Full");
xbt_cfg_register(&_surf_cfg_set, "routing",
"Model to use to store the routing information",
- xbt_cfgelm_string, &default_value, 1, 1, NULL,
- NULL);
+ xbt_cfgelm_string, &default_value, 1, 1, NULL, NULL);
xbt_cfg_register(&_surf_cfg_set, "TCP_gamma",
- "Size of the biggest TCP window (cat /proc/sys/net/ipv4/tcp_[rw]mem for recv/send window; middle value=default value => you probably want default send value)", xbt_cfgelm_double,
- NULL, 1, 1, _surf_cfg_cb__tcp_gamma, NULL);
+ "Size of the biggest TCP window (cat /proc/sys/net/ipv4/tcp_[rw]mem for recv/send window; middle value=default value => you probably want default send value)",
+ xbt_cfgelm_double, NULL, 1, 1, _surf_cfg_cb__tcp_gamma, NULL);
xbt_cfg_set_double(_surf_cfg_set, "TCP_gamma", 20000.0);
+ /* The parameters of network models */
+ double_default_value = 1.0;
+ xbt_cfg_register(&_surf_cfg_set, "network/latency_factor",
+ "Correction factor to apply to the provided latency (default value set by network model)",
+ xbt_cfgelm_double, &double_default_value, 1, 1, _surf_cfg_cb__latency_factor, NULL);
+ double_default_value = 1.0;
+ xbt_cfg_register(&_surf_cfg_set, "network/bandwidth_factor",
+ "Correction factor to apply to the provided bandwidth (default value set by network model)",
+ xbt_cfgelm_double, &double_default_value, 1, 1, _surf_cfg_cb__bandwidth_factor, NULL);
+ double_default_value = 0.0;
+ xbt_cfg_register(&_surf_cfg_set, "network/weight_S",
+ "Correction factor to apply to the weight of competing streams(default value set by network model)",
+ xbt_cfgelm_double, &double_default_value, 1, 1, _surf_cfg_cb__weight_S, NULL);
+
+ /* Inclusion path */
xbt_cfg_register(&_surf_cfg_set, "path",
"Lookup path for inclusions in platform and deployment XML files",
xbt_cfgelm_string, NULL, 0, 0, _surf_cfg_cb__surf_path,
#include "surf/random_mgr.h"
#define NO_MAX_DURATION -1.0
+
+/* user-visible parameters */
extern double sg_tcp_gamma;
+extern double sg_latency_factor;
+extern double sg_bandwidth_factor;
+extern double sg_weight_S_parameter;
extern int sg_maxmin_selective_update;
#ifdef HAVE_GTNETS
extern double sg_gtnets_jitter;
extern int sg_gtnets_jitter_seed;
#endif
+
extern const char *surf_action_state_names[6];
typedef enum {