{
int shall_exit = 0;
int i, j;
- char *opt;
for (j = i = 1; i < *argc; i++) {
if (!strncmp(argv[i], "--cfg=", strlen("--cfg="))) {
- opt = strchr(argv[i], '=');
+ char *opt = strchr(argv[i], '=');
opt++;
xbt_cfg_set_parse(opt);
printf("Please consider using the recent names\n");
shall_exit = 1;
} else if (!strcmp(argv[i], "--help-models")) {
- int k;
-
model_help("host", surf_host_model_description);
printf("\n");
model_help("CPU", surf_cpu_model_description);
printf("\n");
model_help("network", surf_network_model_description);
printf("\nLong description of all optimization levels accepted by the models of this simulator:\n");
- for (k = 0; surf_optimization_mode_description[k].name; k++)
+ for (int k = 0; surf_optimization_mode_description[k].name; k++)
printf(" %s: %s\n",
surf_optimization_mode_description[k].name,
surf_optimization_mode_description[k].description);
sg_cfg_exit_early();
}
- /* New Module missing */
int plugin_id = find_model_description(surf_plugin_description, val);
surf_plugin_description[plugin_id].model_init_preparse();
}
/* callback of the cpu/model variable */
static void _sg_cfg_cb__optimization_mode(const char *name)
{
- char *val;
-
- xbt_assert(_sg_cfg_init_status < 2,
- "Cannot change the model after the initialization");
-
- val = xbt_cfg_get_string(name);
+ xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
+ char *val = xbt_cfg_get_string(name);
if (!strcmp(val, "help")) {
model_help("optimization", surf_optimization_mode_description);
sg_cfg_exit_early();
/* callback of the cpu/model variable */
static void _sg_cfg_cb__storage_mode(const char *name)
{
- char *val;
-
- xbt_assert(_sg_cfg_init_status < 2,
- "Cannot change the model after the initialization");
-
- val = xbt_cfg_get_string(name);
+ xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
+ char *val = xbt_cfg_get_string(name);
if (!strcmp(val, "help")) {
model_help("storage", surf_storage_model_description);
sg_cfg_exit_early();
}
- /* New Module missing */
find_model_description(surf_storage_model_description, val);
}
/* callback of the network_model variable */
static void _sg_cfg_cb__network_model(const char *name)
{
- char *val;
-
- xbt_assert(_sg_cfg_init_status < 2,
- "Cannot change the model after the initialization");
-
- val = xbt_cfg_get_string(name);
+ xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
+ char *val = xbt_cfg_get_string(name);
if (!strcmp(val, "help")) {
model_help("network", surf_network_model_description);
sg_cfg_exit_early();
xbt_assert(_sg_cfg_init_status < 2, "Cannot change the collective algorithm after the initialization");
char *val = xbt_cfg_get_string(name);
-
if (val && !strcmp(val, "help")) {
coll_help(category, table);
sg_cfg_exit_early();
static void _sg_cfg_cb__test_sleep(const char *name){
smpi_test_sleep = xbt_cfg_get_double(name);
}
-
-
-
#endif
/* callback of the inclusion path */
/* callback to decide if we want to use the model-checking */
#include "src/xbt_modinter.h"
-#if HAVE_MC
-extern int _sg_do_model_check; /* this variable lives in xbt_main until I find a right location for it */
-extern int _sg_do_model_check_record;
-#endif
-
static void _sg_cfg_cb_model_check_replay(const char *name) {
MC_record_path = xbt_cfg_get_string(name);
}
#if HAVE_MC
+extern int _sg_do_model_check_record;
static void _sg_cfg_cb_model_check_record(const char *name) {
_sg_do_model_check_record = xbt_cfg_get_boolean(name);
}
#endif
extern int _sg_do_verbose_exit;
-
static void _sg_cfg_cb_verbose_exit(const char *name)
{
_sg_do_verbose_exit = xbt_cfg_get_boolean(name);
}
extern int _sg_do_clean_atexit;
-
static void _sg_cfg_cb_clean_atexit(const char *name)
{
_sg_do_clean_atexit = xbt_cfg_get_boolean(name);
char *p = result +
sprintf(result, "%s. Possible values: %s", description,
model_description[0].name ? model_description[0].name : "n/a");
- int i;
- for (i = 1; model_description[i].name; i++)
+ for (int i = 1; model_description[i].name; i++)
p += sprintf(p, ", %s", model_description[i].name);
sprintf(p,
".\n (use 'help' as a value to see the long description of each %s)",