X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9fc9b3239f3f2a3a5441fe5c8bac82c1ffa3c9d0..3bf83c178e063b2a63809add332e54e810df87cc:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index d094a12bec..4e7b6e61d5 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -414,12 +414,9 @@ CpuTiModel::~CpuTiModel() xbt_heap_free(tiActionHeap_); } -Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, xbt_dynar_t speeds, int core) +Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core) { - xbt_assert(core==1,"Multi-core not handled with this model yet"); - xbt_assert(xbt_dynar_getfirst_as(speeds, double) > 0.0, - "Speed has to be >0.0. Did you forget to specify the mandatory speed attribute?"); - return new CpuTi(this, host, speeds, core); + return new CpuTi(this, host, speedPerPstate, core); } double CpuTiModel::next_occuring_event(double now) @@ -452,7 +449,7 @@ void CpuTiModel::updateActionsState(double now, double /*delta*/) action->finish(); /* set the remains to 0 due to precision problems when updating the remaining amount */ action->setRemains(0); - action->setState(SURF_ACTION_DONE); + action->setState(Action::State::done); /* update remaining amount of all actions */ action->cpu_->updateRemainingAmount(surf_get_clock()); } @@ -462,7 +459,7 @@ void CpuTiModel::updateActionsState(double now, double /*delta*/) * Resource * ************/ CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core) - : Cpu(model, host, NULL, core, 0) + : Cpu(model, host, speedPerPstate, core) { xbt_assert(core==1,"Multi-core not handled by this model yet"); coresAmount_ = core; @@ -536,11 +533,11 @@ void CpuTi::apply_event(tmgr_trace_iterator_t event, double value) ; it != itend ; ++it) { CpuTiAction *action = &*it; - if (action->getState() == SURF_ACTION_RUNNING - || action->getState() == SURF_ACTION_READY - || action->getState() == SURF_ACTION_NOT_IN_THE_SYSTEM) { + if (action->getState() == Action::State::running + || action->getState() == Action::State::ready + || action->getState() == Action::State::not_in_the_system) { action->setFinishTime(date); - action->setState(SURF_ACTION_FAILED); + action->setState(Action::State::failed); if (action->indexHeap_ >= 0) { CpuTiAction *heap_act = (CpuTiAction*) xbt_heap_remove(static_cast(getModel())->tiActionHeap_, action->indexHeap_); @@ -751,7 +748,7 @@ void CpuTiAction::updateIndexHeap(int i) indexHeap_ = i; } -void CpuTiAction::setState(e_surf_action_state_t state) +void CpuTiAction::setState(Action::State state) { CpuAction::setState(state); cpu_->modified(true); @@ -777,7 +774,7 @@ int CpuTiAction::unref() void CpuTiAction::cancel() { - this->setState(SURF_ACTION_FAILED); + this->setState(Action::State::failed); xbt_heap_remove(getModel()->getActionHeap(), this->indexHeap_); cpu_->modified(true); return;