Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change xbt_cfg_get_bool -> simgrid::config::get_config<bool>.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 19 Apr 2018 10:53:13 +0000 (12:53 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 19 Apr 2018 14:06:43 +0000 (16:06 +0200)
12 files changed:
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_global.cpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/mpi/smpi_request.cpp
src/surf/cpu_cas01.cpp
src/surf/network_cm02.cpp
src/xbt/exception.cpp

index 23f44b3..f509556 100644 (file)
@@ -3,6 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <xbt/config.hpp>
+
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/instr/instr_private.hpp"
@@ -164,7 +166,7 @@ void Container::logCreation()
       prefix = xbt_os_time();
     }
 
-    if (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
+    if (not simgrid::config::get_config<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
@@ -195,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 xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || tracing_files.size() == 1) {
+    if (not simgrid::config::get_config<bool>("tracing/smpi/format/ti-one-file") || tracing_files.size() == 1) {
       fclose(tracing_files.at(this));
     }
     tracing_files.erase(this);
index 4aacda9..a9abe0e 100644 (file)
@@ -3,6 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <xbt/config.hpp>
+
 #include "src/instr/instr_private.hpp"
 #include "src/instr/instr_smpi.hpp"
 #include "src/smpi/include/private.hpp"
@@ -30,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 (xbt_cfg_get_boolean("smpi/trace-call-location")) {
+  if (simgrid::config::get_config<bool>("smpi/trace-call-location")) {
     smpi_trace_call_location_t* loc = smpi_trace_get_call_location();
     filename                        = loc->filename;
     linenumber                      = loc->linenumber;
@@ -85,7 +87,7 @@ void StateEvent::print()
       stream_ << " " << ((extra_ != nullptr) ? extra_->display_size() : 0);
 
 #if HAVE_SMPI
-    if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
+    if (simgrid::config::get_config<bool>("smpi/trace-call-location")) {
       stream_ << " \"" << filename << "\" " << linenumber;
     }
 #endif
index f638de9..b7f4229 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 (xbt_cfg_get_boolean("smpi/trace-call-location")) {
+  if (simgrid::config::get_config<bool>("smpi/trace-call-location")) {
     /**
      * paje currently (May 2016) uses "Filename" and "Linenumber" as
      * reserved words. We cannot use them...
index 06c387f..52ee291 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 (xbt_cfg_get_boolean("clean-atexit"))
+  if (simgrid::config::get_config<bool>("clean-atexit"))
     atexit(MSG_exit);
 }
 
index 7bcdaf7..664f838 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(xbt_cfg_get_boolean("clean-atexit"))
+  if (simgrid::config::get_config<bool>("clean-atexit"))
     atexit(SD_exit);
   if (_sg_cfg_exit_asap) {
     exit(0);
index 386d94c..0d7fae6 100644 (file)
@@ -217,7 +217,7 @@ void SIMIX_global_init(int *argc, char **argv)
     });
   }
 
-  if (xbt_cfg_get_boolean("clean-atexit"))
+  if (simgrid::config::get_config<bool>("clean-atexit"))
     atexit(SIMIX_clean);
 
   if (_sg_cfg_exit_asap)
index 33d32ef..fcd8453 100644 (file)
@@ -154,7 +154,7 @@ void smpi_bench_end()
   }
 
   // Simulate the benchmarked computation unless disabled via command-line argument
-  if (xbt_cfg_get_boolean("smpi/simulate-computation")) {
+  if (simgrid::config::get_config<bool>("smpi/simulate-computation")) {
     smpi_execute(xbt_os_timer_elapsed(timer)/speedup);
   }
 
index edbbf71..5ff6ac3 100644 (file)
@@ -527,7 +527,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 (xbt_cfg_get_boolean("smpi/keep-temps") == false)
+        if (simgrid::config::get_config<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));
@@ -579,7 +579,7 @@ int smpi_main(const char* executable, int argc, char *argv[])
     SIMIX_run();
 
     xbt_os_walltimer_stop(global_timer);
-    if (xbt_cfg_get_boolean("smpi/display-timing")){
+    if (simgrid::config::get_config<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 7aa1dfd..ca851d7 100644 (file)
@@ -547,7 +547,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 (xbt_cfg_get_boolean("smpi/grow-injected-times")){
+    } else if (simgrid::config::get_config<bool>("smpi/grow-injected-times")) {
       nsleeps++;
     }
   }
@@ -709,7 +709,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   }
   else {
     *flag = 0;
-    if (xbt_cfg_get_boolean("smpi/grow-injected-times"))
+    if (simgrid::config::get_config<bool>("smpi/grow-injected-times"))
       nsleeps++;
   }
   unref(&request);
index 2ffe199..2f9fe9d 100644 (file)
@@ -60,7 +60,7 @@ namespace surf {
 
 CpuCas01Model::CpuCas01Model(kernel::resource::Model::UpdateAlgo algo) : simgrid::surf::CpuModel(algo)
 {
-  bool select = xbt_cfg_get_boolean("cpu/maxmin-selective-update");
+  bool select = simgrid::config::get_config<bool>("cpu/maxmin-selective-update");
 
   if (algo == Model::UpdateAlgo::Lazy) {
     xbt_assert(select || xbt_cfg_is_default_value("cpu/maxmin-selective-update"),
index f7f4a84..ccd09c7 100644 (file)
@@ -135,7 +135,7 @@ NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(b
     : NetworkModel(xbt_cfg_get_string("network/optim") == "Full" ? Model::UpdateAlgo::Full : Model::UpdateAlgo::Lazy)
 {
   std::string optim = xbt_cfg_get_string("network/optim");
-  bool select = xbt_cfg_get_boolean("network/maxmin-selective-update");
+  bool select       = simgrid::config::get_config<bool>("network/maxmin-selective-update");
 
   if (optim == "Lazy") {
     xbt_assert(select || xbt_cfg_is_default_value("network/maxmin-selective-update"),
index 0b6b899..dd9a146 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 xbt_cfg_get_boolean("exception/cutpath")) {
+    if (with_context != nullptr && not simgrid::config::get_config<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 (xbt_cfg_get_boolean("exception/cutpath")) {
+  if (simgrid::config::get_config<bool>("exception/cutpath")) {
     XBT_LOG(xbt_log_priority_critical, "Display of current backtrace disabled by --cfg=exception/cutpath.");
     return;
   }