SIMDAG:
* Move the configuration infrastructure to surf
- XBT:
- * Also include strbuff from xbt.h public header
- * xbt_ex_display(): do not free the exception after displaying
- This allows to do more with the given exception afterward.
- Users should call xbt_ex_free() themselves.
-
SMPI:
* Massive internal cleanups:
- Store internal structures on processes instead of hosts (allows
* Compile the examples by default, and use them as regression tests
* Implement MPI_Wtime()
+ SURF:
+ * TCP_gamma can now be specified as command line option using
+ --cfg=TCP_gamma:10000000.0
+
+ XBT:
+ * Also include strbuff from xbt.h public header
+ * xbt_ex_display(): do not free the exception after displaying
+ This allows to do more with the given exception afterward.
+ Users should call xbt_ex_free() themselves.
+
Build Chain:
* Do not require doxygen in maintainer mode
action->weight += delta;
if (action->rate < 0)
lmm_update_variable_bound(network_maxmin_system, action->variable,
- SG_TCP_CTE_GAMMA / (2.0 *
- action->lat_current));
+ sg_tcp_gamma / (2.0 * action->lat_current));
else
lmm_update_variable_bound(network_maxmin_system, action->variable,
min(action->rate,
- SG_TCP_CTE_GAMMA / (2.0 *
- action->lat_current)));
+ sg_tcp_gamma / (2.0 * action->lat_current)));
if (!(action->suspended))
lmm_update_variable_weight(network_maxmin_system, action->variable,
action->weight);
action->generic_action.start = surf_get_clock();
action->generic_action.finish = -1.0;
action->generic_action.model_type = (surf_model_t) surf_network_model;
- action->suspended = 0; /* Should be useless because of the
+ action->suspended = 0; /* Should be useless because of the
calloc but it seems to help valgrind... */
action->generic_action.state_set =
surf_network_model->common_public->states.running_action_set;
if (action->rate < 0) {
if (action->lat_current > 0)
lmm_update_variable_bound(network_maxmin_system, action->variable,
- SG_TCP_CTE_GAMMA / (2.0 *
- action->lat_current));
+ sg_tcp_gamma / (2.0 * action->lat_current));
else
lmm_update_variable_bound(network_maxmin_system, action->variable,
-1.0);
if (action->lat_current > 0)
lmm_update_variable_bound(network_maxmin_system, action->variable,
min(action->rate,
- SG_TCP_CTE_GAMMA / (2.0 *
- action->lat_current)));
+ sg_tcp_gamma / (2.0 * action->lat_current)));
else
lmm_update_variable_bound(network_maxmin_system, action->variable,
action->rate);
xbt_cfg_t _surf_cfg_set = NULL;
+
+/* Parse the command line, looking for options */
+static void surf_config_cmd_line(int *argc,char **argv)
+{
+ int i, j;
+ char *opt;
+
+ for (i = 1; i < *argc; i++) {
+ int remove_it = 0;
+ if (!strncmp(argv[i], "--cfg=", strlen("--cfg="))) {
+ opt = strchr(argv[i], '=');
+ opt++;
+
+ xbt_cfg_set_parse(_surf_cfg_set,opt);
+ DEBUG1("Did apply '%s' as config setting", opt);
+ remove_it = 1;
+ } else if (!strncmp(argv[i], "--cfg-help", strlen("--cfg-help")+1) ||
+ !strncmp(argv[i], "--help", strlen("--help")+1)) {
+ printf("Description of the configuration accepted by this simulator:\n");
+ xbt_cfg_help(_surf_cfg_set);
+ remove_it=1;
+ exit(0);
+ }
+ if (remove_it) { /*remove this from argv */
+ for (j = i + 1; j < *argc; j++) {
+ argv[j - 1] = argv[j];
+ }
+
+ argv[j - 1] = NULL;
+ (*argc)--;
+ i--; /* compensate effect of next loop incrementation */
+ }
+ }
+}
+
+
int _surf_init_status = 0; /* 0: beginning of time;
1: pre-inited (cfg_set created);
2: inited (running) */
find_model_description(surf_network_model_description, val);
}
-/* Parse the command line, looking for options */
-static void surf_config_cmd_line(int *argc,char **argv)
+/* callback of the cpu_model variable */
+static void _surf_cfg_cb__tcp_gamma(const char *name, int pos)
{
- int i, j;
- char *opt;
-
- for (i = 1; i < *argc; i++) {
- int remove_it = 0;
- if (!strncmp(argv[i], "--cfg=", strlen("--cfg="))) {
- opt = strchr(argv[i], '=');
- opt++;
+ sg_tcp_gamma = xbt_cfg_get_double(_surf_cfg_set, name);
+}
- xbt_cfg_set_parse(_surf_cfg_set,opt);
- DEBUG1("Did apply '%s' as config setting", opt);
- remove_it = 1;
- } else if (!strncmp(argv[i], "--cfg-help", strlen("--cfg-help")+1) ||
- !strncmp(argv[i], "--help", strlen("--help")+1)) {
- printf("Description of the configuration accepted by this simulator:\n");
- xbt_cfg_help(_surf_cfg_set);
- remove_it=1;
- exit(0);
- }
- if (remove_it) { /*remove this from argv */
- for (j = i + 1; j < *argc; j++) {
- argv[j - 1] = argv[j];
- }
- argv[j - 1] = NULL;
- (*argc)--;
- i--; /* compensate effect of next loop incrementation */
- }
- }
-}
/* create the config set, register what should be and parse the command line*/
void surf_config_init(int *argc, char **argv) {
xbt_cfg_set_string(_surf_cfg_set, "cpu_model", "Cas01");
xbt_cfg_set_string(_surf_cfg_set, "network_model", "CM02");
+ xbt_cfg_register(_surf_cfg_set,"TCP_gamma","Size of the biggest TCP window",1,1,
+ xbt_cfgelm_double,_surf_cfg_cb__tcp_gamma,NULL);
+ xbt_cfg_set_double(_surf_cfg_set, "TCP_gamma", 20000.0);
+
surf_config_cmd_line(argc,argv);
}
}
#include "surf/random_mgr.h"
#define NO_MAX_DURATION -1.0
-#define SG_TCP_CTE_GAMMA 20000.0
+double sg_tcp_gamma;
extern const char *surf_action_state_names[6];
}
}
}
- lat_bound = SG_TCP_CTE_GAMMA / (2.0 * lat_current);
+ lat_bound = sg_tcp_gamma / (2.0 * lat_current);
DEBUG2("action (%p) : lat_bound = %g", action, lat_bound);
if ((action->latency == 0.0) && (action->suspended == 0)) {
if (action->rate < 0)
link->lat_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
}
/*
-
+
xbt_dynar_foreach (traces_connect_list, cpt, value) {
trace_connect = xbt_str_split_str(value, "#");
trace_id = xbt_dynar_get_as(trace_connect, 0, char*);
- connect_element = atoi(xbt_dynar_get_as(trace_connect, 1, char*));
+ connect_element = atoi(xbt_dynar_get_as(trace_connect, 1, char*));
connect_kind = atoi(xbt_dynar_get_as(trace_connect, 2, char*));
connector_id = xbt_dynar_get_as(trace_connect, 3, char*);