Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename simgrid::config::get_config -> simgrid::config::get_value.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 19 Apr 2018 12:48:19 +0000 (14:48 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 19 Apr 2018 14:06:43 +0000 (16:06 +0200)
25 files changed:
include/xbt/config.h
include/xbt/config.hpp
src/instr/instr_config.cpp
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_events.cpp
src/instr/instr_paje_header.cpp
src/msg/msg_global.cpp
src/simdag/sd_global.cpp
src/simix/smx_context.cpp
src/simix/smx_global.cpp
src/smpi/colls/smpi_coll.cpp
src/smpi/internals/SmpiHost.cpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_process.cpp
src/smpi/internals/smpi_shared.cpp
src/smpi/mpi/smpi_request.cpp
src/surf/cpu_cas01.cpp
src/surf/network_cm02.cpp
src/surf/network_ib.cpp
src/surf/network_smpi.cpp
src/surf/plugins/host_dvfs.cpp
src/surf/sg_platf.cpp
src/xbt/config.cpp
src/xbt/exception.cpp

index 6c4219a..e953b47 100644 (file)
@@ -140,11 +140,11 @@ XBT_PUBLIC void xbt_cfg_help();
  *  @{
  */
 
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_config<int>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_value<int>") XBT_PUBLIC
     int xbt_cfg_get_int(const char* name);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_config<double>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_value<double>") XBT_PUBLIC
     double xbt_cfg_get_double(const char* name);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_config<bool>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_value<bool>") XBT_PUBLIC
     int xbt_cfg_get_boolean(const char* name);
 
 /** @} */
index 4521614..eb0e3d6 100644 (file)
@@ -45,12 +45,12 @@ inline std::string to_string(std::string&& value)
 
 // Get config
 
-template <class T> XBT_PUBLIC T const& get_config(const char* name);
+template <class T> XBT_PUBLIC T const& get_value(const char* name);
 
-extern template XBT_PUBLIC int const& get_config<int>(const char* name);
-extern template XBT_PUBLIC double const& get_config<double>(const char* name);
-extern template XBT_PUBLIC bool const& get_config<bool>(const char* name);
-extern template XBT_PUBLIC std::string const& get_config<std::string>(const char* name);
+extern template XBT_PUBLIC int const& get_value<int>(const char* name);
+extern template XBT_PUBLIC double const& get_value<double>(const char* name);
+extern template XBT_PUBLIC bool const& get_value<bool>(const char* name);
+extern template XBT_PUBLIC std::string const& get_value<std::string>(const char* name);
 
 // Register:
 
@@ -258,7 +258,7 @@ public:
 
 }
 }
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_config<std::string>") XBT_PUBLIC std::string
+XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_value<std::string>") XBT_PUBLIC std::string
     xbt_cfg_get_string(const char* name);
 
 #endif
index 4acb268..f5e687a 100644 (file)
@@ -86,7 +86,7 @@ int TRACE_start()
     /* init the tracing module to generate the right output */
 
     /* open the trace file(s) */
