/* 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"
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
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);
/* 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"
: 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;
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
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...
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);
}
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);
});
}
- if (xbt_cfg_get_boolean("clean-atexit"))
+ if (simgrid::config::get_config<bool>("clean-atexit"))
atexit(SIMIX_clean);
if (_sg_cfg_exit_asap)
}
// 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);
}
// 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));
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"
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++;
}
}
}
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);
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"),
: 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"),
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)
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;
}