X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ec1ff601331bbc2a69a3d7501f468e2238be2a5e..c02558d70f9c62f9f5d04f1830be4cf16ca84bc0:/src/simgrid/sg_config.cpp diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index f90dfa98c3..b6fcd8e2af 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -8,6 +8,7 @@ #include "xbt/misc.h" #include "xbt/config.h" +#include "xbt/config.hpp" #include "xbt/log.h" #include "xbt/mallocator.h" #include "xbt/str.h" @@ -216,42 +217,6 @@ static void _sg_cfg_cb__network_model(const char *name) find_model_description(surf_network_model_description, val); } -/* callbacks of the network models values */ -static void _sg_cfg_cb__tcp_gamma(const char *name) -{ - sg_tcp_gamma = xbt_cfg_get_double(name); -} - -static void _sg_cfg_cb__maxmin_precision(const char* name) -{ - sg_maxmin_precision = xbt_cfg_get_double(name); -} - -static void _sg_cfg_cb__surf_precision(const char* name) -{ - sg_surf_precision = xbt_cfg_get_double(name); -} - -static void _sg_cfg_cb__sender_gap(const char* name) -{ - sg_sender_gap = xbt_cfg_get_double(name); -} - -static void _sg_cfg_cb__latency_factor(const char *name) -{ - sg_latency_factor = xbt_cfg_get_double(name); -} - -static void _sg_cfg_cb__bandwidth_factor(const char *name) -{ - sg_bandwidth_factor = xbt_cfg_get_double(name); -} - -static void _sg_cfg_cb__weight_S(const char *name) -{ - sg_weight_S_parameter = xbt_cfg_get_double(name); -} - #if HAVE_SMPI /* callback of the mpi collectives: simply check that this is a valid name. It will be picked up in smpi_global.cpp */ static void _check_coll(const char *category, @@ -307,29 +272,8 @@ static void _check_coll_barrier(const char *name){ _check_coll("barrier", mpi_coll_barrier_description, name); } -static void _sg_cfg_cb__wtime_sleep(const char *name){ - smpi_wtime_sleep = xbt_cfg_get_double(name); -} - -static void _sg_cfg_cb__iprobe_sleep(const char *name){ - smpi_iprobe_sleep = xbt_cfg_get_double(name); -} - -static void _sg_cfg_cb__test_sleep(const char *name){ - smpi_test_sleep = xbt_cfg_get_double(name); -} #endif -/* callback of the inclusion path */ -static void _sg_cfg_cb__surf_path(const char *name) -{ - char *path = xbt_cfg_get_string(name); - if (path[0]) {// ignore "" - path = xbt_strdup(path); - xbt_dynar_push(surf_path, &path); - } -} - /* callback to decide if we want to use the model-checking */ #include "src/xbt_modinter.h" @@ -419,76 +363,93 @@ static void _sg_cfg_cb__surf_network_crosstraffic(const char *name) } /* build description line with possible values */ -static void describe_model(char *result, +static void describe_model(char *result,int resultsize, const s_surf_model_description_t model_description[], const char *name, const char *description) { - char *p = result + - sprintf(result, "%s. Possible values: %s", description, + result[0] = '\0'; + char *p = result; + p += snprintf(result,resultsize-1, "%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,resultsize-(p-result)-1, ", %s", model_description[i].name); + p += snprintf(p,resultsize-(p-result)-1, ".\n (use 'help' as a value to see the long description of each %s)", name); + + xbt_assert(p("path", + "Lookup path for inclusions in platform and deployment XML files", + "", + [](std::string const& path) { + if (path[0] != '\0') { + char* copy = xbt_strdup(path.c_str()); + xbt_dynar_push(surf_path, ©); + } + }); xbt_cfg_register_boolean("cpu/maxmin-selective-update", "no", NULL, "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)"); @@ -580,10 +541,6 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register_boolean("network/crosstraffic", "yes", _sg_cfg_cb__surf_network_crosstraffic, "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)"); -#if HAVE_NS3 - xbt_cfg_register_string("ns3/TcpModel", "default", NULL, "The ns3 tcp model can be : NewReno or Reno or Tahoe"); -#endif - //For smpi/bw_factor and smpi/lat_factor // SMPI model can be used without enable_smpi, so keep this out of the ifdef. xbt_cfg_register_string("smpi/bw-factor", @@ -620,6 +577,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"); @@ -628,12 +587,13 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register_boolean("smpi/privatize-global-variables", "no", NULL, "Whether we should privatize global variable at runtime."); xbt_cfg_register_alias("smpi/privatize-global-variables", "smpi/privatize_global_variables"); +#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)"); - xbt_cfg_register_double("smpi/iprobe", 1e-4, _sg_cfg_cb__iprobe_sleep, "Minimum time to inject inside a call to MPI_Iprobe"); - xbt_cfg_register_double("smpi/test", 1e-4, _sg_cfg_cb__test_sleep, "Minimum time to inject inside a call to MPI_Test"); - xbt_cfg_register_double("smpi/wtime", 0.0, _sg_cfg_cb__wtime_sleep, "Minimum time to inject inside a call to MPI_Wtime"); xbt_cfg_register_string("smpi/coll-selector", "default", NULL, "Which collective selector to use"); xbt_cfg_register_alias("smpi/coll-selector","smpi/coll_selector");