*/
int _sg_cfg_init_status = 0;
+/* instruct the upper layer (simix or simdag) to exit as soon as possible
+ */
+int _sg_cfg_exit_asap = 0;
+
+#define sg_cfg_exit_early() do { _sg_cfg_exit_asap = 1; return; } while (0)
+
/* Parse the command line, looking for options */
static void sg_config_cmd_line(int *argc, char **argv)
{
argv[j] = NULL;
*argc = j;
}
- if (shall_exit) {
- _sg_cfg_init_status = 1; // get everything cleanly cleaned on exit
- exit(0);
- }
+ if (shall_exit)
+ sg_cfg_exit_early();
}
/* callback of the workstation/model variable */
if (!strcmp(val, "help")) {
model_help("workstation", surf_workstation_model_description);
- exit(0);
+ sg_cfg_exit_early();
}
/* Make sure that the model exists */
if (!strcmp(val, "help")) {
model_help("CPU", surf_cpu_model_description);
- exit(0);
+ sg_cfg_exit_early();
}
/* New Module missing */
if (!strcmp(val, "help")) {
model_help("optimization", surf_optimization_mode_description);
- exit(0);
+ sg_cfg_exit_early();
}
/* New Module missing */
if (!strcmp(val, "help")) {
model_help("storage", surf_storage_model_description);
- exit(0);
+ sg_cfg_exit_early();
}
/* New Module missing */
if (!strcmp(val, "help")) {
model_help("network", surf_network_model_description);
- exit(0);
+ sg_cfg_exit_early();
}
/* New Module missing */
if (!strcmp(val, "help")) {
coll_help(category, table);
- exit(0);
+ sg_cfg_exit_early();
}
/* New Module missing */
/* create the config set, register what should be and parse the command line*/
void sg_config_init(int *argc, char **argv)
{
- char *description = xbt_malloc(1024), *p = description;
+ char *description = xbt_malloc(1024);
+ char *p;
int i;
/* Create the configuration support */