public static void main(String[] args) {
Msg.init(args);
- Msg.liveMigrationInit();
String platfFile = "../../examples/platforms/small_platform.xml";
if (args.length >= 1)
public static void main(String[] args) throws MsgException {
Msg.init(args);
- Msg.liveMigrationInit();
if (args.length < 1) {
Msg.info("Usage : Main platform_file.xml");
System.exit(1);
> [132.765801] (1:master_@Fafard) Test: Migrate a VM with 100 Mbytes RAM
> [146.111793] (1:master_@Fafard) VM0 migrated: Fafard->Tremblay in 13.346 s
> [146.111793] (1:master_@Fafard) Test: Migrate two VMs at once from PM0 to PM1
-> [411.566271] (8:mig_wrk@Fafard) VM1 migrated: Fafard->Tremblay in 265.454 s
+> [411.566271] (7:mig_wrk@Fafard) VM1 migrated: Fafard->Tremblay in 265.454 s
> [411.566271] (6:mig_wrk@Fafard) VM0 migrated: Fafard->Tremblay in 265.454 s
> [10146.111793] (1:master_@Fafard) Test: Migrate two VMs at once to different PMs
-> [10362.620589] (14:mig_wrk@Fafard) VM1 migrated: Fafard->Bourassa in 216.509 s
+> [10362.620589] (13:mig_wrk@Fafard) VM1 migrated: Fafard->Bourassa in 216.509 s
> [10411.547334] (12:mig_wrk@Fafard) VM0 migrated: Fafard->Tremblay in 265.436 s
> [20146.111793] (0:maestro@) Bye (simulation time 20146.1)
#include "simgrid/forward.h"
#include "simgrid/host.h"
+#include "simgrid/plugins/live_migration.h"
#include "xbt/base.h"
#include "xbt/dict.h"
XBT_PUBLIC(int) MSG_vm_is_created(msg_vm_t vm);
XBT_PUBLIC(int) MSG_vm_is_running(msg_vm_t vm);
-XBT_PUBLIC(int) MSG_vm_is_migrating(msg_vm_t vm);
XBT_PUBLIC(int) MSG_vm_is_suspended(msg_vm_t vm);
XBT_PUBLIC(const char*) MSG_vm_get_name(msg_vm_t vm);
// TODO add VDI later
XBT_PUBLIC(msg_vm_t) MSG_vm_create_core(msg_host_t location, const char *name);
XBT_PUBLIC(msg_vm_t) MSG_vm_create_multicore(msg_host_t pm, const char* name, int coreAmount);
-XBT_PUBLIC(msg_vm_t)
-MSG_vm_create(msg_host_t ind_pm, const char* name, int coreAmount, int ramsize, int mig_netspeed, int dp_intensity);
+
+XBT_ATTRIB_DEPRECATED_v321("Use MSG_vm_create_migratable() from the live migration plugin: "
+ "v3.21 will drop MSG_vm_create() completely.") static msg_vm_t
+ MSG_vm_create(msg_host_t ind_pm, const char* name, int coreAmount, int ramsize, int mig_netspeed, int dp_intensity)
+{
+ return sg_vm_create_migratable(ind_pm, name, coreAmount, ramsize, mig_netspeed, dp_intensity);
+}
XBT_PUBLIC(void) MSG_vm_destroy(msg_vm_t vm);
XBT_PUBLIC(void) sg_vm_set_migration_speed(sg_vm_t vm, double speed);
XBT_PUBLIC(double) sg_vm_get_migration_speed(sg_vm_t vm);
XBT_PUBLIC(double) sg_vm_get_max_downtime(sg_vm_t vm);
+XBT_PUBLIC(int) sg_vm_is_migrating(sg_vm_t vm);
+XBT_PUBLIC(sg_vm_t)
+sg_vm_create_migratable(sg_host_t pm, const char* name, int coreAmount, int ramsize, int mig_netspeed,
+ int dp_intensity);
#define MSG_vm_live_migration_plugin_init() sg_vm_live_migration_plugin_init()
+
+#define MSG_vm_create_migratable(pm, name, coreAmount, ramsize, mig_netspeed, dp_intensity) \
+ sg_vm_create_migratable(pm, name, coreAmount, ramsize, mig_netspeed, dp_intensity)
+
+#define MSG_vm_is_migrating(vm) sg_vm_is_migrating(vm)
#define MSG_vm_migrate(vm, dst_pm) sg_vm_migrate(vm, dst_pm)
SG_END_DECL()
namespace vm {
class VirtualMachineImpl;
};
+
namespace s4u {
/** @ingroup s4u_api
*/
XBT_PUBLIC_CLASS VirtualMachine : public s4u::Host
{
+ simgrid::vm::VirtualMachineImpl* pimpl_vm_ = nullptr;
+ virtual ~VirtualMachine();
public:
explicit VirtualMachine(const char* name, s4u::Host* hostPm, int coreAmount);
VirtualMachine(VirtualMachine const&) = delete;
VirtualMachine& operator=(VirtualMachine const&) = delete;
-private:
- virtual ~VirtualMachine();
-public:
+ simgrid::vm::VirtualMachineImpl* getImpl() { return pimpl_vm_; }
void start();
void suspend();
void resume();
void shutdown();
+ void destroy();
bool isMigrating();
void setBound(double bound);
e_surf_vm_state_t getState();
-
- /* FIXME: protect me */
- simgrid::vm::VirtualMachineImpl* pimpl_vm_ = nullptr;
};
}
} // namespace simgrid::s4u
-#endif /* SIMGRID_S4U_HOST_HPP */
+#endif
argv[argc] = nullptr;
MSG_init(&argc, argv);
+ sg_vm_live_migration_plugin_init();
JAVA_HOST_LEVEL = simgrid::s4u::Host::extension_create(nullptr);
sg_host_energy_plugin_init();
}
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_liveMigrationInit()
-{
- sg_vm_live_migration_plugin_init();
-}
-
JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_fileSystemInit()
{
sg_storage_file_system_init();
msg_host_t host = jhost_get_native(env, jHost);
const char* name = env->GetStringUTFChars(jname, 0);
- msg_vm_t vm = MSG_vm_create(host, name, static_cast<int>(coreAmount), static_cast<int>(jramsize),
- static_cast<int>(jmig_netspeed), static_cast<int>(jdp_intensity));
+ msg_vm_t vm = MSG_vm_create_migratable(host, name, static_cast<int>(coreAmount), static_cast<int>(jramsize),
+ static_cast<int>(jmig_netspeed), static_cast<int>(jdp_intensity));
env->ReleaseStringUTFChars(jname, name);
jvm_bind(env, jVm, vm);
/** Tell the kernel that you want to use the energy plugin */
public static final native void energyInit();
public static final native void fileSystemInit();
- public static final native void liveMigrationInit();
/** Run the MSG simulation.
*
#include "simgrid/plugins/live_migration.h"
#include "src/instr/instr_private.hpp"
#include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include "src/plugins/vm/VmHostExt.hpp"
#include "simgrid/host.h"
#include "simgrid/simix.hpp"
{
vm->setRamsize(size);
}
+
size_t MSG_vm_get_ramsize(msg_vm_t vm)
{
return vm->getRamsize();
}
-/* **** Check state of a VM **** */
void MSG_vm_set_bound(msg_vm_t vm, double bound)
{
vm->setBound(bound);
}
-static inline int __MSG_vm_is_state(msg_vm_t vm, e_surf_vm_state_t state)
-{
- return vm->pimpl_vm_ != nullptr && vm->getState() == state;
-}
/** @brief Returns whether the given VM has just created, not running.
* @ingroup msg_VMs
*/
int MSG_vm_is_created(msg_vm_t vm)
{
- return __MSG_vm_is_state(vm, SURF_VM_STATE_CREATED);
+ return vm->getState() == SURF_VM_STATE_CREATED;
}
/** @brief Returns whether the given VM is currently running
*/
int MSG_vm_is_running(msg_vm_t vm)
{
- return __MSG_vm_is_state(vm, SURF_VM_STATE_RUNNING);
-}
-
-/** @brief Returns whether the given VM is currently migrating
- * @ingroup msg_VMs
- */
-int MSG_vm_is_migrating(msg_vm_t vm)
-{
- return vm->isMigrating();
+ return vm->getState() == SURF_VM_STATE_RUNNING;
}
/** @brief Returns whether the given VM is currently suspended, not running.
*/
int MSG_vm_is_suspended(msg_vm_t vm)
{
- return __MSG_vm_is_state(vm, SURF_VM_STATE_SUSPENDED);
+ return vm->getState() == SURF_VM_STATE_SUSPENDED;
}
/* **** ******** MSG vm actions ********* **** */
-/** @brief Create a new VM with specified parameters.
- * @ingroup msg_VMs*
- * @param pm Physical machine that will host the VM
- * @param name Must be unique
- * @param coreAmount Must be >= 1
- * @param ramsize [TODO]
- * @param mig_netspeed Amount of Mbyte/s allocated to the migration (cannot be larger than net_cap). Use 0 if unsure.
- * @param dp_intensity Dirty page percentage according to migNetSpeed, [0-100]. Use 0 if unsure.
- */
-msg_vm_t MSG_vm_create(msg_host_t pm, const char* name, int coreAmount, int ramsize, int mig_netspeed, int dp_intensity)
-{
- simgrid::vm::VmHostExt::ensureVmExtInstalled();
-
- /* For the moment, intensity_rate is the percentage against the migration bandwidth */
-
- msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount, static_cast<sg_size_t>(ramsize) * 1024 * 1024);
- if (not sg_vm_is_migratable(vm)) {
- if (mig_netspeed != 0 || dp_intensity != 0)
- XBT_WARN("The live migration is not enabled. dp_intensity and mig_netspeed can't be used");
- } else {
- 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_migration_speed(vm, mig_netspeed * 1024 * 1024.0);
-
- XBT_DEBUG("migspeed : %f intensity mem : %d", mig_netspeed * 1024 * 1024.0, dp_intensity);
- }
-
- return vm;
-}
-
/** @brief Create a new VM object with the default parameters
* @ingroup msg_VMs*
*
*/
msg_vm_t MSG_vm_create_core(msg_host_t pm, const char* name)
{
- xbt_assert(sg_host_by_name(name) == nullptr,
- "Cannot create a VM named %s: this name is already used by an host or a VM", name);
-
- msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, 1);
- return vm;
+ return MSG_vm_create_multicore(pm, name, 1);
}
/** @brief Create a new VM object with the default parameters, but with a specified amount of cores
* @ingroup msg_VMs*
xbt_assert(sg_host_by_name(name) == nullptr,
"Cannot create a VM named %s: this name is already used by an host or a VM", name);
- msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount);
- return vm;
+ return new simgrid::s4u::VirtualMachine(name, pm, coreAmount);
}
/** @brief Start a vm (i.e., boot the guest operating system)
void MSG_vm_start(msg_vm_t vm)
{
vm->start();
- if (TRACE_msg_vm_is_enabled()) {
- simgrid::instr::StateType* state = simgrid::instr::Container::byName(vm->getName())->getState("MSG_VM_STATE");
- state->addEntityValue("start", "0 0 1"); // start is blue
- state->pushEvent("start");
- }
}
/** @brief Immediately suspend the execution of all processes within the given VM.
void MSG_vm_suspend(msg_vm_t vm)
{
vm->suspend();
- if (TRACE_msg_vm_is_enabled()) {
- simgrid::instr::StateType* state = simgrid::instr::Container::byName(vm->getName())->getState("MSG_VM_STATE");
- state->addEntityValue("suspend", "1 0 0"); // suspend is red
- state->pushEvent("suspend");
- }
}
/** @brief Resume the execution of the VM. All processes on the VM run again.
void MSG_vm_resume(msg_vm_t vm)
{
vm->resume();
- if (TRACE_msg_vm_is_enabled())
- simgrid::instr::Container::byName(vm->getName())->getState("MSG_VM_STATE")->popEvent();
}
/** @brief Immediately kills all processes within the given VM.
*/
void MSG_vm_destroy(msg_vm_t vm)
{
- if (vm->isMigrating())
- THROWF(vm_error, 0, "Cannot destroy VM '%s', which is migrating.", vm->getCname());
-
- /* First, terminate all processes on the VM if necessary */
- vm->shutdown();
-
- /* Then, destroy the VM object */
vm->destroy();
-
- if (TRACE_msg_vm_is_enabled()) {
- container_t container = simgrid::instr::Container::byName(vm->getName());
- container->removeFromParent();
- delete container;
- }
}
-
}
if (vm->getPm() == &host)
trash.push_back(vm);
for (s4u::VirtualMachine* vm : trash)
- vm->pimpl_vm_->shutdown(SIMIX_process_self());
+ vm->shutdown();
}
}
VMModel::VMModel()
surf::Cpu* cpu = ws_vm->pimpl_cpu;
xbt_assert(cpu, "cpu-less host");
- double solved_value = ws_vm->pimpl_vm_->action_->getVariable()->get_value(); // this is X1 in comment above, what
+ double solved_value = ws_vm->getImpl()->action_->getVariable()->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->getCname(), ws_vm->pimpl_vm_->getPm()->getCname());
+ XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->getCname(), ws_vm->getPm()->getCname());
xbt_assert(cpu->model() == surf_cpu_model_vm);
lmm_system_t vcpu_system = cpu->model()->getMaxminSystem();
#include <simgrid/s4u/VirtualMachine.hpp>
#include <src/instr/instr_private.hpp>
#include <src/plugins/vm/VirtualMachineImpl.hpp>
+#include <src/plugins/vm/VmHostExt.hpp>
#include <src/plugins/vm/VmLiveMigration.hpp>
#include <xbt/ex.hpp>
vm_->resume();
// Now the VM is running on the new host (the migration is completed) (even if the SRC crash)
- vm_->pimpl_vm_->isMigrating = false;
+ vm_->getImpl()->isMigrating = false;
XBT_DEBUG("VM(%s) moved from PM(%s) to PM(%s)", vm_->getCname(), src_pm_->getCname(), dst_pm_->getCname());
if (TRACE_msg_vm_is_enabled()) {
}
SG_BEGIN_DECL()
+simgrid::s4u::VirtualMachine* sg_vm_create_migratable(simgrid::s4u::Host* pm, const char* name, int coreAmount,
+ int ramsize, int mig_netspeed, int dp_intensity)
+{
+ simgrid::vm::VmHostExt::ensureVmExtInstalled();
+
+ /* For the moment, intensity_rate is the percentage against the migration bandwidth */
+
+ msg_vm_t vm = new simgrid::s4u::VirtualMachine(name, pm, coreAmount, static_cast<sg_size_t>(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_migration_speed(vm, mig_netspeed * 1024 * 1024.0);
+
+ XBT_DEBUG("migspeed : %f intensity mem : %d", mig_netspeed * 1024 * 1024.0, dp_intensity);
+
+ return vm;
+}
+
+int sg_vm_is_migrating(simgrid::s4u::VirtualMachine* vm)
+{
+ return vm->isMigrating();
+}
+
void sg_vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm)
{
simgrid::s4u::Host* src_pm = vm->getPm();
if (vm->isMigrating())
THROWF(vm_error, 0, "Cannot migrate VM '%s' that is already migrating.", vm->getCname());
- vm->pimpl_vm_->isMigrating = true;
+ vm->getImpl()->isMigrating = true;
std::string rx_name =
std::string("__pr_mig_rx:") + vm->getCname() + "(" + src_pm->getCname() + "-" + dst_pm->getCname() + ")";
tx->join();
rx->join();
- vm->pimpl_vm_->isMigrating = false;
+ vm->getImpl()->isMigrating = false;
}
}
namespace s4u {
VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm, int coreAmount)
- : VirtualMachine(name, pm, coreAmount, 0)
+ : VirtualMachine(name, pm, coreAmount, 1024)
{
}
extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
if (TRACE_msg_vm_is_enabled()) {
- container_t host_container = simgrid::instr::Container::byName(pm->getName());
- new simgrid::instr::Container(name, "MSG_VM", host_container);
+ container_t host_container = instr::Container::byName(pm->getName());
+ new instr::Container(name, "MSG_VM", host_container);
+ instr::Container::byName(getName())->getState("MSG_VM_STATE")->addEntityValue("start", "0 0 1"); // start is blue
+ instr::Container::byName(getName())->getState("MSG_VM_STATE")->addEntityValue("suspend", "1 0 0"); // suspend is red
}
}
/* Don't free these things twice: they are the ones of my physical host */
pimpl_netpoint = nullptr;
+
+ if (TRACE_msg_vm_is_enabled()) {
+ container_t container = simgrid::instr::Container::byName(getName());
+ container->removeFromParent();
+ delete container;
+ }
}
void VirtualMachine::start()
{
+ if (TRACE_msg_vm_is_enabled())
+ simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->pushEvent("start");
+
simgrid::simix::kernelImmediate([this]() {
simgrid::vm::VmHostExt::ensureVmExtInstalled();
/* 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->pimpl_vm_->getPm())
- total_ramsize_of_vms += ws_vm->pimpl_vm_->getRamsize();
+ if (pm == ws_vm->getPm())
+ total_ramsize_of_vms += ws_vm->getRamsize();
if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) {
XBT_WARN("cannnot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
this->pimpl_vm_->setState(SURF_VM_STATE_RUNNING);
});
+
+ if (TRACE_msg_vm_is_enabled())
+ simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->popEvent();
}
void VirtualMachine::suspend()
{
smx_actor_t issuer = SIMIX_process_self();
simgrid::simix::kernelImmediate([this, issuer]() { pimpl_vm_->suspend(issuer); });
+ if (TRACE_msg_vm_is_enabled())
+ simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->pushEvent("suspend");
XBT_DEBUG("vm_suspend done");
}
void VirtualMachine::resume()
{
pimpl_vm_->resume();
+ if (TRACE_msg_vm_is_enabled())
+ simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->popEvent();
}
void VirtualMachine::shutdown()
simgrid::simix::kernelImmediate([this, issuer]() { pimpl_vm_->shutdown(issuer); });
}
+void VirtualMachine::destroy()
+{
+ if (isMigrating())
+ THROWF(vm_error, 0, "Cannot destroy VM '%s', which is migrating.", getCname());
+
+ /* First, terminate all processes on the VM if necessary */
+ shutdown();
+
+ /* Then, destroy the VM object */
+ Host::destroy();
+}
+
bool VirtualMachine::isMigrating()
{
return pimpl_vm_ && pimpl_vm_->isMigrating;
e_surf_vm_state_t VirtualMachine::getState()
{
- return pimpl_vm_->getState();
+ return simgrid::simix::kernelImmediate([this]() { return pimpl_vm_->getState(); });
}
size_t VirtualMachine::getRamsize()
* Model *
*********/
-/* Each VM has a dummy CPU action on the PM layer. This CPU action works as the
- * constraint (capacity) of the VM in the PM layer. If the VM does not have any
- * active task, the dummy CPU action must be deactivated, so that the VM does
- * not get any CPU share in the PM layer. */
+/* Each VM has a dummy CPU action on the PM layer. This CPU action works as the constraint (capacity) of the VM in the
+ * PM layer. If the VM does not have any active task, the dummy CPU action must be deactivated, so that the VM does not
+ * get any CPU share in the PM layer. */
void HostModel::ignoreEmptyVmInPmLMM()
{
/* iterate for all virtual machines */
int active_tasks = cpu->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->pimpl_vm_->coreAmount());
+ int impact = std::min(active_tasks, ws_vm->getImpl()->coreAmount());
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->pimpl_vm_->action_->setSharingWeight(1. / impact);
+ ws_vm->getImpl()->action_->setSharingWeight(1. / impact);
else
- ws_vm->pimpl_vm_->action_->setSharingWeight(0.);
+ ws_vm->getImpl()->action_->setSharingWeight(0.);
}
}
if (vm == nullptr)
return;
- if (vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->isTracking()) {
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->track(exec, exec->remains());
+ if (vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->isTracking()) {
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->track(exec, exec->remains());
} else {
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->track(exec, 0.0);
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->track(exec, 0.0);
}
}
/* 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->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->isTracking()) {
+ if (vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->isTracking()) {
double delta =
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getStoredRemains(exec) - exec->remains();
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->updateDirtyPageCount(delta);
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getStoredRemains(exec) - exec->remains();
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->updateDirtyPageCount(delta);
}
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->untrack(exec);
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->untrack(exec);
}
SG_BEGIN_DECL()
}
}
-int sg_vm_is_migratable(sg_vm_t vm)
-{
- return simgrid::vm::VmDirtyPageTrackingExt::EXTENSION_ID.valid();
-}
-
void sg_vm_start_dirty_page_tracking(sg_vm_t vm)
{
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->startTracking();
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->startTracking();
}
void sg_vm_stop_dirty_page_tracking(sg_vm_t vm)
{
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->stopTracking();
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->stopTracking();
}
double sg_vm_lookup_computed_flops(sg_vm_t vm)
{
- return vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->computedFlopsLookup();
+ return vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->computedFlopsLookup();
}
void sg_vm_set_dirty_page_intensity(sg_vm_t vm, double intensity)
{
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->setIntensity(intensity);
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->setIntensity(intensity);
}
double sg_vm_get_dirty_page_intensity(sg_vm_t vm)
{
- return vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getIntensity();
+ return vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getIntensity();
}
void sg_vm_set_working_set_memory(sg_vm_t vm, sg_size_t size)
{
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->setWorkingSetMemory(size);
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->setWorkingSetMemory(size);
}
sg_size_t sg_vm_get_working_set_memory(sg_vm_t vm)
{
- return vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getWorkingSetMemory();
+ return vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getWorkingSetMemory();
}
void sg_vm_set_migration_speed(sg_vm_t vm, double speed)
{
- vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->setMigrationSpeed(speed);
+ vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->setMigrationSpeed(speed);
}
double sg_vm_get_migration_speed(sg_vm_t vm)
{
- return vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getMigrationSpeed();
+ return vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getMigrationSpeed();
}
double sg_vm_get_max_downtime(sg_vm_t vm)
{
- return vm->pimpl_vm_->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getMaxDowntime();
+ return vm->getImpl()->extension<simgrid::vm::VmDirtyPageTrackingExt>()->getMaxDowntime();
}
SG_END_DECL()
// If it's a VM, take the corresponding PM
simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
if (vm) // If it's a VM, take the corresponding PM
- host = vm->pimpl_vm_->getPm();
+ host = vm->getPm();
// Get the host_energy extension for the relevant host
HostEnergy* host_energy = host->extension<HostEnergy>();
> [132.765801] (1:master_@Fafard) Test: Migrate a VM with 100 Mbytes RAM
> [146.111793] (1:master_@Fafard) VM0 migrated: Fafard->Tremblay in 13.346 s
> [146.111793] (1:master_@Fafard) Test: Migrate two VMs at once from PM0 to PM1
-> [411.566271] (9:mig_wrk@Fafard) VM1 migrated: Fafard->Tremblay in 265.454 s
+> [411.566271] (8:mig_wrk@Fafard) VM1 migrated: Fafard->Tremblay in 265.454 s
> [411.566271] (6:mig_wrk@Fafard) VM0 migrated: Fafard->Tremblay in 265.454 s
> [10146.111793] (1:master_@Fafard) Test: Migrate two VMs at once to different PMs
-> [10362.620589] (15:mig_wrk@Fafard) VM1 migrated: Fafard->Bourassa in 216.509 s
+> [10362.620589] (14:mig_wrk@Fafard) VM1 migrated: Fafard->Bourassa in 216.509 s
> [10411.547334] (12:mig_wrk@Fafard) VM0 migrated: Fafard->Tremblay in 265.436 s
> [20146.111793] (0:maestro@) Bye (simulation time 20146.1)