- p_speedPeakList = xbt_dynar_new(sizeof(double), nullptr);
- unsigned long n = xbt_dynar_length(speedPeakList);
- for (unsigned long i = 0; i != n; ++i) {
- double value = xbt_dynar_get_as(speedPeakList, i, double);
- xbt_dynar_push(p_speedPeakList, &value);
- }
-
- m_pstate = pstate;
-
- /* Currently, we assume that a VM does not have a multicore CPU. */
- if (core > 1)
- xbt_assert(model == surf_cpu_model_pm);
-
- if (model->getUpdateMechanism() != UM_UNDEFINED) {
- p_constraintCore = xbt_new(lmm_constraint_t, core);
- p_constraintCoreId = xbt_new(void*, core);
-
- int i;
- for (i = 0; i < core; i++) {
- /* just for a unique id, never used as a string. */
- p_constraintCoreId[i] = bprintf("%s:%i", host->getName().c_str(), i);
- p_constraintCore[i] = lmm_constraint_new(model->getMaxminSystem(), p_constraintCoreId[i], m_speedScale * m_speedPeak);
- }
- }
-}
-
-Cpu::Cpu(Model *model, simgrid::Host *host, lmm_constraint_t constraint,
- xbt_dynar_t speedPeakList, int pstate,
- int core, double speedPeak, double speedScale)
-: Cpu(model, host, constraint, speedPeakList, pstate, core, speedPeak, speedScale, SURF_RESOURCE_ON)
-{
- xbt_die("FIXME: DEADCODE");
-}
-
-Cpu::Cpu(Model *model, simgrid::Host *host,
- xbt_dynar_t speedPeakList, int pstate,
- int core, double speedPeak, double speedScale)
-: Cpu(model, host, speedPeakList, pstate, core, speedPeak, speedScale, SURF_RESOURCE_ON)
-{}
-
-Cpu::~Cpu()
-{
- if (p_constraintCoreId){
- for (int i = 0; i < m_core; i++) {
- xbt_free(p_constraintCoreId[i]);
- }
- xbt_free(p_constraintCore);