void surf_vm_model_init_HL13(simgrid::kernel::resource::CpuModel* cpu_pm_model)
{
- auto vm_model = std::make_shared<simgrid::vm::VMModel>();
- vm_model->set_name("VM_HL13");
+ auto vm_model = std::make_shared<simgrid::vm::VMModel>("VM_HL13");
- simgrid::kernel::EngineImpl::get_instance()->add_model(vm_model, {cpu_pm_model->get_name()});
+ simgrid::kernel::EngineImpl::get_instance()->add_model(vm_model, {cpu_pm_model});
std::shared_ptr<simgrid::kernel::resource::CpuModel> cpu_model_vm;
auto cpu_optim = simgrid::config::get_value<std::string>("cpu/optim");
if (cpu_optim == "TI") {
- cpu_model_vm = std::make_shared<simgrid::kernel::resource::CpuTiModel>();
- cpu_model_vm->set_name("VmCpu_TI");
+ cpu_model_vm = std::make_shared<simgrid::kernel::resource::CpuTiModel>("VmCpu_TI");
} else {
- cpu_model_vm = std::make_shared<simgrid::kernel::resource::CpuCas01Model>();
- cpu_model_vm->set_name("VmCpu_Cas01");
+ cpu_model_vm = std::make_shared<simgrid::kernel::resource::CpuCas01Model>("VmCpu_Cas01");
}
- simgrid::kernel::EngineImpl::get_instance()->add_model(cpu_model_vm,
- {cpu_pm_model->get_name(), vm_model->get_name()});
+ simgrid::kernel::EngineImpl::get_instance()->add_model(cpu_model_vm, {cpu_pm_model, vm_model.get()});
simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->set_cpu_vm_model(cpu_model_vm);
}
}
}
-VMModel::VMModel()
+VMModel::VMModel(const std::string& name) : HostModel(name)
{
s4u::Host::on_state_change.connect(host_state_change);
s4u::Exec::on_start.connect(add_active_exec);
* Resource *
************/
-VirtualMachineImpl::VirtualMachineImpl(simgrid::s4u::VirtualMachine* piface, simgrid::s4u::Host* host_PM,
- int core_amount, size_t ramsize)
- : HostImpl(piface), physical_host_(host_PM), core_amount_(core_amount), ramsize_(ramsize)
+VirtualMachineImpl::VirtualMachineImpl(const std::string& name, s4u::VirtualMachine* piface,
+ simgrid::s4u::Host* host_PM, int core_amount, size_t ramsize)
+ : HostImpl(name, piface), piface_(piface), physical_host_(host_PM), core_amount_(core_amount), ramsize_(ramsize)
{
/* Register this VM to the list of all VMs */
allVms_.push_back(piface);
-
/* We create cpu_action corresponding to a VM process on the host operating system. */
/* TODO: we have to periodically input GUESTOS_NOISE to the system? how ?
* The value for GUESTOS_NOISE corresponds to the cost of the global action associated to the VM. It corresponds to
// It's empty for now, so it should not request resources in the PM
update_action_weight();
- XBT_VERB("Create VM(%s)@PM(%s)", piface->get_cname(), physical_host_->get_cname());
+ XBT_VERB("Create VM(%s)@PM(%s)", name.c_str(), physical_host_->get_cname());
on_creation(*this);
}