This will allow to merge them with their smpi counterparts.
double NetworkModel::cfg_latency_factor = 1.0; // default value
double NetworkModel::cfg_bandwidth_factor = 1.0; // default value
+static config::Flag<std::string> cfg_latency_factor_str(
+ "network/latency-factor",
+ "Correction factor to apply to the provided latency (default value overridden by network model)", "1.0",
+ [](std::string str) {
+ NetworkModel::cfg_latency_factor =
+ xbt_str_parse_double(str.c_str(), "The value of 'network/latency-factor' is not a double");
+ });
+static config::Flag<std::string> cfg_bandwidth_factor_str(
+ "network/bandwidth-factor",
+ "Correction factor to apply to the provided bandwidth (default value overridden by network model)", "1.0",
+ [](std::string str) {
+ NetworkModel::cfg_bandwidth_factor =
+ xbt_str_parse_double(str.c_str(), "The value of 'network/bandwidth-factor' is not a double");
+ });
+
/** @brief Command-line option 'network/TCP-gamma' -- see @ref options_model_network_gamma */
config::Flag<double> NetworkModel::cfg_tcp_gamma(
"network/TCP-gamma",
"processes on each host, at higher level. (default: -1 means no such limitation)");
/* The parameters of network models */
-
- simgrid::config::bind_flag(simgrid::kernel::resource::NetworkModel::cfg_latency_factor, "network/latency-factor",
- "Correction factor to apply to the provided latency (default value set by network model)");
-
- simgrid::config::bind_flag(
- simgrid::kernel::resource::NetworkModel::cfg_bandwidth_factor, "network/bandwidth-factor",
- "Correction factor to apply to the provided bandwidth (default value set by network model)");
-
static simgrid::config::Flag<double> _sg_network_loopback_latency{
"network/loopback-lat",
"For network models with an implicit loopback link (L07, CM02, LV08), "
engine->add_model(net_model);
engine->get_netzone_root()->set_network_model(net_model);
- simgrid::config::set_default<double>("network/latency-factor", 13.01);
- simgrid::config::set_default<double>("network/bandwidth-factor", 0.97);
+ simgrid::config::set_default<std::string>("network/latency-factor", "13.01");
+ simgrid::config::set_default<std::string>("network/bandwidth-factor", "0.97");
simgrid::config::set_default<double>("network/weight-S", 20537);
}
/* } */
void surf_network_model_init_CM02()
{
- simgrid::config::set_default<double>("network/latency-factor", 1.0);
- simgrid::config::set_default<double>("network/bandwidth-factor", 1.0);
+ simgrid::config::set_default<std::string>("network/latency-factor", "1.0");
+ simgrid::config::set_default<std::string>("network/bandwidth-factor", "1.0");
simgrid::config::set_default<double>("network/weight-S", 0.0);
auto net_model = std::make_shared<simgrid::kernel::resource::NetworkCm02Model>("Network_CM02");