Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
--help-models display the long description of all known models
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 30 Mar 2010 14:40:36 +0000 (14:40 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 30 Mar 2010 14:40:36 +0000 (14:40 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7398 48e7efb5-ca39-0410-a469-dd3cf9ba447f

ChangeLog
src/surf/surf.c
src/surf/surf_config.c

index 02d3219..8d2c784 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@ SimGrid (3.3.5-svn) unstable; urgency=low
     o netwotk/weight_S: correction to the weight of competing streams
   * Add a long description to the models, that users can see with such
     argument on the command line: --cfg=cpu/model:help
+  * --help-models display the long description of all known models
  SMPI:
   * Implement MPI_Get_count, MPI_MAXLOC, MPI_MINLOC
  XBT:
index 1ad77e9..dec52bf 100644 (file)
@@ -151,7 +151,6 @@ void model_help(const char* category, s_surf_model_description_t * table) {
   printf("Long description of the %s models accepted by this simulator:\n",category);
   for (i = 0; table[i].name; i++)
     printf("  %s: %s\n", table[i].name, table[i].description);
-  exit(0);
 }
 
 int find_model_description(s_surf_model_description_t * table,
index 60da0de..818b456 100644 (file)
@@ -34,7 +34,12 @@ static void surf_config_cmd_line(int *argc, char **argv)
                !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;
+      printf("\nYou can also use --help-models to see the details of all models known by this simulator.\n");
+      exit(0);
+    } else if (!strncmp(argv[i], "--help-models", strlen("--help-models")+1)) {
+      model_help("workstation",surf_workstation_model_description);
+      model_help("CPU",surf_cpu_model_description);
+      model_help("network",surf_network_model_description);
       exit(0);
     }
     if (remove_it) {            /*remove this from argv */
@@ -64,8 +69,10 @@ static void _surf_cfg_cb__workstation_model(const char *name, int pos)
 
   val = xbt_cfg_get_string(_surf_cfg_set, name);
 
-  if (!strcmp(val,"help"))
+  if (!strcmp(val,"help")) {
     model_help("workstation",surf_workstation_model_description);
+    exit(0);
+  }
 
   /* Make sure that the model exists */
   find_model_description(surf_workstation_model_description, val);
@@ -81,8 +88,10 @@ static void _surf_cfg_cb__cpu_model(const char *name, int pos)
 
   val = xbt_cfg_get_string(_surf_cfg_set, name);
 
-  if (!strcmp(val,"help"))
+  if (!strcmp(val,"help")) {
     model_help("CPU",surf_cpu_model_description);
+    exit(0);
+  }
 
   /* New Module missing */
   find_model_description(surf_cpu_model_description, val);
@@ -98,8 +107,10 @@ static void _surf_cfg_cb__network_model(const char *name, int pos)
 
   val = xbt_cfg_get_string(_surf_cfg_set, name);
 
-  if (!strcmp(val,"help"))
+  if (!strcmp(val,"help")) {
     model_help("network",surf_network_model_description);
+    exit(0);
+  }
 
   /* New Module missing */
   find_model_description(surf_network_model_description, val);