From f0a4750df69ffc8154f013462ae5fe459cfbc599 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 19 Mar 2016 23:23:50 +0100 Subject: [PATCH] remove a redundant parameter to the Cpu constructor --- src/surf/cpu_cas01.cpp | 2 +- src/surf/cpu_interface.cpp | 8 ++++---- src/surf/cpu_interface.hpp | 10 +++------- src/surf/cpu_ti.cpp | 2 +- src/surf/ptask_L07.cpp | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 0a7f39155b..271dce40a1 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -101,7 +101,7 @@ double CpuCas01Model::next_occuring_event_full(double /*now*/) CpuCas01::CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core) : Cpu(model, host, lmm_constraint_new(model->getMaxminSystem(), this, core * xbt_dynar_get_as(speedPerPstate, 0/*pstate*/, double)), - speedPerPstate, core, xbt_dynar_get_as(speedPerPstate, 0/*pstate*/, double)) + speedPerPstate, core) { XBT_DEBUG("CPU create: peak=%f, pstate=%d", speed_.peak, pstate_); diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index 6da354f5b0..72ab8bcbfa 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -134,18 +134,18 @@ void CpuModel::updateActionsStateFull(double now, double delta) * Resource * ************/ Cpu::Cpu(Model *model, simgrid::s4u::Host *host, - xbt_dynar_t speedPerPstate, int core, double speedPeak) - : Cpu(model, host, NULL/*constraint*/, speedPerPstate, core, speedPeak) + xbt_dynar_t speedPerPstate, int core) + : Cpu(model, host, NULL/*constraint*/, speedPerPstate, core) { } Cpu::Cpu(Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint, - xbt_dynar_t speedPerPstate, int core, double speedPeak) + xbt_dynar_t speedPerPstate, int core) : Resource(model, host->name().c_str(), constraint) , coresAmount_(core) , host_(host) { - speed_.peak = speedPeak; + speed_.peak = xbt_dynar_get_as(speedPerPstate, 0/*pstate*/, double); speed_.scale = 1; host->pimpl_cpu = this; xbt_assert(speed_.scale > 0, "Available speed has to be >0"); diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 2de8e3ad00..f8c4092118 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -69,12 +69,10 @@ public: * @param model The CpuModel associated to this Cpu * @param host The host in which this Cpu should be plugged * @param constraint The lmm constraint associated to this Cpu if it is part of a LMM component - * @param speedList [TODO] + * @param speedPerPstate Processor speed (in flop per second) for each pstate * @param core The number of core of this Cpu - * @param speedPeak The speed peak of this Cpu in flops (max speed) */ - Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host, - lmm_constraint_t constraint, xbt_dynar_t speedPeakList, int core, double speedPeak); + Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint, xbt_dynar_t speedPerPstate, int core); /** * @brief Cpu constructor @@ -83,10 +81,8 @@ public: * @param host The host in which this Cpu should be plugged * @param speedPerPstate Processor speed (in flop per second) for each pstate * @param core The number of core of this Cpu - * @param speedPeak The speed peak of this Cpu in flops (max speed) */ - Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host, - xbt_dynar_t speedPerPstate, int core, double speedPeak); + Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core); ~Cpu(); diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index d094a12bec..b846e20d4b 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -462,7 +462,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; diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index a5f933953c..be2a6009d6 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -287,7 +287,7 @@ Link* NetworkL07Model::createLink(const char *name, double bandwidth, double lat ************/ CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core) - : Cpu(model, host, speedPerPstate, core, xbt_dynar_get_as(speedPerPstate,0,double)) + : Cpu(model, host, speedPerPstate, core) { p_constraint = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPerPstate,0,double)); } -- 2.20.1