- return current;
- }
-
- double NetworkSmpiModel::latencyFactor(double size)
- {
- if (smpi_lat_factor.empty())
- smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));
-
- double current=1.0;
- for (const auto& fact : smpi_lat_factor) {
- if (size <= fact.factor) {
- XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
- return current;
- }else
- current=fact.values.front();
- }
- XBT_DEBUG("%f > %zu return %f", size, smpi_lat_factor.back().factor, current);
-
- return current;
- }
-
- double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
- {
- return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
- }
-
- /************
- * Resource *
- ************/
+void NetworkSmpiModel::check_lat_factor_cb()
+{
+ if (not simgrid::config::is_default("smpi/lat-factor")) {
+ throw std::invalid_argument(
+ "NetworkModelIntf: Cannot mix network/latency-factor and callback configuration. Choose only one of them.");
+ }
+}