void CpuTiModel::create_pm_vm_models()
{
- xbt_assert(surf_cpu_model_pm == nullptr, "CPU model already initialized. This should not happen.");
-
- surf_cpu_model_pm = new CpuTiModel();
- models_by_type[simgrid::kernel::resource::Model::Type::CPU_PM].push_back(surf_cpu_model_pm);
+ auto cpu_model_pm = new CpuTiModel();
+ models_by_type[simgrid::kernel::resource::Model::Type::CPU_PM].push_back(cpu_model_pm);
auto cpu_model_vm = new CpuTiModel();
models_by_type[simgrid::kernel::resource::Model::Type::CPU_VM].push_back(cpu_model_vm);
}
CpuTiModel::~CpuTiModel()
{
- surf_cpu_model_pm = nullptr;
}
Cpu* CpuTiModel::create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate)
sum_priority_ = 0.0;
for (CpuTiAction const& action : action_set_) {
/* action not running, skip it */
- if (action.get_state_set() != surf_cpu_model_pm->get_started_action_set())
+ if (action.get_state_set() != get_model()->get_started_action_set())
continue;
/* bogus priority, skip it */
for (CpuTiAction& action : action_set_) {
double min_finish = -1;
/* action not running, skip it */
- if (action.get_state_set() != surf_cpu_model_pm->get_started_action_set())
+ if (action.get_state_set() != get_model()->get_started_action_set())
continue;
/* verify if the action is really running on cpu */