void xbt_cfg_setdefault_string(const char* name, const char* val);
/** @brief Return if configuration is set by default*/
-XBT_PUBLIC int xbt_cfg_is_default_value(const char* name);
+XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::is_default") XBT_PUBLIC
+ int xbt_cfg_is_default_value(const char* name);
/* @} */
extern template XBT_PUBLIC void set_default<bool>(const char* name, bool value);
extern template XBT_PUBLIC void set_default<std::string>(const char* name, std::string value);
+XBT_PUBLIC bool is_default(const char* name);
+
// Set config
template <class T> XBT_PUBLIC void set_value(const char* name, T value);
{
xbt_assert(simix_global->context_factory == nullptr);
- smx_context_stack_size_was_set = not xbt_cfg_is_default_value("contexts/stack-size");
- smx_context_guard_size_was_set = not xbt_cfg_is_default_value("contexts/guard-size");
+ smx_context_stack_size_was_set = not simgrid::config::is_default("contexts/stack-size");
+ smx_context_guard_size_was_set = not simgrid::config::is_default("contexts/guard-size");
#if HAVE_THREAD_CONTEXTS && not HAVE_THREAD_LOCAL_STORAGE
/* the __thread storage class is not available on this platform:
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")) {
+ if (simgrid::config::is_default("smpi/host-speed")) {
XBT_INFO("You did not set the power of the host running the simulation. "
"The timings will certainly not be accurate. "
"Use the option \"--cfg=smpi/host-speed:<flops>\" to set its value."
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"),
+ xbt_assert(select || simgrid::config::is_default("cpu/maxmin-selective-update"),
"You cannot disable cpu selective update when using the lazy update mechanism");
select = true;
}
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"),
+ xbt_assert(select || simgrid::config::is_default("network/maxmin-selective-update"),
"You cannot disable network selective update when using the lazy update mechanism");
select = true;
}
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")) &&
- xbt_cfg_is_default_value("host/model")) {
+ if ((not simgrid::config::is_default("network/model") || not simgrid::config::is_default("cpu/model")) &&
+ simgrid::config::is_default("host/model")) {
host_model_name = "compound";
simgrid::config::set_value("host/model", host_model_name);
}
void ETag_surfxml_config()
{
for (auto const& elm : *current_property_set) {
- if (xbt_cfg_is_default_value(elm.first.c_str())) {
+ if (simgrid::config::is_default(elm.first.c_str())) {
std::string cfg = elm.first + ":" + elm.second;
xbt_cfg_set_parse(cfg.c_str());
} else
template XBT_PUBLIC void set_default<bool>(const char* name, bool value);
template XBT_PUBLIC void set_default<std::string>(const char* name, std::string value);
+bool is_default(const char* name)
+{
+ return (*simgrid_config)[name].is_default();
+}
+
// ***** set_value *****
template <class T> XBT_PUBLIC void set_value(const char* name, T value)