if (surf_network_model)
return;
surf_network_model = new simgrid::kernel::resource::NetworkSmpiModel();
- all_existing_models->push_back(surf_network_model);
- xbt_cfg_setdefault_double("network/weight-S", 8775);
+ simgrid::config::set_default<double>("network/weight-S", 8775);
}
namespace simgrid {
NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
{
+ /* Do not add this into all_existing_models: our ancestor already does so */
}
NetworkSmpiModel::~NetworkSmpiModel() = default;
-double NetworkSmpiModel::bandwidthFactor(double size)
+double NetworkSmpiModel::get_bandwidth_factor(double size)
{
if (smpi_bw_factor.empty())
- smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw-factor"));
+ smpi_bw_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/bw-factor"));
double current = 1.0;
for (auto const& fact : smpi_bw_factor) {
return current;
}
-double NetworkSmpiModel::latencyFactor(double size)
+double NetworkSmpiModel::get_latency_factor(double size)
{
if (smpi_lat_factor.empty())
- smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));
+ smpi_lat_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/lat-factor"));
double current = 1.0;
for (auto const& fact : smpi_lat_factor) {
return current;
}
-double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
+double NetworkSmpiModel::get_bandwidth_constraint(double rate, double bound, double size)
{
- return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
+ return rate < 0 ? bound : std::min(bound, rate * get_bandwidth_factor(size));
}
/************