#include "src/surf/cpu_cas01.hpp"
#include "src/surf/cpu_ti.hpp"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_vm, ker_resource, "Virtual Machines, containing actors and mobile accross hosts");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_vm, ker_resource, "Virtual Machines, containing actors and mobile across hosts");
void surf_vm_model_init_HL13(simgrid::kernel::resource::CpuModel* cpu_pm_model)
{
{
const s4u::VirtualMachine* vm = dynamic_cast<s4u::VirtualMachine*>(task.get_host());
if (vm != nullptr) {
- VirtualMachineImpl* vm_impl = vm->get_impl();
+ VirtualMachineImpl* vm_impl = vm->get_vm_impl();
vm_impl->add_active_exec();
vm_impl->update_action_weight();
}
{
const s4u::VirtualMachine* vm = dynamic_cast<s4u::VirtualMachine*>(task.get_host());
if (vm != nullptr) {
- VirtualMachineImpl* vm_impl = vm->get_impl();
+ VirtualMachineImpl* vm_impl = vm->get_vm_impl();
vm_impl->remove_active_exec();
vm_impl->update_action_weight();
}
{
const s4u::VirtualMachine* vm = get_vm_from_activity(act);
if (vm != nullptr) {
- VirtualMachineImpl* vm_impl = vm->get_impl();
+ VirtualMachineImpl* vm_impl = vm->get_vm_impl();
vm_impl->add_active_exec();
vm_impl->update_action_weight();
}
{
const s4u::VirtualMachine* vm = get_vm_from_activity(act);
if (vm != nullptr) {
- VirtualMachineImpl* vm_impl = vm->get_impl();
+ VirtualMachineImpl* vm_impl = vm->get_vm_impl();
vm_impl->remove_active_exec();
vm_impl->update_action_weight();
}
const kernel::resource::Cpu* cpu = ws_vm->pimpl_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_impl()->get_action()->get_variable()->get_value();
+ double solved_value = ws_vm->get_vm_impl()->get_action()->get_variable()->get_value();
XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->get_cname(), ws_vm->get_pm()->get_cname());
kernel::lmm::System* vcpu_system = cpu->get_model()->get_maxmin_system();
* 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);
}