X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a35265d3c8fa860614bab6b7a438ad0cc2803e79..77ad7d74e9c7c82e4338596278600b18bb87b3e3:/src/simgrid/sg_config.c diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 34e5b43f32..7d4da0ba03 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2012-2013. The SimGrid Team. +/* Copyright (c) 2009-2010, 2012-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -35,6 +35,12 @@ xbt_cfg_t _sg_cfg_set = NULL; */ 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) { @@ -49,6 +55,9 @@ static void sg_config_cmd_line(int *argc, char **argv) xbt_cfg_set_parse(_sg_cfg_set, opt); XBT_DEBUG("Did apply '%s' as config setting", opt); + } else if (!strcmp(argv[i], "--version")) { + printf("%s\n", SIMGRID_VERSION_STRING); + shall_exit = 1; } else if (!strcmp(argv[i], "--cfg-help") || !strcmp(argv[i], "--help")) { printf ("Description of the configuration accepted by this simulator:\n"); @@ -58,6 +67,7 @@ static void sg_config_cmd_line(int *argc, char **argv) "Each of these configurations can be used by adding\n" " --cfg=