X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d9c241c4abfcb7fe1e136e38d861823d1d6cdb9e..6a842fbc88eba9f783c6599c541577e70c49aa1a:/src/surf/ptask_L07.cpp diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 5e249700c9..30a4f9e384 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -61,10 +61,10 @@ NetworkL07Model::NetworkL07Model(const std::string& name, HostL07Model* hmodel, : NetworkModel(name), hostModel_(hmodel) { set_maxmin_system(sys); - loopback_ = NetworkL07Model::create_link( - "__loopback__", std::vector{simgrid::config::get_value("network/loopback-bw")}, - s4u::Link::SharingPolicy::FATPIPE) - ->set_latency(simgrid::config::get_value("network/loopback-lat")); + loopback_ = + create_link("__loopback__", std::vector{simgrid::config::get_value("network/loopback-bw")}) + ->set_sharing_policy(s4u::Link::SharingPolicy::FATPIPE) + ->set_latency(simgrid::config::get_value("network/loopback-lat")); loopback_->seal(); } @@ -105,9 +105,8 @@ void HostL07Model::update_actions_state(double /*now*/, double delta) action.set_last_update(); } } - XBT_DEBUG("Action (%p) : remains (%g) updated by %g.", &action, action.get_remains(), - action.get_variable()->get_value() * delta); - action.update_remains(action.get_variable()->get_value() * delta); + XBT_DEBUG("Action (%p) : remains (%g) updated by %g.", &action, action.get_remains(), action.get_rate() * delta); + action.update_remains(action.get_rate() * delta); action.update_max_duration(delta); XBT_DEBUG("Action (%p) : remains (%g).", &action, action.get_remains()); @@ -234,18 +233,21 @@ kernel::resource::Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host return res; } -kernel::resource::Cpu* CpuL07Model::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate) +kernel::resource::CpuImpl* CpuL07Model::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate) { return (new CpuL07(host, speed_per_pstate))->set_model(this); } -kernel::resource::LinkImpl* NetworkL07Model::create_link(const std::string& name, const std::vector& bandwidths, - s4u::Link::SharingPolicy policy) +kernel::resource::LinkImpl* NetworkL07Model::create_link(const std::string& name, const std::vector& bandwidths) { xbt_assert(bandwidths.size() == 1, "Non WIFI link must have only 1 bandwidth."); - auto link = new LinkL07(name, bandwidths[0], policy, get_maxmin_system()); - link->set_model(this); - return link; + return (new LinkL07(name, bandwidths[0], get_maxmin_system()))->set_model(this); +} + +kernel::resource::LinkImpl* NetworkL07Model::create_wifi_link(const std::string& name, + const std::vector& bandwidths) +{ + THROW_UNIMPLEMENTED; } /************ @@ -292,18 +294,13 @@ void CpuL07::on_speed_change() get_model()->get_maxmin_system()->update_variable_bound(action->get_variable(), speed_.scale * speed_.peak); } - Cpu::on_speed_change(); + CpuImpl::on_speed_change(); } -LinkL07::LinkL07(const std::string& name, double bandwidth, s4u::Link::SharingPolicy policy, - kernel::lmm::System* system) - : LinkImpl(name) +LinkL07::LinkL07(const std::string& name, double bandwidth, kernel::lmm::System* system) : LinkImpl(name) { this->set_constraint(system->constraint_new(this, bandwidth)); bandwidth_.peak = bandwidth; - - if (policy == s4u::Link::SharingPolicy::FATPIPE) - get_constraint()->unshare(); } bool LinkL07::is_used() const