X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ccc1670e4bf36086f1f524b5ef004d5210415488..d2d941a9e68e4389cd4148ccbe1cb35da63e54e4:/src/surf/cpu_cas01.cpp diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 9f1a3a2c42..c767a73002 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -99,7 +99,7 @@ CpuCas01Model::~CpuCas01Model() delete p_cpuRunningActionSetThatDoesNotNeedBeingChecked; } -Cpu *CpuCas01Model::createCpu(const char *name, xbt_dynar_t speedPeak, +Cpu *CpuCas01Model::createCpu(simgrid::Host *host, xbt_dynar_t speedPeak, int pstate, double speedScale, tmgr_trace_t speedTrace, int core, e_surf_resource_state_t state_initial, @@ -108,7 +108,7 @@ Cpu *CpuCas01Model::createCpu(const char *name, xbt_dynar_t speedPeak, xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0, "Speed has to be >0.0. Did you forget to specify the mandatory power attribute?"); xbt_assert(core > 0, "Invalid number of cores %d. Must be larger than 0", core); - Cpu *cpu = new CpuCas01(this, name, speedPeak, pstate, speedScale, speedTrace, core, state_initial, state_trace); + Cpu *cpu = new CpuCas01(this, host, speedPeak, pstate, speedScale, speedTrace, core, state_initial, state_trace); return cpu; } @@ -152,10 +152,10 @@ void CpuCas01Model::addTraces() /************ * Resource * ************/ -CpuCas01::CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t speedPeak, +CpuCas01::CpuCas01(CpuCas01Model *model, simgrid::Host *host, xbt_dynar_t speedPeak, int pstate, double speedScale, tmgr_trace_t speedTrace, int core, e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace) -: Cpu(model, name, +: Cpu(model, host, lmm_constraint_new(model->getMaxminSystem(), this, core * speedScale * xbt_dynar_get_as(speedPeak, pstate, double)), core, xbt_dynar_get_as(speedPeak, pstate, double), speedScale, stateInitial) { @@ -183,7 +183,6 @@ CpuCas01::CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t speedPeak CpuCas01::~CpuCas01() { - this->die(); if (getModel() == surf_cpu_model_pm) xbt_dynar_free(&p_speedPeakList); }