From 4f80adb3e995a6099ac4ca3da1fe02d23ecb2eb3 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 19 Apr 2018 12:58:51 +0200 Subject: [PATCH] Change xbt_cfg_get_double -> simgrid::config::get_config. --- src/smpi/internals/smpi_global.cpp | 6 +++--- src/smpi/internals/smpi_shared.cpp | 3 ++- src/smpi/mpi/smpi_request.cpp | 2 +- src/surf/plugins/host_dvfs.cpp | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index f2a5b48c51..6e379ab8dd 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -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(xbt_cfg_get_double("smpi/cpu-threshold") >= 0, + xbt_assert(simgrid::config::get_config("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."); } @@ -360,8 +360,8 @@ static void smpi_init_options(){ return; simgrid::smpi::Colls::set_collectives(); simgrid::smpi::Colls::smpi_coll_cleanup_callback = nullptr; - smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu-threshold"); - smpi_host_speed = xbt_cfg_get_double("smpi/host-speed"); + smpi_cpu_threshold = simgrid::config::get_config("smpi/cpu-threshold"); + smpi_host_speed = simgrid::config::get_config("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 = xbt_cfg_get_string("smpi/privatization"); if (smpi_privatize_option == "no" || smpi_privatize_option == "0") diff --git a/src/smpi/internals/smpi_shared.cpp b/src/smpi/internals/smpi_shared.cpp index bc42b781a3..358a78a5a2 100644 --- a/src/smpi/internals/smpi_shared.cpp +++ b/src/smpi/internals/smpi_shared.cpp @@ -199,7 +199,8 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int 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(xbt_cfg_get_double("smpi/shared-malloc-blocksize")); + smpi_shared_malloc_blocksize = + static_cast(simgrid::config::get_config("smpi/shared-malloc-blocksize")); void* mem; size_t allocated_size; if(use_huge_page) { diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index 3b4f02d013..ad1a0cefc8 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -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 = xbt_cfg_get_double("smpi/iprobe-cpu-usage"); + double maxrate = simgrid::config::get_config("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); diff --git a/src/surf/plugins/host_dvfs.cpp b/src/surf/plugins/host_dvfs.cpp index d141f54b3e..993a39710e 100644 --- a/src/surf/plugins/host_dvfs.cpp +++ b/src/surf/plugins/host_dvfs.cpp @@ -42,7 +42,7 @@ public: void init() { const char* local_sampling_rate_config = host_->getProperty(property_sampling_rate); - double global_sampling_rate_config = xbt_cfg_get_double(property_sampling_rate); + double global_sampling_rate_config = simgrid::config::get_config(property_sampling_rate); if (local_sampling_rate_config != nullptr) { sampling_rate = std::stod(local_sampling_rate_config); } else { -- 2.20.1