* under the terms of the license (GNU LGPL) which comes with this package. */
#include "network_smpi.hpp"
+#include "simgrid/kernel/routing/NetZoneImpl.hpp"
+#include "simgrid/s4u/Engine.hpp"
#include "simgrid/sg_config.hpp"
#include "smpi_utils.hpp"
#include "src/kernel/EngineImpl.hpp"
/* } */
void surf_network_model_init_SMPI()
{
- auto net_model = std::make_unique<simgrid::kernel::resource::NetworkSmpiModel>();
- simgrid::kernel::EngineImpl::get_instance()->add_model(simgrid::kernel::resource::Model::Type::NETWORK,
- std::move(net_model), true);
+ auto net_model = std::make_shared<simgrid::kernel::resource::NetworkSmpiModel>();
+ simgrid::kernel::EngineImpl::get_instance()->add_model(simgrid::kernel::resource::Model::Type::NETWORK, net_model,
+ true);
+ simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->set_network_model(net_model);
simgrid::config::set_default<double>("network/weight-S", 8775);
}
namespace kernel {
namespace resource {
-NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
-{
-}
+NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model() {}
double NetworkSmpiModel::get_bandwidth_factor(double size)
{
if (smpi_bw_factor.empty())
- smpi_bw_factor = parse_factor(config::get_value<std::string>("smpi/bw-factor"));
+ smpi_bw_factor = simgrid::smpi::utils::parse_factor(config::get_value<std::string>("smpi/bw-factor"));
double current = 1.0;
for (auto const& fact : smpi_bw_factor) {
double NetworkSmpiModel::get_latency_factor(double size)
{
if (smpi_lat_factor.empty())
- smpi_lat_factor = parse_factor(config::get_value<std::string>("smpi/lat-factor"));
+ smpi_lat_factor = simgrid::smpi::utils::parse_factor(config::get_value<std::string>("smpi/lat-factor"));
double current = 1.0;
for (auto const& fact : smpi_lat_factor) {