-    std::string format = simgrid::config::get_config<std::string>(OPT_TRACING_FORMAT);
+    std::string format = simgrid::config::get_value<std::string>(OPT_TRACING_FORMAT);
     XBT_DEBUG("Tracing format %s\n", format.c_str());
     if (format == "Paje") {
       TRACE_paje_start();
@@ -125,7 +125,7 @@ int TRACE_end()
     delete root_type;
 
     /* close the trace files */
-    std::string format = simgrid::config::get_config<std::string>(OPT_TRACING_FORMAT);
+    std::string format = simgrid::config::get_value<std::string>(OPT_TRACING_FORMAT);
     XBT_DEBUG("Tracing format %s\n", format.c_str());
     if (format == "Paje") {
       TRACE_paje_end();
@@ -241,22 +241,22 @@ bool TRACE_display_sizes ()
 
 std::string TRACE_get_comment()
 {
-  return simgrid::config::get_config<std::string>(OPT_TRACING_COMMENT);
+  return simgrid::config::get_value<std::string>(OPT_TRACING_COMMENT);
 }
 
 std::string TRACE_get_comment_file()
 {
-  return simgrid::config::get_config<std::string>(OPT_TRACING_COMMENT_FILE);
+  return simgrid::config::get_value<std::string>(OPT_TRACING_COMMENT_FILE);
 }
 
 int TRACE_precision ()
 {
-  return simgrid::config::get_config<int>(OPT_TRACING_PRECISION);
+  return simgrid::config::get_value<int>(OPT_TRACING_PRECISION);
 }
 
 std::string TRACE_get_filename()
 {
-  return simgrid::config::get_config<std::string>(OPT_TRACING_FILENAME);
+  return simgrid::config::get_value<std::string>(OPT_TRACING_FILENAME);
 }
 
 void TRACE_global_init()
index f509556..9ecaa54 100644 (file)
@@ -166,7 +166,7 @@ void Container::logCreation()
       prefix = xbt_os_time();
     }
 
-    if (not simgrid::config::get_config<bool>("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
+    if (not simgrid::config::get_value<bool>("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
       std::string folder_name = TRACE_get_filename() + "_files";
       std::string filename    = folder_name + "/" + std::to_string(prefix) + "_" + name_ + ".txt";
 #ifdef WIN32
@@ -197,7 +197,7 @@ void Container::logDestruction()
     XBT_DEBUG("Dump %s", stream.str().c_str());
     fprintf(tracing_file, "%s\n", stream.str().c_str());
   } else if (trace_format == simgrid::instr::TraceFormat::Ti) {
-    if (not simgrid::config::get_config<bool>("tracing/smpi/format/ti-one-file") || tracing_files.size() == 1) {
+    if (not simgrid::config::get_value<bool>("tracing/smpi/format/ti-one-file") || tracing_files.size() == 1) {
       fclose(tracing_files.at(this));
     }
     tracing_files.erase(this);
index a9abe0e..267c16d 100644 (file)
@@ -32,7 +32,7 @@ StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type
     : PajeEvent::PajeEvent(container, type, SIMIX_get_clock(), event_type), value(value), extra_(extra)
 {
 #if HAVE_SMPI
-  if (simgrid::config::get_config<bool>("smpi/trace-call-location")) {
+  if (simgrid::config::get_value<bool>("smpi/trace-call-location")) {
     smpi_trace_call_location_t* loc = smpi_trace_get_call_location();
     filename                        = loc->filename;
     linenumber                      = loc->linenumber;
@@ -87,7 +87,7 @@ void StateEvent::print()
       stream_ << " " << ((extra_ != nullptr) ? extra_->display_size() : 0);
 
 #if HAVE_SMPI
-    if (simgrid::config::get_config<bool>("smpi/trace-call-location")) {
+    if (simgrid::config::get_value<bool>("smpi/trace-call-location")) {
       stream_ << " \"" << filename << "\" " << linenumber;
     }
 #endif
index b7f4229..01cd5bd 100644 (file)
@@ -164,7 +164,7 @@ static void TRACE_header_PajePushState(int size)
   fprintf(tracing_file, "%%       Value string\n");
   if (size) fprintf(tracing_file, "%%       Size int\n");
 #if HAVE_SMPI
-  if (simgrid::config::get_config<bool>("smpi/trace-call-location")) {
+  if (simgrid::config::get_value<bool>("smpi/trace-call-location")) {
     /**
      * paje currently (May 2016) uses "Filename" and "Linenumber" as
      * reserved words. We cannot use them...
index 52ee291..3fc450f 100644 (file)
@@ -51,7 +51,7 @@ void MSG_init_nocheck(int *argc, char **argv) {
     MC_ignore_heap(&(msg_global->sent_msg), sizeof(msg_global->sent_msg));
   }
 
-  if (simgrid::config::get_config<bool>("clean-atexit"))
+  if (simgrid::config::get_value<bool>("clean-atexit"))
     atexit(MSG_exit);
 }
 
index 664f838..3784c9b 100644 (file)
@@ -162,7 +162,7 @@ void SD_init_nocheck(int *argc, char **argv)
   surf_init(argc, argv);
 
   xbt_cfg_setdefault_string("host/model", "ptask_L07");
-  if (simgrid::config::get_config<bool>("clean-atexit"))
+  if (simgrid::config::get_value<bool>("clean-atexit"))
     atexit(SD_exit);
   if (_sg_cfg_exit_asap) {
     exit(0);
index 719f7d6..e5d27c3 100644 (file)
@@ -107,7 +107,7 @@ void SIMIX_context_mod_init()
 #endif
 
 #if HAVE_SMPI && (defined(__APPLE__) || defined(__NetBSD__))
-  std::string priv = simgrid::config::get_config<std::string>("smpi/privatization");
+  std::string priv = simgrid::config::get_value<std::string>("smpi/privatization");
   if (context_factory_name == "thread" && (priv == "dlopen" || priv == "yes" || priv == "default" || priv == "1")) {
     XBT_WARN("dlopen+thread broken on Apple and BSD. Switching to raw contexts.");
     context_factory_name = "raw";
@@ -115,7 +115,7 @@ void SIMIX_context_mod_init()
 #endif
 
 #if HAVE_SMPI && defined(__FreeBSD__)
-  if (context_factory_name == "thread" && simgrid::config::get_config<std::string>("smpi/privatization") != "no") {
+  if (context_factory_name == "thread" && simgrid::config::get_value<std::string>("smpi/privatization") != "no") {
     XBT_WARN("mmap broken on FreeBSD, but dlopen+thread broken too. Switching to dlopen+raw contexts.");
     context_factory_name = "raw";
   }
index 0d7fae6..37ebaba 100644 (file)
@@ -217,7 +217,7 @@ void SIMIX_global_init(int *argc, char **argv)
     });
   }
 
-  if (simgrid::config::get_config<bool>("clean-atexit"))
+  if (simgrid::config::get_value<bool>("clean-atexit"))
     atexit(SIMIX_clean);
 
   if (_sg_cfg_exit_asap)
index 2423713..e450b75 100644 (file)
@@ -26,7 +26,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi, "Logging specific to SMPI (coll
   }
 
 #define SET_COLL(coll)                                                                                                 \
-  name = simgrid::config::get_config<std::string>("smpi/" #coll);                                                      \
+  name = simgrid::config::get_value<std::string>("smpi/" #coll);                                                       \
   if (name.empty())                                                                                                    \
     name = selector_name;                                                                                              \
   set_##coll(name);
@@ -101,7 +101,7 @@ COLL_APPLY(COLL_SETTER,COLL_ALLTOALLV_SIG,"");
 
 
 void Colls::set_collectives(){
-  std::string selector_name = simgrid::config::get_config<std::string>("smpi/coll-selector");
+  std::string selector_name = simgrid::config::get_value<std::string>("smpi/coll-selector");
   if (selector_name.empty())
     selector_name = "default";
 
index 357b978..7ef8657 100644 (file)
@@ -97,21 +97,21 @@ SmpiHost::SmpiHost(simgrid::s4u::Host *ptr) : host(ptr)
   if (orecv_string != nullptr) {
     orecv_parsed_values = parse_factor(orecv_string);
   } else {
-    orecv_parsed_values = parse_factor(simgrid::config::get_config<std::string>("smpi/or"));
+    orecv_parsed_values = parse_factor(simgrid::config::get_value<std::string>("smpi/or"));
   }
 
   const char* osend_string = host->getProperty("smpi/os");
   if (osend_string != nullptr) {
     osend_parsed_values = parse_factor(osend_string);
   } else {
-    osend_parsed_values = parse_factor(simgrid::config::get_config<std::string>("smpi/os"));
+    osend_parsed_values = parse_factor(simgrid::config::get_value<std::string>("smpi/os"));
   }
 
   const char* oisend_string = host->getProperty("smpi/ois");
   if (oisend_string != nullptr) {
     oisend_parsed_values = parse_factor(oisend_string);
   } else {
-    oisend_parsed_values = parse_factor(simgrid::config::get_config<std::string>("smpi/ois"));
+    oisend_parsed_values = parse_factor(simgrid::config::get_value<std::string>("smpi/ois"));
   }
 }
 
index ac1a8eb..36b7004 100644 (file)
@@ -90,7 +90,7 @@ void smpi_bench_begin()
     return;
 
 #if HAVE_PAPI
-  if (not simgrid::config::get_config<std::string>("smpi/papi-events").empty()) {
+  if (not simgrid::config::get_value<std::string>("smpi/papi-events").empty()) {
     int event_set = smpi_process()->papi_event_set();
     // PAPI_start sets everything to 0! See man(3) PAPI_start
     if (PAPI_LOW_LEVEL_INITED == PAPI_is_initialized()) {
@@ -119,7 +119,7 @@ void smpi_bench_end()
    * An MPI function has been called and now is the right time to update
    * our PAPI counters for this process.
    */
-  if (simgrid::config::get_config<std::string>("smpi/papi-events")[0] != '\0') {
+  if (simgrid::config::get_value<std::string>("smpi/papi-events")[0] != '\0') {
     papi_counter_t& counter_data        = smpi_process()->papi_counters();
     int event_set                       = smpi_process()->papi_event_set();
     std::vector<long long> event_values = std::vector<long long>(counter_data.size());
@@ -143,7 +143,7 @@ void smpi_bench_end()
   }
 
   // Maybe we need to artificially speed up or slow down our computation based on our statistical analysis.
-  if (simgrid::config::get_config<std::string>("smpi/comp-adjustment-file")[0] != '\0') {
+  if (simgrid::config::get_value<std::string>("smpi/comp-adjustment-file")[0] != '\0') {
 
     smpi_trace_call_location_t* loc                            = smpi_process()->call_location();
     std::string key                                            = loc->get_composed_key();
@@ -154,12 +154,12 @@ void smpi_bench_end()
   }
 
   // Simulate the benchmarked computation unless disabled via command-line argument
-  if (simgrid::config::get_config<bool>("smpi/simulate-computation")) {
+  if (simgrid::config::get_value<bool>("smpi/simulate-computation")) {
     smpi_execute(xbt_os_timer_elapsed(timer)/speedup);
   }
 
 #if HAVE_PAPI
-  if (simgrid::config::get_config<std::string>("smpi/papi-events")[0] != '\0' && TRACE_smpi_is_enabled()) {
+  if (simgrid::config::get_value<std::string>("smpi/papi-events")[0] != '\0' && TRACE_smpi_is_enabled()) {
     container_t container =
         new simgrid::instr::Container(std::string("rank-") + std::to_string(simgrid::s4u::this_actor::get_pid()));
     papi_counter_t& counter_data = smpi_process()->papi_counters();
index 5d59dac..902237b 100644 (file)
@@ -218,8 +218,8 @@ static void smpi_check_options()
 {
   //check correctness of MPI parameters
 
-  xbt_assert(simgrid::config::get_config<int>("smpi/async-small-thresh") <=
-             simgrid::config::get_config<int>("smpi/send-is-detached-thresh"));
+  xbt_assert(simgrid::config::get_value<int>("smpi/async-small-thresh") <=
+             simgrid::config::get_value<int>("smpi/send-is-detached-thresh"));
 
   if (xbt_cfg_is_default_value("smpi/host-speed")) {
     XBT_INFO("You did not set the power of the host running the simulation.  "
@@ -228,7 +228,7 @@ static void smpi_check_options()
              "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information.");
   }
 
-  xbt_assert(simgrid::config::get_config<double>("smpi/cpu-threshold") >= 0,
+  xbt_assert(simgrid::config::get_value<double>("smpi/cpu-threshold") >= 0,
              "The 'smpi/cpu-threshold' option cannot have negative values [anymore]. If you want to discard "
              "the simulation of any computation, please use 'smpi/simulate-computation:no' instead.");
 }
@@ -244,7 +244,7 @@ void smpi_global_init()
     xbt_os_walltimer_start(global_timer);
   }
 
-  std::string filename = simgrid::config::get_config<std::string>("smpi/comp-adjustment-file");
+  std::string filename = simgrid::config::get_value<std::string>("smpi/comp-adjustment-file");
   if (not filename.empty()) {
     std::ifstream fstream(filename);
     if (not fstream.is_open()) {
@@ -271,7 +271,7 @@ void smpi_global_init()
   // and the (computed) event_set.
   std::map</* computation unit name */ std::string, papi_process_data> units2papi_setup;
 
-  if (not simgrid::config::get_config<std::string>("smpi/papi-events").empty()) {
+  if (not simgrid::config::get_value<std::string>("smpi/papi-events").empty()) {
     if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
       XBT_ERROR("Could not initialize PAPI library; is it correctly installed and linked?"
                 " Expected version is %i",
@@ -279,7 +279,7 @@ void smpi_global_init()
 
     typedef boost::tokenizer<boost::char_separator<char>> Tokenizer;
     boost::char_separator<char> separator_units(";");
-    std::string str = simgrid::config::get_config<std::string>("smpi/papi-events");
+    std::string str = simgrid::config::get_value<std::string>("smpi/papi-events");
     Tokenizer tokens(str, separator_units);
 
     // Iterate over all the computational units. This could be processes, hosts, threads, ranks... You name it.
@@ -360,10 +360,10 @@ static void smpi_init_options(){
     return;
   simgrid::smpi::Colls::set_collectives();
   simgrid::smpi::Colls::smpi_coll_cleanup_callback = nullptr;
-  smpi_cpu_threshold                               = simgrid::config::get_config<double>("smpi/cpu-threshold");
-  smpi_host_speed                                  = simgrid::config::get_config<double>("smpi/host-speed");
+  smpi_cpu_threshold                               = simgrid::config::get_value<double>("smpi/cpu-threshold");
+  smpi_host_speed                                  = simgrid::config::get_value<double>("smpi/host-speed");
   xbt_assert(smpi_host_speed >= 0, "You're trying to set the host_speed to a negative value (%f)", smpi_host_speed);
-  std::string smpi_privatize_option = simgrid::config::get_config<std::string>("smpi/privatization");
+  std::string smpi_privatize_option = simgrid::config::get_value<std::string>("smpi/privatization");
   if (smpi_privatize_option == "no" || smpi_privatize_option == "0")
     smpi_privatize_global_variables = SmpiPrivStrategies::None;
   else if (smpi_privatize_option == "yes" || smpi_privatize_option == "1")
@@ -389,7 +389,7 @@ static void smpi_init_options(){
     if (smpi_cpu_threshold < 0)
       smpi_cpu_threshold = DBL_MAX;
 
-    std::string val = simgrid::config::get_config<std::string>("smpi/shared-malloc");
+    std::string val = simgrid::config::get_value<std::string>("smpi/shared-malloc");
     if ((val == "yes") || (val == "1") || (val == "on") || (val == "global")) {
       smpi_cfg_shared_malloc = shmalloc_global;
     } else if (val == "local") {
@@ -529,7 +529,7 @@ int smpi_main(const char* executable, int argc, char *argv[])
         // Load the copy and resolve the entry point:
         void* handle = dlopen(target_executable.c_str(), RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND);
         int saved_errno = errno;
-        if (simgrid::config::get_config<bool>("smpi/keep-temps") == false)
+        if (simgrid::config::get_value<bool>("smpi/keep-temps") == false)
           unlink(target_executable.c_str());
         if (handle == nullptr)
           xbt_die("dlopen failed: %s (errno: %d -- %s)", dlerror(), saved_errno, strerror(saved_errno));
@@ -581,7 +581,7 @@ int smpi_main(const char* executable, int argc, char *argv[])
     SIMIX_run();
 
     xbt_os_walltimer_stop(global_timer);
-    if (simgrid::config::get_config<bool>("smpi/display-timing")) {
+    if (simgrid::config::get_value<bool>("smpi/display-timing")) {
       double global_time = xbt_os_timer_elapsed(global_timer);
       XBT_INFO("Simulated time: %g seconds. \n\n"
           "The simulation took %g seconds (after parsing and platform setup)\n"
index 4f9ac07..72a8888 100644 (file)
@@ -30,7 +30,7 @@ Process::Process(ActorPtr actor, msg_bar_t finalization_barrier)
     MC_ignore_heap(timer_, xbt_os_timer_size());
 
 #if HAVE_PAPI
-  if (simgrid::config::get_config<std::string>("smpi/papi-events")[0] != '\0') {
+  if (simgrid::config::get_value<std::string>("smpi/papi-events")[0] != '\0') {
     // TODO: Implement host/process/thread based counters. This implementation
     // just always takes the values passed via "default", like this:
     // "default:COUNTER1:COUNTER2:COUNTER3;".
index d3f6899..446cb08 100644 (file)
@@ -193,14 +193,14 @@ static void *smpi_shared_malloc_local(size_t size, const char *file, int line)
 
 void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int nb_shared_blocks)
 {
-  std::string huge_page_mount_point = simgrid::config::get_config<std::string>("smpi/shared-malloc-hugepage");
+  std::string huge_page_mount_point = simgrid::config::get_value<std::string>("smpi/shared-malloc-hugepage");
   bool use_huge_page                = not huge_page_mount_point.empty();
 #ifndef MAP_HUGETLB /* If the system header don't define that mmap flag */
   xbt_assert(not use_huge_page,
              "Huge pages are not available on your system, you cannot use the smpi/shared-malloc-hugepage option.");
 #endif
   smpi_shared_malloc_blocksize =
-      static_cast<unsigned long>(simgrid::config::get_config<double>("smpi/shared-malloc-blocksize"));
+      static_cast<unsigned long>(simgrid::config::get_value<double>("smpi/shared-malloc-blocksize"));
   void* mem;
   size_t allocated_size;
   if(use_huge_page) {
index ad1a0ce..caee571 100644 (file)
@@ -358,7 +358,7 @@ void Request::start()
 
     simgrid::smpi::Process* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
 
-    int async_small_thresh = simgrid::config::get_config<int>("smpi/async-small-thresh");
+    int async_small_thresh = simgrid::config::get_value<int>("smpi/async-small-thresh");
 
     xbt_mutex_t mut = process->mailboxes_mutex();
     if (async_small_thresh != 0 || (flags_ & RMA) != 0)
@@ -418,7 +418,7 @@ void Request::start()
     void* buf = buf_;
     if ((flags_ & SSEND) == 0 &&
         ((flags_ & RMA) != 0 ||
-         static_cast<int>(size_) < simgrid::config::get_config<int>("smpi/send-is-detached-thresh"))) {
+         static_cast<int>(size_) < simgrid::config::get_value<int>("smpi/send-is-detached-thresh"))) {
       void *oldbuf = nullptr;
       detached_ = 1;
       XBT_DEBUG("Send request %p is detached", this);
@@ -453,7 +453,7 @@ void Request::start()
       XBT_DEBUG("sending size of %zu : sleep %f ", size_, sleeptime);
     }
 
-    int async_small_thresh = simgrid::config::get_config<int>("smpi/async-small-thresh");
+    int async_small_thresh = simgrid::config::get_value<int>("smpi/async-small-thresh");
 
     xbt_mutex_t mut=process->mailboxes_mutex();
 
@@ -548,7 +548,7 @@ int Request::test(MPI_Request * request, MPI_Status * status) {
       nsleeps=1;//reset the number of sleeps we will do next time
       if (*request != MPI_REQUEST_NULL && ((*request)->flags_ & PERSISTENT) == 0)
         *request = MPI_REQUEST_NULL;
-    } else if (simgrid::config::get_config<bool>("smpi/grow-injected-times")) {
+    } else if (simgrid::config::get_value<bool>("smpi/grow-injected-times")) {
       nsleeps++;
     }
   }
@@ -668,7 +668,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   // This can speed up the execution of certain applications by an order of magnitude, such as HPL
   static int nsleeps = 1;
   double speed        = simgrid::s4u::Actor::self()->get_host()->getSpeed();
-  double maxrate      = simgrid::config::get_config<double>("smpi/iprobe-cpu-usage");
+  double maxrate      = simgrid::config::get_value<double>("smpi/iprobe-cpu-usage");
   MPI_Request request = new Request(nullptr, 0, MPI_CHAR,
                                     source == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->actor(source)->get_pid(),
                                     simgrid::s4u::this_actor::get_pid(), tag, comm, PERSISTENT | RECV);
@@ -683,7 +683,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
 
   request->print_request("New iprobe");
   // We have to test both mailboxes as we don't know if we will receive one one or another
-  if (simgrid::config::get_config<int>("smpi/async-small-thresh") > 0) {
+  if (simgrid::config::get_value<int>("smpi/async-small-thresh") > 0) {
     mailbox = smpi_process()->mailbox_small();
     XBT_DEBUG("Trying to probe the perm recv mailbox");
     request->action_ = simcall_comm_iprobe(mailbox, 0, &match_recv, static_cast<void*>(request));
@@ -710,7 +710,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   }
   else {
     *flag = 0;
-    if (simgrid::config::get_config<bool>("smpi/grow-injected-times"))
+    if (simgrid::config::get_value<bool>("smpi/grow-injected-times"))
       nsleeps++;
   }
   unref(&request);
index 2f9fe9d..315520c 100644 (file)
@@ -60,7 +60,7 @@ namespace surf {
 
 CpuCas01Model::CpuCas01Model(kernel::resource::Model::UpdateAlgo algo) : simgrid::surf::CpuModel(algo)
 {
-  bool select = simgrid::config::get_config<bool>("cpu/maxmin-selective-update");
+  bool select = simgrid::config::get_value<bool>("cpu/maxmin-selective-update");
 
   if (algo == Model::UpdateAlgo::Lazy) {
     xbt_assert(select || xbt_cfg_is_default_value("cpu/maxmin-selective-update"),
index 727ccce..02ea9ec 100644 (file)
@@ -132,11 +132,11 @@ namespace kernel {
 namespace resource {
 
 NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(bool))
-    : NetworkModel(simgrid::config::get_config<std::string>("network/optim") == "Full" ? Model::UpdateAlgo::Full
-                                                                                       : Model::UpdateAlgo::Lazy)
+    : NetworkModel(simgrid::config::get_value<std::string>("network/optim") == "Full" ? Model::UpdateAlgo::Full
+                                                                                      : Model::UpdateAlgo::Lazy)
 {
-  std::string optim = simgrid::config::get_config<std::string>("network/optim");
-  bool select       = simgrid::config::get_config<bool>("network/maxmin-selective-update");
+  std::string optim = simgrid::config::get_value<std::string>("network/optim");
+  bool select       = simgrid::config::get_value<bool>("network/maxmin-selective-update");
 
   if (optim == "Lazy") {
     xbt_assert(select || xbt_cfg_is_default_value("network/maxmin-selective-update"),
index 14bf482..f9599b6 100644 (file)
@@ -103,7 +103,7 @@ namespace resource {
 
 NetworkIBModel::NetworkIBModel() : NetworkSmpiModel()
 {
-  std::string IB_factors_string = simgrid::config::get_config<std::string>("smpi/IB-penalty-factors");
+  std::string IB_factors_string = simgrid::config::get_value<std::string>("smpi/IB-penalty-factors");
   std::vector<std::string> radical_elements;
   boost::split(radical_elements, IB_factors_string, boost::is_any_of(";"));
 
index 1531bc0..0f089bc 100644 (file)
@@ -52,7 +52,7 @@ NetworkSmpiModel::~NetworkSmpiModel() = default;
 double NetworkSmpiModel::bandwidthFactor(double size)
 {
   if (smpi_bw_factor.empty())
-    smpi_bw_factor = parse_factor(simgrid::config::get_config<std::string>("smpi/bw-factor"));
+    smpi_bw_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/bw-factor"));
 
   double current = 1.0;
   for (auto const& fact : smpi_bw_factor) {
@@ -70,7 +70,7 @@ double NetworkSmpiModel::bandwidthFactor(double size)
 double NetworkSmpiModel::latencyFactor(double size)
 {
   if (smpi_lat_factor.empty())
-    smpi_lat_factor = parse_factor(simgrid::config::get_config<std::string>("smpi/lat-factor"));
+    smpi_lat_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/lat-factor"));
 
   double current = 1.0;
   for (auto const& fact : smpi_lat_factor) {
index e9d98bc..b926248 100644 (file)
@@ -42,7 +42,7 @@ public:
   void init()
   {
     const char* local_sampling_rate_config = host_->getProperty(property_sampling_rate);
-    double global_sampling_rate_config     = simgrid::config::get_config<double>(property_sampling_rate);
+    double global_sampling_rate_config     = simgrid::config::get_value<double>(property_sampling_rate);
     if (local_sampling_rate_config != nullptr) {
       sampling_rate = std::stod(local_sampling_rate_config);
     } else {
@@ -245,7 +245,7 @@ static void on_host_added(simgrid::s4u::Host& host)
       dvfs_governor = std::string(daemon_proc->get_host()->getProperty(property_governor));
       boost::algorithm::to_lower(dvfs_governor);
     } else {
-      dvfs_governor = simgrid::config::get_config<std::string>(property_governor);
+      dvfs_governor = simgrid::config::get_value<std::string>(property_governor);
       boost::algorithm::to_lower(dvfs_governor);
     }
 
index ef5d72b..46081c4 100644 (file)
@@ -500,10 +500,10 @@ void sg_platf_end() {
 /* Pick the right models for CPU, net and host, and call their model_init_preparse */
 static void surf_config_models_setup()
 {
-  std::string host_model_name    = simgrid::config::get_config<std::string>("host/model");
-  std::string network_model_name = simgrid::config::get_config<std::string>("network/model");
-  std::string cpu_model_name     = simgrid::config::get_config<std::string>("cpu/model");
-  std::string storage_model_name = simgrid::config::get_config<std::string>("storage/model");
+  std::string host_model_name    = simgrid::config::get_value<std::string>("host/model");
+  std::string network_model_name = simgrid::config::get_value<std::string>("network/model");
+  std::string cpu_model_name     = simgrid::config::get_value<std::string>("cpu/model");
+  std::string storage_model_name = simgrid::config::get_value<std::string>("storage/model");
 
   /* The compound host model is needed when using non-default net/cpu models */
   if ((not xbt_cfg_is_default_value("network/model") || not xbt_cfg_is_default_value("cpu/model")) &&
index 84c6b7b..19673d9 100644 (file)
@@ -366,17 +366,17 @@ void Config::help()
   }
 }
 
-// ***** get_config *****
+// ***** get_value *****
 
-template <class T> XBT_PUBLIC T const& get_config(const char* name)
+template <class T> XBT_PUBLIC T const& get_value(const char* name)
 {
   return (*simgrid_config)[name].get_value<T>();
 }
 
-template XBT_PUBLIC int const& get_config<int>(const char* name);
-template XBT_PUBLIC double const& get_config<double>(const char* name);
-template XBT_PUBLIC bool const& get_config<bool>(const char* name);
-template XBT_PUBLIC std::string const& get_config<std::string>(const char* name);
+template XBT_PUBLIC int const& get_value<int>(const char* name);
+template XBT_PUBLIC double const& get_value<double>(const char* name);
+template XBT_PUBLIC bool const& get_value<bool>(const char* name);
+template XBT_PUBLIC std::string const& get_value<std::string>(const char* name);
 
 // ***** alias *****
 
@@ -707,7 +707,7 @@ XBT_TEST_UNIT("use", test_config_use, "Data retrieving tests")
   {
     /* get_single_value */
     xbt_cfg_set_parse("peername:toto:42 speed:42");
-    int ival = simgrid::config::get_config<int>("speed");
+    int ival = simgrid::config::get_value<int>("speed");
     if (ival != 42)
       xbt_test_fail("Speed value = %d, I expected 42", ival);
   }
index dd9a146..dd91449 100644 (file)
@@ -45,7 +45,7 @@ void logException(
       XBT_LOG(prio, "%s %s: %s", context, name.get(), exception.what());
 
     // Do we have a backtrace?
-    if (with_context != nullptr && not simgrid::config::get_config<bool>("exception/cutpath")) {
+    if (with_context != nullptr && not simgrid::config::get_value<bool>("exception/cutpath")) {
       auto backtrace = simgrid::xbt::resolveBacktrace(
         with_context->backtrace().data(), with_context->backtrace().size());
       for (std::string const& s : backtrace)
@@ -74,7 +74,7 @@ void logException(
 
 static void showBacktrace(std::vector<xbt_backtrace_location_t>& bt)
 {
-  if (simgrid::config::get_config<bool>("exception/cutpath")) {
+  if (simgrid::config::get_value<bool>("exception/cutpath")) {
     XBT_LOG(xbt_log_priority_critical, "Display of current backtrace disabled by --cfg=exception/cutpath.");
     return;
   }