Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace sprintf by snprintf.
[simgrid.git] / src / simgrid / sg_config.cpp
index 67da0de..7578e05 100644 (file)
@@ -369,11 +369,11 @@ static void describe_model(char *result,
                            const char *description)
 {
   char *p = result +
-    sprintf(result, "%s. Possible values: %s", description,
+    snprintf(result,1024-strlen(result), "%s. Possible values: %s", description,
             model_description[0].name ? model_description[0].name : "n/a");
   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)", name);
+    p += snprintf(p,1024, ", %s", model_description[i].name);
+  snprintf(p,1024, ".\n       (use 'help' as a value to see the long description of each %s)", name);
 }
 
 /* create the config set, register what should be and parse the command line*/
@@ -573,6 +573,8 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_register_alias("smpi/async-small-thresh","smpi/async_small_thresh");
     xbt_cfg_register_alias("smpi/async-small-thresh","smpi/async_small_thres");
 
+    xbt_cfg_register_boolean("smpi/trace-call-location", "no", NULL, "Should filename and linenumber of MPI calls be traced?");
+
     xbt_cfg_register_int("smpi/send-is-detached-thresh", 65536, NULL,
         "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend");
     xbt_cfg_register_alias("smpi/send-is-detached-thresh","smpi/send_is_detached_thresh");
@@ -584,7 +586,7 @@ void sg_config_init(int *argc, char **argv)
 #if HAVE_PAPI
     xbt_cfg_register_string("smpi/papi-events", nullptr, NULL, "This switch enables tracking the specified counters with PAPI");
 #endif
-
+    xbt_cfg_register_string("smpi/comp-adjustment-file", nullptr, NULL, "A file containing speedups or slowdowns for some parts of the code.");
     xbt_cfg_register_string("smpi/os", "1:0:0:0:0", NULL,  "Small messages timings (MPI_Send minimum time for small messages)");
     xbt_cfg_register_string("smpi/ois", "1:0:0:0:0", NULL, "Small messages timings (MPI_Isend minimum time for small messages)");
     xbt_cfg_register_string("smpi/or", "1:0:0:0:0", NULL,  "Small messages timings (MPI_Recv minimum time for small messages)");