X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5b1bf4b927630226493504bec19ea7356f8e70ff..c7d4536a8384832da2a1d7b9bb9109100aaa0eb2:/src/surf/cpu_interface.cpp diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index ee3fc09929..c1ab0e1f6c 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -12,7 +12,7 @@ XBT_LOG_EXTERNAL_CATEGORY(surf_kernel); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf, "Logging specific to the SURF cpu module"); -void_f_void_t surf_cpu_model_init_preparse = NULL; +void_f_void_t surf_cpu_model_init_preparse = nullptr; simgrid::surf::CpuModel *surf_cpu_model_pm; simgrid::surf::CpuModel *surf_cpu_model_vm; @@ -30,6 +30,8 @@ simgrid::xbt::signal cpuActionSt * Model * *********/ +CpuModel::~CpuModel() {} + void CpuModel::updateActionsStateLazy(double now, double /*delta*/) { CpuAction *action; @@ -78,7 +80,7 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/) void CpuModel::updateActionsStateFull(double now, double delta) { - CpuAction *action = NULL; + CpuAction *action = nullptr; ActionList *running_actions = getRunningActionSet(); for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end()) @@ -115,11 +117,16 @@ void CpuModel::updateActionsStateFull(double now, double delta) } } +bool CpuModel::next_occuring_event_isIdempotent() +{ + return true; +} + /************ * Resource * ************/ Cpu::Cpu(Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core) - : Cpu(model, host, NULL/*constraint*/, speedPerPstate, core) + : Cpu(model, host, nullptr/*constraint*/, speedPerPstate, core) { } @@ -169,7 +176,7 @@ Cpu::~Cpu() xbt_dynar_free(&speedPerPstate_); } -double Cpu::getCurrentPowerPeak() +double Cpu::getPstateSpeedCurrent() { return speed_.peak; } @@ -197,7 +204,7 @@ int Cpu::getPState() return pstate_; } -double Cpu::getPowerPeakAt(int pstate_index) +double Cpu::getPstateSpeed(int pstate_index) { xbt_dynar_t plist = speedPerPstate_; xbt_assert((pstate_index <= (int)xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)"); @@ -228,13 +235,13 @@ int Cpu::getCore() void Cpu::setStateTrace(tmgr_trace_t trace) { - xbt_assert(stateEvent_==NULL,"Cannot set a second state trace to Host %s", host_->name().c_str()); + xbt_assert(stateEvent_==nullptr,"Cannot set a second state trace to Host %s", host_->name().c_str()); stateEvent_ = future_evt_set->add_trace(trace, 0.0, this); } void Cpu::setSpeedTrace(tmgr_trace_t trace) { - xbt_assert(speed_.event==NULL,"Cannot set a second speed trace to Host %s", host_->name().c_str()); + xbt_assert(speed_.event==nullptr,"Cannot set a second speed trace to Host %s", host_->name().c_str()); speed_.event = future_evt_set->add_trace(trace, 0.0, this); }