X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6050383ef0dc59e1ca54d02bcf6bccb993593add..198b09ec16ca1b8fc05053bcae9e75c0ad689711:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 4e7b6e61d5..027ac812b7 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -68,7 +68,6 @@ CpuTiTgmr::~CpuTiTgmr() * Wrapper around surf_cpu_integrate_trace_simple() to get * the cyclic effect. * -* \param trace Trace structure. * \param a Begin of interval * \param b End of interval * \return the integrate value. -1 if an error occurs. @@ -253,7 +252,6 @@ double CpuTiTgmr::solveSomewhatSimple(double a, double amount) /** * \brief Auxiliary function to solve integral. * It returns the date when the requested amount of flops is available - * \param trace Trace structure * \param a Initial point * \param amount Amount of flops * \return The date when amount is available. @@ -280,7 +278,6 @@ double CpuTiTrace::solveSimple(double a, double amount) * \brief Auxiliary function to update the CPU speed scale. * * This function uses the trace structure to return the speed scale at the determined time a. -* \param trace Trace structure to search the updated speed scale * \param a Time * \return CPU speed scale */ @@ -302,7 +299,6 @@ double CpuTiTgmr::getPowerScale(double a) * * \param speedTrace CPU availability trace * \param value Percentage of CPU speed available (useful to fixed tracing) -* \param spacing Initial spacing * \return Integration trace structure */ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value) @@ -401,14 +397,14 @@ CpuTiModel::CpuTiModel() : CpuModel() modifiedCpu_ = new CpuTiList(); - tiActionHeap_ = xbt_heap_new(8, NULL); + tiActionHeap_ = xbt_heap_new(8, nullptr); xbt_heap_set_update_callback(tiActionHeap_, cpu_ti_action_update_index_heap); } CpuTiModel::~CpuTiModel() { - surf_cpu_model_pm = NULL; + surf_cpu_model_pm = nullptr; delete runningActionSetThatDoesNotNeedBeingChecked_; delete modifiedCpu_; xbt_heap_free(tiActionHeap_); @@ -469,7 +465,7 @@ CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPs xbt_dynar_get_cpy(speedPerPstate, 0, &speed_.peak); XBT_DEBUG("CPU create: peak=%f", speed_.peak); - speedIntegratedTrace_ = new CpuTiTgmr(NULL, 1/*scale*/); + speedIntegratedTrace_ = new CpuTiTgmr(nullptr, 1/*scale*/); } CpuTi::~CpuTi() @@ -600,10 +596,10 @@ void CpuTi::updateActionsFinishTime(double now) action->setFinishTime(speedIntegratedTrace_->solve(now, total_area)); /* verify which event will happen before (max_duration or finish time) */ if (action->getMaxDuration() != NO_MAX_DURATION && - action->getStartTime() + action->getMaxDuration() < action->m_finish) + action->getStartTime() + action->getMaxDuration() < action->finishTime_) min_finish = action->getStartTime() + action->getMaxDuration(); else - min_finish = action->m_finish; + min_finish = action->finishTime_; } else { /* put the max duration time on heap */ if (action->getMaxDuration() != NO_MAX_DURATION) @@ -623,7 +619,7 @@ void CpuTi::updateActionsFinishTime(double now) XBT_DEBUG ("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", getName(), action, action->getStartTime(), - action->m_finish, + action->finishTime_, action->getMaxDuration()); } /* remove from modified cpu */ @@ -672,12 +668,12 @@ void CpuTi::updateRemainingAmount(double now) continue; /* skip action that are finishing now */ - if (action->m_finish >= 0 && action->m_finish <= now) + if (action->finishTime_ >= 0 && action->finishTime_ <= now) continue; /* update remaining */ action->updateRemains(area_total / (sumPriority_ * action->getPriority())); - XBT_DEBUG("Update remaining action(%p) remaining %f", action, action->m_remains); + XBT_DEBUG("Update remaining action(%p) remaining %f", action, action->remains_); } lastUpdate_ = now; } @@ -702,13 +698,13 @@ CpuAction *CpuTi::sleep(double duration) XBT_IN("(%s,%g)", getName(), duration); CpuTiAction *action = new CpuTiAction(static_cast(getModel()), 1.0, isOff(), this); - action->m_maxDuration = duration; + action->maxDuration_ = duration; action->suspended_ = 2; if (duration == NO_MAX_DURATION) { /* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */ action->getStateSet()->erase(action->getStateSet()->iterator_to(*action)); - action->p_stateSet = static_cast(getModel())->runningActionSetThatDoesNotNeedBeingChecked_; + action->stateSet_ = static_cast(getModel())->runningActionSetThatDoesNotNeedBeingChecked_; action->getStateSet()->push_back(*action); } @@ -756,8 +752,8 @@ void CpuTiAction::setState(Action::State state) int CpuTiAction::unref() { - m_refcount--; - if (!m_refcount) { + refcount_--; + if (!refcount_) { if (action_hook.is_linked()) getStateSet()->erase(getStateSet()->iterator_to(*this)); /* remove from action_set */ @@ -807,7 +803,7 @@ void CpuTiAction::setMaxDuration(double duration) XBT_IN("(%p,%g)", this, duration); - m_maxDuration = duration; + maxDuration_ = duration; if (duration >= 0) min_finish = (getStartTime() + getMaxDuration()) < getFinishTime() ? @@ -830,7 +826,7 @@ void CpuTiAction::setMaxDuration(double duration) void CpuTiAction::setPriority(double priority) { XBT_IN("(%p,%g)", this, priority); - m_priority = priority; + priority_ = priority; cpu_->modified(true); XBT_OUT(); } @@ -840,7 +836,7 @@ double CpuTiAction::getRemains() XBT_IN("(%p)", this); cpu_->updateRemainingAmount(surf_get_clock()); XBT_OUT(); - return m_remains; + return remains_; } }