X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/49b53eb334bc6f19b530603201d00bcc312bfd29..13a2073e56f059a44fc91c128ca16aa0cf48e6b2:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index b51fe9c665..285a6deabf 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -274,7 +274,7 @@ void CpuTiModel::create_pm_models() simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->set_cpu_pm_model(cpu_model_pm); } -Cpu* CpuTiModel::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate) +CpuImpl* CpuTiModel::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate) { return (new CpuTi(host, speed_per_pstate))->set_model(this); } @@ -313,7 +313,7 @@ void CpuTiModel::update_actions_state(double now, double /*delta*/) /************ * Resource * ************/ -CpuTi::CpuTi(s4u::Host* host, const std::vector& speed_per_pstate) : Cpu(host, speed_per_pstate) +CpuTi::CpuTi(s4u::Host* host, const std::vector& speed_per_pstate) : CpuImpl(host, speed_per_pstate) { speed_.peak = speed_per_pstate.front(); XBT_DEBUG("CPU create: peak=%f", speed_.peak); @@ -327,7 +327,7 @@ CpuTi::~CpuTi() delete speed_integrated_trace_; } -Cpu* CpuTi::set_speed_profile(kernel::profile::Profile* profile) +CpuImpl* CpuTi::set_speed_profile(kernel::profile::Profile* profile) { delete speed_integrated_trace_; speed_integrated_trace_ = new CpuTiTmgr(profile, speed_.scale); @@ -411,7 +411,7 @@ void CpuTi::update_actions_finish_time(double now) } for (CpuTiAction& action : action_set_) { - double min_finish = -1; + double min_finish = NO_MAX_DURATION; /* action not running, skip it */ if (action.get_state_set() != get_model()->get_started_action_set()) continue; @@ -454,7 +454,7 @@ bool CpuTi::is_used() const double CpuTi::get_speed_ratio() { speed_.scale = speed_integrated_trace_->get_power_scale(surf_get_clock()); - return Cpu::get_speed_ratio(); + return CpuImpl::get_speed_ratio(); } /** @brief Update the remaining amount of actions */ @@ -590,26 +590,6 @@ void CpuTiAction::resume() XBT_OUT(); } -void CpuTiAction::set_max_duration(double duration) -{ - double min_finish; - - XBT_IN("(%p,%g)", this, duration); - - Action::set_max_duration(duration); - - if (duration >= 0) - min_finish = (get_start_time() + get_max_duration()) < get_finish_time() ? (get_start_time() + get_max_duration()) - : get_finish_time(); - else - min_finish = get_finish_time(); - - /* add in action heap */ - get_model()->get_action_heap().update(this, min_finish, ActionHeap::Type::unset); - - XBT_OUT(); -} - void CpuTiAction::set_sharing_penalty(double sharing_penalty) { XBT_IN("(%p,%g)", this, sharing_penalty);