X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c0f3756528127131a1947179f56871657a084259..5258a7df1e22166d51d64e58eaa5514fe7121735:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 6ce941766b..519bf989b2 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -313,9 +313,9 @@ CpuTiModel::~CpuTiModel() surf_cpu_model_pm = nullptr; } -Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, std::vector* speedPerPstate, int core) +Cpu* CpuTiModel::create_cpu(simgrid::s4u::Host* host, std::vector* speed_per_pstate, int core) { - return new CpuTi(this, host, speedPerPstate, core); + return new CpuTi(this, host, speed_per_pstate, core); } double CpuTiModel::next_occuring_event(double now) @@ -402,10 +402,10 @@ void CpuTi::apply_event(tmgr_trace_event_t event, double value) tmgr_trace_event_unref(&speed_.event); - } else if (event == stateEvent_) { + } else if (event == state_event_) { if (value > 0) { if (is_off()) - host_that_restart.push_back(getHost()); + host_that_restart.push_back(get_host()); turn_on(); } else { turn_off(); @@ -422,7 +422,7 @@ void CpuTi::apply_event(tmgr_trace_event_t event, double value) } } } - tmgr_trace_event_unref(&stateEvent_); + tmgr_trace_event_unref(&state_event_); } else { xbt_die("Unknown event!\n"); @@ -494,10 +494,10 @@ bool CpuTi::is_used() return not action_set_.empty(); } -double CpuTi::get_available_speed() +double CpuTi::get_speed_ratio() { speed_.scale = speed_integrated_trace_->get_power_scale(surf_get_clock()); - return Cpu::get_available_speed(); + return Cpu::get_speed_ratio(); } /** @brief Update the remaining amount of actions */ @@ -561,12 +561,8 @@ CpuAction *CpuTi::sleep(double duration) action->set_max_duration(duration); action->suspended_ = kernel::resource::Action::SuspendStates::sleeping; - if (duration == NO_MAX_DURATION) { - /* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */ - simgrid::xbt::intrusive_erase(*action->get_state_set(), *action); - action->state_set_ = &static_cast(get_model())->runningActionSetThatDoesNotNeedBeingChecked_; - action->get_state_set()->push_back(*action); - } + if (duration < 0) // NO_MAX_DURATION + action->set_state(simgrid::kernel::resource::Action::State::IGNORED); action_set_.push_back(*action);