X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cd4a6bff769c06de3840b08926eccf0734642f57..0e886d5f40a337fb0746a86df15ede0e871fe7f9:/src/smpi/internals/smpi_config.cpp diff --git a/src/smpi/internals/smpi_config.cpp b/src/smpi/internals/smpi_config.cpp index a79eaed1c8..acd32c6b97 100644 --- a/src/smpi/internals/smpi_config.cpp +++ b/src/smpi/internals/smpi_config.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2008-2022. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -7,6 +7,7 @@ #include "mc/mc.h" #include "private.hpp" #include "smpi_coll.hpp" +#include "xbt/ex.h" #include "xbt/parse_units.hpp" #include /* DBL_MAX */ @@ -40,26 +41,26 @@ simgrid::config::Flag _smpi_cfg_host_speed_string{ [](const std::string& str) { _smpi_cfg_host_speed = xbt_parse_get_speed("smpi/host-speed", 1, str, "option smpi/host-speed"); xbt_assert(_smpi_cfg_host_speed > 0.0, "Invalid value (%s) for 'smpi/host-speed': it must be positive.", - _smpi_cfg_host_speed_string.get().c_str()); + str.c_str()); }}; simgrid::config::Flag _smpi_cfg_simulate_computation{ "smpi/simulate-computation", "Whether the computational part of the simulated application should be simulated.", true}; simgrid::config::Flag _smpi_cfg_shared_malloc_string{ - "smpi/shared-malloc", "Whether SMPI_SHARED_MALLOC is enabled. Disable it for debugging purposes.", "global", - [](const std::string& val) { - if ((val == "yes") || (val == "1") || (val == "on") || (val == "global")) { - _smpi_cfg_shared_malloc = SharedMallocType::GLOBAL; - } else if (val == "local") { - _smpi_cfg_shared_malloc = SharedMallocType::LOCAL; - } else if ((val == "no") || (val == "0") || (val == "off")) { - _smpi_cfg_shared_malloc = SharedMallocType::NONE; - } else { - xbt_die("Invalid value '%s' for option smpi/shared-malloc. Possible values: 'on' or 'global', 'local', 'off'", - val.c_str()); - } - } }; + "smpi/shared-malloc", "Whether SMPI_SHARED_MALLOC is enabled. Disable it for debugging purposes.", "global", + [](const std::string& val) { + if ((val == "yes") || (val == "1") || (val == "on") || (val == "global")) { + _smpi_cfg_shared_malloc = SharedMallocType::GLOBAL; + } else if (val == "local") { + _smpi_cfg_shared_malloc = SharedMallocType::LOCAL; + } else if ((val == "no") || (val == "0") || (val == "off")) { + _smpi_cfg_shared_malloc = SharedMallocType::NONE; + } else { + xbt_die("Invalid value '%s' for option smpi/shared-malloc. Possible values: 'on' or 'global', 'local', 'off'", + val.c_str()); + } + }}; simgrid::config::Flag _smpi_cfg_cpu_threshold{ "smpi/cpu-threshold", "Minimal computation time (in seconds) not discarded, or -1 for infinity.", 1e-6, @@ -71,9 +72,9 @@ simgrid::config::Flag _smpi_cfg_cpu_threshold{ simgrid::config::Flag _smpi_cfg_async_small_thresh{"smpi/async-small-thresh", "Maximal size of messages that are to be sent asynchronously, without waiting for the receiver", 0}; -simgrid::config::Flag _smpi_cfg_detached_send_thresh{"smpi/send-is-detached-thresh", - "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend", - 65536}; +simgrid::config::Flag _smpi_cfg_detached_send_thresh{ + "smpi/send-is-detached-thresh", + "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend", 65536}; simgrid::config::Flag _smpi_cfg_grow_injected_times{"smpi/grow-injected-times", "Whether we want to make the injected time in MPI_Iprobe and MPI_Test grow, to " "allow faster simulation. This can make simulation less precise, though.", @@ -88,9 +89,9 @@ simgrid::config::Flag _smpi_cfg_trace_call_location{"smpi/trace-call-loca "Should filename and linenumber of MPI calls be traced?", false}; simgrid::config::Flag _smpi_cfg_trace_call_use_absolute_path{"smpi/trace-call-use-absolute-path", "Should filenames for trace-call tracing be absolute or not?", false}; -simgrid::config::Flag _smpi_cfg_comp_adjustment_file{"smpi/comp-adjustment-file", - "A file containing speedups or slowdowns for some parts of the code.", - "", [](const std::string& filename){ +simgrid::config::Flag _smpi_cfg_comp_adjustment_file{ + "smpi/comp-adjustment-file", "A file containing speedups or slowdowns for some parts of the code.", "", + [](const std::string& filename) { if (not filename.empty()) { std::ifstream fstream(filename); xbt_assert(fstream.is_open(), "Could not open file %s. Does it exist?", filename.c_str()); @@ -99,11 +100,11 @@ simgrid::config::Flag _smpi_cfg_comp_adjustment_file{"smpi/comp-adj std::getline(fstream, line); // Skip the header line while (std::getline(fstream, line)) { Tokenizer tok(line); - Tokenizer::iterator it = tok.begin(); - Tokenizer::iterator end = std::next(tok.begin()); + auto it = tok.begin(); + auto end = std::next(tok.begin()); std::string location = *it; boost::trim(location); - location2speedup.insert(std::pair(location, std::stod(*end))); + location2speedup.try_emplace(location, std::stod(*end)); } } }}; @@ -111,7 +112,7 @@ simgrid::config::Flag _smpi_cfg_comp_adjustment_file{"smpi/comp-adj simgrid::config::Flag _smpi_cfg_default_errhandler_is_error{ "smpi/errors-are-fatal", "Whether MPI errors are fatal or just return. Default is true", true }; simgrid::config::Flag _smpi_cfg_pedantic{ - "smpi/pedantic", "Activate extra checks that may crash slightly incorrect codes which would not crash on actual implementations", true }; + "smpi/pedantic", "Activate extra checks that may crash slightly incorrect codes which would not crash on actual implementations", false }; simgrid::config::Flag _smpi_init_sleep( "smpi/init", "Time to inject inside a call to MPI_Init", 0.0); #if HAVE_PAPI @@ -253,16 +254,16 @@ void smpi_init_options_internal(bool called_by_smpi_main) } }); - simgrid::config::declare_flag("smpi/privatize-libs", - "Add libraries (; separated) to privatize (libgfortran for example)." - "You need to provide the full names of the files (libgfortran.so.4), or its full path", - ""); + simgrid::config::declare_flag( + "smpi/privatize-libs", + "Add libraries (; separated) to privatize (libgfortran for example)." + "You need to provide the full names of the files (libgfortran.so.4), or its full path", + ""); simgrid::config::declare_flag("smpi/shared-malloc-blocksize", - "Size of the bogus file which will be created for global shared allocations", + "Size of the bogus file which will be created for global shared allocations", 1UL << 20); simgrid::config::declare_flag("smpi/shared-malloc-hugepage", - "Path to a mounted hugetlbfs, to use huge pages with shared malloc.", - ""); + "Path to a mounted hugetlbfs, to use huge pages with shared malloc.", ""); simgrid::config::declare_flag( "smpi/os", "Small messages timings (MPI_Send minimum time for small messages)", "0:0:0:0:0");