- xbt_assert(speed_.scale > 0, "Available speed has to be >0");
-
- // Copy the power peak array:
- 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(speedPeakList_, &value);
- }
-
- /* 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->name().c_str(), i);
- p_constraintCore[i] = lmm_constraint_new(model->getMaxminSystem(), p_constraintCoreId[i], speed_.scale * speed_.peak);
- }
- }