X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0199ba108d66c94df94e4f044994e79efdece4b1..206a2b027325f16558bdf3f673da223a8a4921d4:/src/plugins/vm/VirtualMachineImpl.cpp diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index 61e2e33f00..0f389ca840 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -20,8 +20,9 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_vm, ker_resource, "Virtual Machines, contain void surf_vm_model_init_HL13(simgrid::kernel::resource::CpuModel* cpu_pm_model) { auto vm_model = std::make_shared("VM_HL13"); + auto* engine = simgrid::kernel::EngineImpl::get_instance(); - simgrid::kernel::EngineImpl::get_instance()->add_model(vm_model, {cpu_pm_model}); + engine->add_model(vm_model, {cpu_pm_model}); std::shared_ptr cpu_model_vm; auto cpu_optim = simgrid::config::get_value("cpu/optim"); @@ -30,8 +31,8 @@ void surf_vm_model_init_HL13(simgrid::kernel::resource::CpuModel* cpu_pm_model) } else { cpu_model_vm = std::make_shared("VmCpu_Cas01"); } - 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); + engine->add_model(cpu_model_vm, {cpu_pm_model, vm_model.get()}); + engine->get_netzone_root()->set_cpu_vm_model(cpu_model_vm); } namespace simgrid { @@ -156,7 +157,7 @@ double VMModel::next_occurring_event(double now) if (ws_vm->get_state() == s4u::VirtualMachine::State::SUSPENDED) // Ignore suspended VMs continue; - const kernel::resource::CpuImpl* cpu = ws_vm->pimpl_cpu; + const kernel::resource::CpuImpl* cpu = ws_vm->get_cpu(); // solved_value below is X1 in comment above: what this VM got in the sharing on the PM double solved_value = ws_vm->get_vm_impl()->get_action()->get_rate(); @@ -184,7 +185,7 @@ VirtualMachineImpl::VirtualMachineImpl(const std::string& name, s4u::VirtualMach * The value for GUESTOS_NOISE corresponds to the cost of the global action associated to the VM. It corresponds to * the cost of a VM running no tasks. */ - action_ = physical_host_->pimpl_cpu->execution_start(0, core_amount_); + action_ = physical_host_->get_cpu()->execution_start(0, core_amount_); // It's empty for now, so it should not request resources in the PM update_action_weight(); @@ -288,13 +289,13 @@ void VirtualMachineImpl::set_physical_host(s4u::Host* destination) piface_->set_netpoint(destination->get_netpoint()); /* Adapt the speed, pstate and other physical characteristics to the one of our new physical CPU */ - piface_->pimpl_cpu->reset_vcpu(destination->pimpl_cpu); + piface_->get_cpu()->reset_vcpu(destination->get_cpu()); physical_host_ = destination; /* Update vcpu's action for the new pm */ /* create a cpu action bound to the pm model at the destination. */ - kernel::resource::CpuAction* new_cpu_action = destination->pimpl_cpu->execution_start(0, this->core_amount_); + kernel::resource::CpuAction* new_cpu_action = destination->get_cpu()->execution_start(0, this->core_amount_); if (action_->get_remains_no_update() > 0) XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->get_remains_no_update());