<prop id = "maxmin/precision" value = "0.000010" />
<prop id = "cpu/optim" value = "TI" />
<prop id = "network/model" value = "SMPI" />
- <prop id = "smpi/bw-factor" value = "65472:0.940694;15424:0.697866;9376:0.58729" />
+ <prop id = "network/bandwidth-factor" value = "65472:0.940694;15424:0.697866;9376:0.58729" />
</config>
<!-- The rest of your platform -->
<prop id="host/model" value="compound"></prop>
<prop id="network/model" value="SMPI"></prop>
<prop id="path" value="~/"></prop>
- <prop id="smpi/bw-factor" value="65472:0.940694;15424:0.697866;9376:0.58729"></prop>
+ <prop id="network/bandwidth-factor" value="65472:0.940694;15424:0.697866;9376:0.58729"></prop>
</config>
<zone id="AS0" routing="Full">
static smpi::utils::FactorSet cfg_bandwidth_factor("network/bandwidth-factor");
config::Flag<std::string> cfg_latency_factor_str(
- "network/latency-factor",
+ "network/latency-factor", {{"smpi/lat-factor"}},
"Correction factor to apply to the provided latency (default value overridden by network model)", "1.0");
static config::Flag<std::string> cfg_bandwidth_factor_str(
- "network/bandwidth-factor",
+ "network/bandwidth-factor", {{"smpi/bw-factor"}},
"Correction factor to apply to the provided bandwidth (default value overridden by network model)", "1.0");
double NetworkModel::get_latency_factor(double size)
TEST_CASE("kernel::resource::NetworkModelIntf: Invalid network/latency-factor and network/bandwidth-factor", "")
{
- for (const auto& model : std::vector<std::string>{"LV08", "CM02"}) {
+ std::vector<std::string> models{"LV08", "CM02"};
+#if HAVE_SMPI
+ models.emplace_back("SMPI");
+ models.emplace_back("IB");
+#endif
+
+ for (const auto& model : models) {
_sg_cfg_init_status = 0; /* HACK: clear config global to be able to do set_config in UTs */
simgrid::s4u::Engine e("test");
simgrid::s4u::Engine::set_config("network/model:" + model);
}
}
}
-
-#if HAVE_SMPI
-TEST_CASE("kernel::resource::NetworkModelIntf: Invalid smpi/lat-factor and smpi/bw-factor", "")
-{
- for (const auto& model : std::vector<std::string>{"SMPI", "IB"}) {
- _sg_cfg_init_status = 0; /* HACK: clear config global to be able to do set_config in UTs */
- simgrid::s4u::Engine e("test");
- simgrid::s4u::Engine::set_config("network/model:" + model);
- simgrid::s4u::Engine::set_config(
- "smpi/lat-factor:65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493");
- simgrid::s4u::Engine::set_config("smpi/bw-factor:65472:11.6436;15424:3.48845");
- simgrid::s4u::create_full_zone("root");
-
- SECTION("Model: " + model)
- {
- simgrid::kernel::resource::NetworkModelIntf* m = e.get_netzone_root()->get_network_model();
- REQUIRE_THROWS_AS(m->set_lat_factor_cb(factor_cb), std::invalid_argument);
- REQUIRE_THROWS_AS(m->set_bw_factor_cb(factor_cb), std::invalid_argument);
- }
- }
-}
-#endif
default_synchro_mode,
&_sg_cfg_cb_contexts_parallel_mode};
- // For smpi/bw-factor and smpi/lat-factor
// SMPI model can be used without enable_smpi, so keep this out of the ifdef.
- simgrid::config::declare_flag<std::string>("smpi/bw-factor",
- "Bandwidth factors for smpi. Format: "
- "'threshold0:value0;threshold1:value1;...;thresholdN:valueN', "
- "meaning if(size >=thresholdN ) return valueN.",
- "65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;"
- "1426:0.608902;732:0.341987;257:0.338112;0:0.812084");
-
- simgrid::config::declare_flag<std::string>("smpi/lat-factor", "Latency factors for smpi.",
- "65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;"
- "1426:1.61075;732:1.9503;257:1.95341;0:2.01467");
static simgrid::config::Flag<std::string> cfg_smpi_IB_penalty_factors{
"smpi/IB-penalty-factors",
"Correction factor to communications using Infiniband model with "
engine->get_netzone_root()->set_network_model(net_model);
simgrid::config::set_default<double>("network/weight-S", 8775);
+ simgrid::config::set_default<std::string>("network/bandwidth-factor",
+ "65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;"
+ "1426:0.608902;732:0.341987;257:0.338112;0:0.812084");
+ simgrid::config::set_default<std::string>("network/latency-factor",
+ "65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;"
+ "1426:1.61075;732:1.9503;257:1.95341;0:2.01467");
}
namespace simgrid::kernel::resource {
void NetworkSmpiModel::check_lat_factor_cb()
{
- if (not simgrid::config::is_default("smpi/lat-factor")) {
+ if (not simgrid::config::is_default("network/latency-factor")) {
throw std::invalid_argument(
"NetworkModelIntf: Cannot mix network/latency-factor and callback configuration. Choose only one of them.");
}
void NetworkSmpiModel::check_bw_factor_cb()
{
- if (not simgrid::config::is_default("smpi/bw-factor")) {
+ if (not simgrid::config::is_default("network/bandwidth-factor")) {
throw std::invalid_argument(
"NetworkModelIntf: Cannot mix network/bandwidth-factor and callback configuration. Choose only one of them.");
}
}
-double NetworkSmpiModel::get_bandwidth_factor(double size)
-{
- static smpi::utils::FactorSet smpi_bw_factor("smpi/bw-factor");
- if (not smpi_bw_factor.is_initialized())
- smpi_bw_factor.parse(config::get_value<std::string>("smpi/bw-factor"));
-
- return smpi_bw_factor(size);
-}
-
-double NetworkSmpiModel::get_latency_factor(double size)
-{
- static smpi::utils::FactorSet smpi_lat_factor("smpi/lat-factor");
- if (not smpi_lat_factor.is_initialized())
- smpi_lat_factor.parse(config::get_value<std::string>("smpi/lat-factor"));
-
- return smpi_lat_factor(size);
-}
} // namespace simgrid::kernel::resource
public:
using NetworkCm02Model::NetworkCm02Model;
- double get_latency_factor(double size) override;
- double get_bandwidth_factor(double size) override;
-
protected:
void check_lat_factor_cb() override;
void check_bw_factor_cb() override;