-void surf_network_model_init_CM02()
-{
- xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice");
-
- simgrid::config::set_default<double>("network/latency-factor", 1.0);
- simgrid::config::set_default<double>("network/bandwidth-factor", 1.0);
- simgrid::config::set_default<double>("network/weight-S", 0.0);
-
- surf_network_model = new simgrid::kernel::resource::NetworkCm02Model();
-}
-
-namespace simgrid {
-namespace kernel {
-namespace resource {
-
-NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(bool))
- : NetworkModel(simgrid::config::get_value<std::string>("network/optim") == "Full" ? Model::UpdateAlgo::FULL
- : Model::UpdateAlgo::LAZY)
+SIMGRID_REGISTER_NETWORK_MODEL(
+ CM02,
+ "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of "
+ "small messages are thus poorly modeled).",
+ []() {
+ 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");
+ auto* engine = simgrid::kernel::EngineImpl::get_instance();
+ engine->add_model(net_model);
+ engine->get_netzone_root()->set_network_model(net_model);
+ });
+
+/********************************************************************/
+/* Model based on LV08 and experimental results of MPI ping-pongs */
+/********************************************************************/
+/* @Inproceedings{smpi_ipdps, */
+/* author={Pierre-Nicolas Clauss and Mark Stillwell and Stéphane Genaud and Frédéric Suter and Henri Casanova and
+ * Martin Quinson}, */
+/* title={Single Node On-Line Simulation of {MPI} Applications with SMPI}, */
+/* booktitle={25th IEEE International Parallel and Distributed Processing Symposium (IPDPS'11)}, */
+/* address={Anchorage (Alaska) USA}, */
+/* month=may, */
+/* year={2011} */
+/* } */
+SIMGRID_REGISTER_NETWORK_MODEL(
+ SMPI,
+ "Realistic network model specifically tailored for HPC settings (accurate modeling of slow start with "
+ "correction factors on three intervals: < 1KiB, < 64 KiB, >= 64 KiB)",
+ []() {
+ auto net_model = std::make_shared<simgrid::kernel::resource::NetworkCm02Model>("Network_SMPI");
+ auto* engine = simgrid::kernel::EngineImpl::get_instance();
+ engine->add_model(net_model);
+ 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 {
+static simgrid::config::Flag<std::string>
+ network_optim_opt("network/optim", "Optimization algorithm to use for network resources. ", "Lazy",
+
+ std::map<std::string, std::string, std::less<>>({
+ {"Lazy", "Lazy action management (partial invalidation in lmm + heap in action remaining)."},
+ {"Full", "Full update of remaining and variables. Slow but may be useful when debugging."},
+ }),
+
+ [](std::string const&) {
+ xbt_assert(_sg_cfg_init_status < 2,
+ "Cannot change the optimization algorithm after the initialization");
+ });
+
+NetworkCm02Model::NetworkCm02Model(const std::string& name) : NetworkModel(name)