return new CpuTi(this, host, speedPerPstate, core);
}
-double CpuTiModel::nextOccuringEvent(double now)
+double CpuTiModel::next_occuring_event(double now)
{
double min_action_duration = -1;
return min_action_duration;
}
-void CpuTiModel::updateActionsState(double now, double /*delta*/)
+void CpuTiModel::update_actions_state(double now, double /*delta*/)
{
while (not actionHeapIsEmpty() && actionHeapTopDate() <= now) {
CpuTiAction* action = static_cast<CpuTiAction*>(actionHeapPop());
CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core)
: Cpu(model, host, speedPerPstate, core)
{
- xbt_assert(core==1,"Multi-core not handled by this model yet");
- coresAmount_ = core;
+ xbt_assert(core == 1, "Multi-core not handled by this model yet");
speed_.peak = speedPerPstate->front();
XBT_DEBUG("CPU create: peak=%f", speed_.peak);
action.get_state() == kernel::resource::Action::State::not_in_the_system) {
action.set_finish_time(date);
action.set_state(kernel::resource::Action::State::failed);
- action.heapRemove(model()->getActionHeap());
+ action.heapRemove();
}
}
}
for (CpuTiAction const& action : actionSet_) {
/* action not running, skip it */
- if (action.get_state_set() != surf_cpu_model_pm->getRunningActionSet())
+ if (action.get_state_set() != surf_cpu_model_pm->get_running_action_set())
continue;
/* bogus priority, skip it */
for (CpuTiAction& action : actionSet_) {
double min_finish = -1;
/* action not running, skip it */
- if (action.get_state_set() != surf_cpu_model_pm->getRunningActionSet())
+ if (action.get_state_set() != surf_cpu_model_pm->get_running_action_set())
continue;
/* verify if the action is really running on cpu */
}
/* add in action heap */
if (min_finish > NO_MAX_DURATION)
- action.heapUpdate(model()->getActionHeap(), min_finish, kernel::resource::Action::Type::NOTSET);
+ action.heapUpdate(min_finish, kernel::resource::Action::Type::NOTSET);
else
- action.heapRemove(model()->getActionHeap());
+ action.heapRemove();
XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", getCname(),
&action, action.get_start_time(), action.get_finish_time(), action.get_max_duration());
XBT_DEBUG("Flops total: %f, Last update %f", area_total, lastUpdate_);
for (CpuTiAction& action : actionSet_) {
/* action not running, skip it */
- if (action.get_state_set() != model()->getRunningActionSet())
+ if (action.get_state_set() != model()->get_running_action_set())
continue;
/* bogus priority, skip it */
if (action_ti_hook.is_linked())
simgrid::xbt::intrusive_erase(cpu_->actionSet_, *this);
/* remove from heap */
- heapRemove(get_model()->getActionHeap());
+ heapRemove();
cpu_->modified(true);
}
void CpuTiAction::cancel()
{
this->set_state(Action::State::failed);
- heapRemove(get_model()->getActionHeap());
+ heapRemove();
cpu_->modified(true);
}
XBT_IN("(%p)", this);
if (suspended_ != Action::SuspendStates::sleeping) {
suspended_ = Action::SuspendStates::suspended;
- heapRemove(get_model()->getActionHeap());
+ heapRemove();
cpu_->modified(true);
}
XBT_OUT();
min_finish = get_finish_time();
/* add in action heap */
- heapUpdate(get_model()->getActionHeap(), min_finish, Action::Type::NOTSET);
+ heapUpdate(min_finish, Action::Type::NOTSET);
XBT_OUT();
}