From a6957f33a8f941b49d923e43675d50fe2671a554 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 14 Jun 2018 22:50:44 +0200 Subject: [PATCH] start snake_casing VirtualMachine --- .../s4u/cloud-capping/s4u-cloud-capping.cpp | 8 ++--- .../cloud-migration/s4u-cloud-migration.cpp | 18 +++++----- .../s4u/cloud-simple/s4u-cloud-simple.cpp | 2 +- include/simgrid/kernel/routing/NetPoint.hpp | 2 +- include/simgrid/s4u/VirtualMachine.hpp | 26 ++++++++++---- src/plugins/dirty_page_tracking.cpp | 34 +++++++++---------- src/plugins/host_energy.cpp | 2 +- src/plugins/vm/VirtualMachineImpl.cpp | 8 ++--- src/plugins/vm/VmLiveMigration.cpp | 24 ++++++------- src/plugins/vm/VmLiveMigration.hpp | 4 +-- src/plugins/vm/s4u_VirtualMachine.cpp | 24 ++++++------- src/surf/HostImpl.cpp | 6 ++-- .../cloud-interrupt-migration.cpp | 4 +-- 13 files changed, 88 insertions(+), 74 deletions(-) diff --git a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp index 8d3872d0d2..07392b7f48 100644 --- a/examples/s4u/cloud-capping/s4u-cloud-capping.cpp +++ b/examples/s4u/cloud-capping/s4u-cloud-capping.cpp @@ -41,7 +41,7 @@ static void worker_busy_loop(const char* name, double speed) if (speed > 0) { double new_bound = (speed / 10) * i; XBT_INFO("set bound of VM1 to %f", new_bound); - static_cast(simgrid::s4u::this_actor::get_host())->setBound(new_bound); + static_cast(simgrid::s4u::this_actor::get_host())->set_bound(new_bound); } simgrid::s4u::this_actor::sleep_for(100); double exec_remain_now = exec->get_remaining(); @@ -189,7 +189,7 @@ static void master_main() vm0->destroy(); vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - vm0->setBound(pm0->getSpeed() / 10); + vm0->set_bound(pm0->getSpeed() / 10); vm0->start(); XBT_INFO("# 7. Put a single task on the VM capped by 10%%."); @@ -207,7 +207,7 @@ static void master_main() vm0->destroy(); vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - vm0->setRamsize(1e9); // 1GB + vm0->set_ramsize(1e9); // 1GB vm0->start(); double cpu_speed = pm0->getSpeed(); @@ -221,7 +221,7 @@ static void master_main() XBT_INFO(" "); XBT_INFO("# 10. (b) set 10%% bound to the VM, and then put a task on the VM."); - vm0->setBound(cpu_speed / 10); + vm0->set_bound(cpu_speed / 10); simgrid::s4u::Actor::create("worker0", vm0, worker, computation_amount, false, 0); simgrid::s4u::this_actor::sleep_for(1000); XBT_INFO(" "); diff --git a/examples/s4u/cloud-migration/s4u-cloud-migration.cpp b/examples/s4u/cloud-migration/s4u-cloud-migration.cpp index 46c11562e6..e53e714038 100644 --- a/examples/s4u/cloud-migration/s4u-cloud-migration.cpp +++ b/examples/s4u/cloud-migration/s4u-cloud-migration.cpp @@ -11,7 +11,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_cloud_migration, "Messages specific for this ex static void vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm) { - simgrid::s4u::Host* src_pm = vm->getPm(); + simgrid::s4u::Host* src_pm = vm->get_pm(); double mig_sta = simgrid::s4u::Engine::get_clock(); sg_vm_migrate(vm, dst_pm); double mig_end = simgrid::s4u::Engine::get_clock(); @@ -31,19 +31,19 @@ static void master_main() simgrid::s4u::Host* pm2 = simgrid::s4u::Host::by_name("Bourassa"); simgrid::s4u::VirtualMachine* vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - vm0->setRamsize(1e9); // 1Gbytes + vm0->set_ramsize(1e9); // 1Gbytes vm0->start(); - XBT_INFO("Test: Migrate a VM with %zu Mbytes RAM", vm0->getRamsize() / 1000 / 1000); + XBT_INFO("Test: Migrate a VM with %zu Mbytes RAM", vm0->get_ramsize() / 1000 / 1000); vm_migrate(vm0, pm1); vm0->destroy(); vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - vm0->setRamsize(1e8); // 100Mbytes + vm0->set_ramsize(1e8); // 100Mbytes vm0->start(); - XBT_INFO("Test: Migrate a VM with %zu Mbytes RAM", vm0->getRamsize() / 1000 / 1000); + XBT_INFO("Test: Migrate a VM with %zu Mbytes RAM", vm0->get_ramsize() / 1000 / 1000); vm_migrate(vm0, pm1); vm0->destroy(); @@ -51,8 +51,8 @@ static void master_main() vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); simgrid::s4u::VirtualMachine* vm1 = new simgrid::s4u::VirtualMachine("VM1", pm0, 1); - vm0->setRamsize(1e9); // 1Gbytes - vm1->setRamsize(1e9); // 1Gbytes + vm0->set_ramsize(1e9); // 1Gbytes + vm1->set_ramsize(1e9); // 1Gbytes vm0->start(); vm1->start(); @@ -67,8 +67,8 @@ static void master_main() vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); vm1 = new simgrid::s4u::VirtualMachine("VM1", pm0, 1); - vm0->setRamsize(1e9); // 1Gbytes - vm1->setRamsize(1e9); // 1Gbytes + vm0->set_ramsize(1e9); // 1Gbytes + vm1->set_ramsize(1e9); // 1Gbytes vm0->start(); vm1->start(); diff --git a/examples/s4u/cloud-simple/s4u-cloud-simple.cpp b/examples/s4u/cloud-simple/s4u-cloud-simple.cpp index e8cd04a13a..1d478691b6 100644 --- a/examples/s4u/cloud-simple/s4u-cloud-simple.cpp +++ b/examples/s4u/cloud-simple/s4u-cloud-simple.cpp @@ -193,7 +193,7 @@ static void master_main() " network one"); XBT_INFO("### Relocate VM0 between PM0 and PM1"); vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - vm0->setRamsize(1L * 1024 * 1024 * 1024); // 1GiB + vm0->set_ramsize(1L * 1024 * 1024 * 1024); // 1GiB vm0->start(); launch_communication_worker(vm0, pm2); diff --git a/include/simgrid/kernel/routing/NetPoint.hpp b/include/simgrid/kernel/routing/NetPoint.hpp index 94c0dd3994..77d184e7d0 100644 --- a/include/simgrid/kernel/routing/NetPoint.hpp +++ b/include/simgrid/kernel/routing/NetPoint.hpp @@ -26,7 +26,7 @@ class NetPoint : public simgrid::xbt::Extendable { public: enum class Type { Host, Router, NetZone }; - NetPoint(std::string name, NetPoint::Type componentType, NetZoneImpl* netzone_p); + NetPoint(std::string name, NetPoint::Type component_type, NetZoneImpl* netzone_p); ~NetPoint() = default; // Our rank in the vertices_ array of the netzone that contains us. diff --git a/include/simgrid/s4u/VirtualMachine.hpp b/include/simgrid/s4u/VirtualMachine.hpp index 0419fc0313..33f8183e7b 100644 --- a/include/simgrid/s4u/VirtualMachine.hpp +++ b/include/simgrid/s4u/VirtualMachine.hpp @@ -38,18 +38,18 @@ public: VirtualMachine(VirtualMachine const&) = delete; VirtualMachine& operator=(VirtualMachine const&) = delete; - simgrid::vm::VirtualMachineImpl* getImpl() { return pimpl_vm_; } + simgrid::vm::VirtualMachineImpl* get_impl() { return pimpl_vm_; } void start(); void suspend(); void resume(); void shutdown(); void destroy(); - simgrid::s4u::Host* getPm(); - void setPm(simgrid::s4u::Host * pm); - size_t getRamsize(); - void setRamsize(size_t ramsize); - void setBound(double bound); + simgrid::s4u::Host* get_pm(); + void set_pm(simgrid::s4u::Host* pm); + size_t get_ramsize(); + void set_ramsize(size_t ramsize); + void set_bound(double bound); e_surf_vm_state_t getState(); static simgrid::xbt::signal on_start; @@ -57,6 +57,20 @@ public: static simgrid::xbt::signal on_shutdown; static simgrid::xbt::signal on_suspend; static simgrid::xbt::signal on_resume; + + // Deprecated methods + XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_impl()") simgrid::vm::VirtualMachineImpl* getImpl() + { + return pimpl_vm_; + } + XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_pm()") simgrid::s4u::Host* getPm() { return get_pm(); } + XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_pm()") void setPm(simgrid::s4u::Host* pm) { set_pm(pm); } + XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_ramsize()") size_t getRamsize() { return get_ramsize(); } + XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_ramsize()") void setRamsize(size_t ramsize) + { + set_ramsize(ramsize); + } + XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_bound()") void setBound(double bound) { set_bound(bound); } }; } } // namespace simgrid::s4u diff --git a/src/plugins/dirty_page_tracking.cpp b/src/plugins/dirty_page_tracking.cpp index 904b52f293..93ce35b562 100644 --- a/src/plugins/dirty_page_tracking.cpp +++ b/src/plugins/dirty_page_tracking.cpp @@ -77,10 +77,10 @@ static void onExecCreation(simgrid::kernel::activity::ExecImplPtr exec) if (vm == nullptr) return; - if (vm->getImpl()->extension()->is_tracking()) { - vm->getImpl()->extension()->track(exec, exec->get_remaining()); + if (vm->get_impl()->extension()->is_tracking()) { + vm->get_impl()->extension()->track(exec, exec->get_remaining()); } else { - vm->getImpl()->extension()->track(exec, 0.0); + vm->get_impl()->extension()->track(exec, 0.0); } } @@ -92,12 +92,12 @@ static void onExecCompletion(simgrid::kernel::activity::ExecImplPtr exec) /* If we are in the middle of dirty page tracking, we record how much computation has been done until now, and keep * the information for the lookup_() function that will called soon. */ - if (vm->getImpl()->extension()->is_tracking()) { - double delta = vm->getImpl()->extension()->get_stored_remains(exec) - + if (vm->get_impl()->extension()->is_tracking()) { + double delta = vm->get_impl()->extension()->get_stored_remains(exec) - exec->get_remaining(); - vm->getImpl()->extension()->update_dirty_page_count(delta); + vm->get_impl()->extension()->update_dirty_page_count(delta); } - vm->getImpl()->extension()->untrack(exec); + vm->get_impl()->extension()->untrack(exec); } void sg_vm_dirty_page_tracking_init() @@ -113,50 +113,50 @@ void sg_vm_dirty_page_tracking_init() void sg_vm_start_dirty_page_tracking(sg_vm_t vm) { - vm->getImpl()->extension()->start_tracking(); + vm->get_impl()->extension()->start_tracking(); } void sg_vm_stop_dirty_page_tracking(sg_vm_t vm) { - vm->getImpl()->extension()->stop_tracking(); + vm->get_impl()->extension()->stop_tracking(); } double sg_vm_lookup_computed_flops(sg_vm_t vm) { - return vm->getImpl()->extension()->computed_flops_lookup(); + return vm->get_impl()->extension()->computed_flops_lookup(); } void sg_vm_set_dirty_page_intensity(sg_vm_t vm, double intensity) { - vm->getImpl()->extension()->set_intensity(intensity); + vm->get_impl()->extension()->set_intensity(intensity); } double sg_vm_get_dirty_page_intensity(sg_vm_t vm) { - return vm->getImpl()->extension()->get_intensity(); + return vm->get_impl()->extension()->get_intensity(); } void sg_vm_set_working_set_memory(sg_vm_t vm, sg_size_t size) { - vm->getImpl()->extension()->set_working_set_memory(size); + vm->get_impl()->extension()->set_working_set_memory(size); } sg_size_t sg_vm_get_working_set_memory(sg_vm_t vm) { - return vm->getImpl()->extension()->get_working_set_memory(); + return vm->get_impl()->extension()->get_working_set_memory(); } void sg_vm_set_migration_speed(sg_vm_t vm, double speed) { - vm->getImpl()->extension()->set_migration_speed(speed); + vm->get_impl()->extension()->set_migration_speed(speed); } double sg_vm_get_migration_speed(sg_vm_t vm) { - return vm->getImpl()->extension()->get_migration_speed(); + return vm->get_impl()->extension()->get_migration_speed(); } double sg_vm_get_max_downtime(sg_vm_t vm) { - return vm->getImpl()->extension()->get_max_downtime(); + return vm->get_impl()->extension()->get_max_downtime(); } diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index c5d0f67801..a6fce05a39 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -390,7 +390,7 @@ static void onActionStateChange(simgrid::surf::CpuAction* action) // If it's a VM, take the corresponding PM simgrid::s4u::VirtualMachine* vm = dynamic_cast(host); if (vm) // If it's a VM, take the corresponding PM - host = vm->getPm(); + host = vm->get_pm(); // Get the host_energy extension for the relevant host HostEnergy* host_energy = host->extension(); diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index e57230a484..1ecf9eef92 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -47,7 +47,7 @@ static void hostStateChange(s4u::Host& host) std::vector trash; /* Find all VMs living on that host */ for (s4u::VirtualMachine* const& vm : VirtualMachineImpl::allVms_) - if (vm->getPm() == &host) + if (vm->get_pm() == &host) trash.push_back(vm); for (s4u::VirtualMachine* vm : trash) vm->shutdown(); @@ -90,9 +90,9 @@ double VMModel::next_occuring_event(double now) surf::Cpu* cpu = ws_vm->pimpl_cpu; double solved_value = - ws_vm->getImpl()->action_->get_variable()->get_value(); // this is X1 in comment above, what - // this VM got in the sharing on the PM - XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->get_cname(), ws_vm->getPm()->get_cname()); + ws_vm->get_impl()->action_->get_variable()->get_value(); // this is X1 in comment above, what + // this VM got in the sharing on the PM + XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->get_cname(), ws_vm->get_pm()->get_cname()); xbt_assert(cpu->get_model() == surf_cpu_model_vm); kernel::lmm::System* vcpu_system = cpu->get_model()->get_maxmin_system(); diff --git a/src/plugins/vm/VmLiveMigration.cpp b/src/plugins/vm/VmLiveMigration.cpp index bd1f00d000..0d11db6de0 100644 --- a/src/plugins/vm/VmLiveMigration.cpp +++ b/src/plugins/vm/VmLiveMigration.cpp @@ -46,11 +46,11 @@ void MigrationRx::operator()() xbt_assert(vm_->getState() == SURF_VM_STATE_SUSPENDED); /* Update the vm location and resume it */ - vm_->setPm(dst_pm_); + vm_->set_pm(dst_pm_); vm_->resume(); // Now the VM is running on the new host (the migration is completed) (even if the SRC crash) - vm_->getImpl()->is_migrating_ = false; + vm_->get_impl()->is_migrating_ = false; XBT_DEBUG("VM(%s) moved from PM(%s) to PM(%s)", vm_->get_cname(), src_pm_->get_cname(), dst_pm_->get_cname()); if (TRACE_vm_is_enabled()) { @@ -134,8 +134,8 @@ void MigrationTx::operator()() { XBT_DEBUG("mig: tx_start"); - double host_speed = vm_->getPm()->getSpeed(); - const sg_size_t ramsize = vm_->getRamsize(); + double host_speed = vm_->get_pm()->getSpeed(); + const sg_size_t ramsize = vm_->get_ramsize(); const double dp_rate = host_speed ? (sg_vm_get_migration_speed(vm_) * sg_vm_get_dirty_page_intensity(vm_)) / host_speed : 1; const sg_size_t dp_cap = sg_vm_get_working_set_memory(vm_); @@ -285,11 +285,11 @@ void MigrationTx::operator()() static void onVirtualMachineShutdown(simgrid::s4u::VirtualMachine& vm) { - if (vm.getImpl()->is_migrating_) { + if (vm.get_impl()->is_migrating_) { vm.extension()->rx_->kill(); vm.extension()->tx_->kill(); vm.extension()->issuer_->kill(); - vm.getImpl()->is_migrating_ = false; + vm.get_impl()->is_migrating_ = false; } } @@ -316,7 +316,7 @@ simgrid::s4u::VirtualMachine* sg_vm_create_migratable(simgrid::s4u::Host* pm, co sg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount, static_cast(ramsize) * 1024 * 1024); sg_vm_set_dirty_page_intensity(vm, dp_intensity / 100.0); - sg_vm_set_working_set_memory(vm, vm->getRamsize() * 0.9); // assume working set memory is 90% of ramsize + sg_vm_set_working_set_memory(vm, vm->get_ramsize() * 0.9); // assume working set memory is 90% of ramsize sg_vm_set_migration_speed(vm, mig_netspeed * 1024 * 1024.0); XBT_DEBUG("migspeed : %f intensity mem : %d", mig_netspeed * 1024 * 1024.0, dp_intensity); @@ -326,12 +326,12 @@ simgrid::s4u::VirtualMachine* sg_vm_create_migratable(simgrid::s4u::Host* pm, co int sg_vm_is_migrating(simgrid::s4u::VirtualMachine* vm) { - return vm->getImpl()->is_migrating_; + return vm->get_impl()->is_migrating_; } void sg_vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm) { - simgrid::s4u::Host* src_pm = vm->getPm(); + simgrid::s4u::Host* src_pm = vm->get_pm(); if (src_pm->is_off()) THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->get_cname(), @@ -340,10 +340,10 @@ void sg_vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm) THROWF(vm_error, 0, "Cannot migrate VM '%s' to host '%s', which is offline.", vm->get_cname(), dst_pm->get_cname()); if (vm->getState() != SURF_VM_STATE_RUNNING) THROWF(vm_error, 0, "Cannot migrate VM '%s' that is not running yet.", vm->get_cname()); - if (vm->getImpl()->is_migrating_) + if (vm->get_impl()->is_migrating_) THROWF(vm_error, 0, "Cannot migrate VM '%s' that is already migrating.", vm->get_cname()); - vm->getImpl()->is_migrating_ = true; + vm->get_impl()->is_migrating_ = true; std::string rx_name = std::string("__pr_mig_rx:") + vm->get_cname() + "(" + src_pm->get_cname() + "-" + dst_pm->get_cname() + ")"; @@ -365,5 +365,5 @@ void sg_vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm) tx->join(); rx->join(); - vm->getImpl()->is_migrating_ = false; + vm->get_impl()->is_migrating_ = false; } diff --git a/src/plugins/vm/VmLiveMigration.hpp b/src/plugins/vm/VmLiveMigration.hpp index f942710737..911f92789c 100644 --- a/src/plugins/vm/VmLiveMigration.hpp +++ b/src/plugins/vm/VmLiveMigration.hpp @@ -38,7 +38,7 @@ class MigrationRx { public: explicit MigrationRx(s4u::VirtualMachine* vm, s4u::Host* dst_pm) : vm_(vm), dst_pm_(dst_pm) { - src_pm_ = vm_->getPm(); + src_pm_ = vm_->get_pm(); mbox_ctl = s4u::Mailbox::by_name(std::string("__mbox_mig_ctl:") + vm_->get_cname() + "(" + src_pm_->get_cname() + "-" + dst_pm_->get_cname() + ")"); @@ -58,7 +58,7 @@ class MigrationTx { public: explicit MigrationTx(s4u::VirtualMachine* vm, s4u::Host* dst_pm) : vm_(vm), dst_pm_(dst_pm) { - src_pm_ = vm_->getPm(); + src_pm_ = vm_->get_pm(); mbox = s4u::Mailbox::by_name(std::string("__mbox_mig_src_dst:") + vm_->get_cname() + "(" + src_pm_->get_cname() + "-" + dst_pm_->get_cname() + ")"); } diff --git a/src/plugins/vm/s4u_VirtualMachine.cpp b/src/plugins/vm/s4u_VirtualMachine.cpp index 5ba43bdf20..a3c9efdf07 100644 --- a/src/plugins/vm/s4u_VirtualMachine.cpp +++ b/src/plugins/vm/s4u_VirtualMachine.cpp @@ -78,14 +78,14 @@ void VirtualMachine::start() long pm_ramsize = pm->extension()->ramsize; int pm_overcommit = pm->extension()->overcommit; - long vm_ramsize = this->getRamsize(); + long vm_ramsize = this->get_ramsize(); if (pm_ramsize && not pm_overcommit) { /* Only verify that we don't overcommit on need */ /* Retrieve the memory occupied by the VMs on that host. Yep, we have to traverse all VMs of all hosts for that */ long total_ramsize_of_vms = 0; for (simgrid::s4u::VirtualMachine* const& ws_vm : simgrid::vm::VirtualMachineImpl::allVms_) - if (pm == ws_vm->getPm()) - total_ramsize_of_vms += ws_vm->getRamsize(); + if (pm == ws_vm->get_pm()) + total_ramsize_of_vms += ws_vm->get_ramsize(); if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) { XBT_WARN("cannot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).", @@ -130,12 +130,12 @@ void VirtualMachine::destroy() Host::destroy(); } -simgrid::s4u::Host* VirtualMachine::getPm() +simgrid::s4u::Host* VirtualMachine::get_pm() { return pimpl_vm_->get_physical_host(); } -void VirtualMachine::setPm(simgrid::s4u::Host* pm) +void VirtualMachine::set_pm(simgrid::s4u::Host* pm) { simgrid::simix::simcall([this, pm]() { pimpl_vm_->set_physical_host(pm); }); } @@ -145,12 +145,12 @@ e_surf_vm_state_t VirtualMachine::getState() return simgrid::simix::simcall([this]() { return pimpl_vm_->get_state(); }); } -size_t VirtualMachine::getRamsize() +size_t VirtualMachine::get_ramsize() { return pimpl_vm_->get_ramsize(); } -void VirtualMachine::setRamsize(size_t ramsize) +void VirtualMachine::set_ramsize(size_t ramsize) { pimpl_vm_->set_ramsize(ramsize); } @@ -180,7 +180,7 @@ void VirtualMachine::setRamsize(size_t ramsize) * 2. Note that bound == 0 means no bound (i.e., unlimited). But, if a host has multiple CPU cores, the CPU share of a * computation task (or a VM) never exceeds the capacity of a CPU core. */ -void VirtualMachine::setBound(double bound) +void VirtualMachine::set_bound(double bound) { simgrid::simix::simcall([this, bound]() { pimpl_vm_->set_bound(bound); }); } @@ -216,22 +216,22 @@ const char* sg_vm_get_name(sg_vm_t vm) /** @brief Get the physical host of a given VM. */ sg_host_t sg_vm_get_pm(sg_vm_t vm) { - return vm->getPm(); + return vm->get_pm(); } void sg_vm_set_ramsize(sg_vm_t vm, size_t size) { - vm->setRamsize(size); + vm->set_ramsize(size); } size_t sg_vm_get_ramsize(sg_vm_t vm) { - return vm->getRamsize(); + return vm->get_ramsize(); } void sg_vm_set_bound(sg_vm_t vm, double bound) { - vm->setBound(bound); + vm->set_bound(bound); } /** @brief Returns whether the given VM has just created, not running. */ diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index 5623d6b176..ef849d34fe 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -32,13 +32,13 @@ void HostModel::ignore_empty_vm_in_pm_LMM() int active_tasks = cpu->get_constraint()->get_variable_amount(); /* The impact of the VM over its PM is the min between its vCPU amount and the amount of tasks it contains */ - int impact = std::min(active_tasks, ws_vm->getImpl()->get_core_amount()); + int impact = std::min(active_tasks, ws_vm->get_impl()->get_core_amount()); XBT_DEBUG("set the weight of the dummy CPU action of VM%p on PM to %d (#tasks: %d)", ws_vm, impact, active_tasks); if (impact > 0) - ws_vm->getImpl()->action_->set_priority(1. / impact); + ws_vm->get_impl()->action_->set_priority(1. / impact); else - ws_vm->getImpl()->action_->set_priority(0.); + ws_vm->get_impl()->action_->set_priority(0.); } } diff --git a/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp b/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp index da1efbb718..bf6d4b4b1b 100644 --- a/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp +++ b/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp @@ -11,7 +11,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_cloud_interrupt_migration, "Messages specific f static void vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm) { - simgrid::s4u::Host* src_pm = vm->getPm(); + simgrid::s4u::Host* src_pm = vm->get_pm(); double mig_sta = simgrid::s4u::Engine::get_clock(); sg_vm_migrate(vm, dst_pm); double mig_end = simgrid::s4u::Engine::get_clock(); @@ -30,7 +30,7 @@ static void master_main() simgrid::s4u::Host* pm1 = simgrid::s4u::Host::by_name("Tremblay"); simgrid::s4u::VirtualMachine* vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1); - vm0->setRamsize(1e9); // 1Gbytes + vm0->set_ramsize(1e9); // 1Gbytes vm0->start(); XBT_INFO("Start the migration of %s from %s to %s", vm0->get_cname(), pm0->get_cname(), pm1->get_cname()); -- 2.20.1