X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/49f13b7915f6632e0a99d1b916b700049094a59d..30aca4d4af004d1ec899d12f0a9fe3997e9be15e:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 8ab9009066..6e9afb51a2 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -252,7 +252,8 @@ double CpuTiTgmr::getPowerScale(double a) * \param value Percentage of CPU speed available (useful to fixed tracing) * \return Integration trace structure */ -CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value) +CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value) : + speedTrace_(speedTrace) { double total_time = 0.0; trace_ = 0; @@ -274,12 +275,11 @@ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t speedTrace, double value) } type_ = TRACE_DYNAMIC; - speedTrace_ = speedTrace; /* count the total time of trace file */ - for (auto val: speedTrace->event_list) { + for (auto val : speedTrace->event_list) total_time += val.delta; - } + trace_ = new CpuTiTrace(speedTrace); lastTime_ = total_time; total_ = trace_->integrateSimple(0, total_time); @@ -360,7 +360,7 @@ Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host, std::vector* speedP return new CpuTi(this, host, speedPerPstate, core); } -double CpuTiModel::next_occuring_event(double now) +double CpuTiModel::nextOccuringEvent(double now) { double min_action_duration = -1; @@ -669,9 +669,8 @@ void CpuTi::modified(bool modified){ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cpu) : CpuAction(model_, cost, failed) + , cpu_(cpu) { - cpu_ = cpu; - indexHeap_ = -1; cpu_->modified(true); }