} else if (chooser == "( [o]1 )1") {
XBT_INFO("### Test '%s'. A task in a VM on a PM.", chooser.c_str());
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
+ vm0 = pm0->create_vm("VM0", 1);
run_test_process("( [X]1 )1", vm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [oo]1 )1") {
XBT_INFO("### Test '%s'. 2 tasks co-located in a VM on a PM.", chooser.c_str());
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
+ vm0 = pm0->create_vm("VM0", 1);
run_test_process("( [Xo]1 )1", vm0, flop_amount / 2);
run_test_process("( [oX]1 )1", vm0, flop_amount / 2);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [ ]1 o )1") {
XBT_INFO("### Test '%s'. 1 task collocated with an empty VM", chooser.c_str());
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
+ vm0 = pm0->create_vm("VM0", 1);
run_test_process("( [ ]1 X )1", pm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [o]1 o )1") {
XBT_INFO("### Test '%s'. A task in a VM, plus a task", chooser.c_str());
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
+ vm0 = pm0->create_vm("VM0", 1);
run_test_process("( [X]1 o )1", vm0, flop_amount / 2);
run_test_process("( [o]1 X )1", pm0, flop_amount / 2);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [oo]1 o )1") {
XBT_INFO("### Test '%s'. 2 tasks in a VM, plus a task", chooser.c_str());
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
+ vm0 = pm0->create_vm("VM0", 1);
run_test_process("( [Xo]1 o )1", vm0, flop_amount / 4);
run_test_process("( [oX]1 o )1", vm0, flop_amount / 4);
run_test_process("( [oo]1 X )1", pm0, flop_amount / 2);
} else if (chooser == "( [o]1 )2") {
XBT_INFO("### Test '%s'. A task in a VM on a bicore PM", chooser.c_str());
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
+ vm0 = pm2->create_vm("VM0", 1);
run_test_process("( [X]1 )2", vm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [oo]1 )2") {
XBT_INFO("### Test '%s'. 2 tasks in a VM on a bicore PM", chooser.c_str());
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
+ vm0 = pm2->create_vm("VM0", 1);
run_test_process("( [Xx]1 )2", vm0, flop_amount / 2);
run_test_process("( [xX]1 )2", vm0, flop_amount / 2);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [ ]1 o )2") {
XBT_INFO("### Put a VM on a PM, and put a task to the PM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
+ vm0 = pm2->create_vm("VM0", 1);
run_test_process("( [ ]1 X )2", pm2, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [o]1 o )2") {
XBT_INFO("### Put a VM on a PM, put a task to the PM and a task to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
+ vm0 = pm2->create_vm("VM0", 1);
run_test_process("( [X]1 x )2", vm0, flop_amount);
run_test_process("( [x]1 X )2", pm2, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [o]1 [ ]1 )2") {
XBT_INFO("### Put two VMs on a PM, and put a task to one VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
- auto* vm1 = new simgrid::s4u::VirtualMachine("VM1", pm2, 1);
+ vm0 = pm2->create_vm("VM0", 1);
+ auto* vm1 = pm2->create_vm("VM1", 1);
run_test_process("( [X]1 [ ]1 )2", vm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [o]1 [o]1 )2") {
XBT_INFO("### Put two VMs on a PM, and put a task to each VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
- auto* vm1 = new simgrid::s4u::VirtualMachine("VM1", pm2, 1);
+ vm0 = pm2->create_vm("VM0", 1);
+ auto* vm1 = pm2->create_vm("VM1", 1);
run_test_process("( [X]1 [x]1 )2", vm0, flop_amount);
run_test_process("( [x]1 [X]1 )2", vm1, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [o]1 [o]1 [ ]1 )2") {
XBT_INFO("### Put three VMs on a PM, and put a task to two VMs");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
- auto* vm1 = new simgrid::s4u::VirtualMachine("VM1", pm2, 1);
- auto* vm2 = new simgrid::s4u::VirtualMachine("VM2", pm2, 1);
+ vm0 = pm2->create_vm("VM0", 1);
+ auto* vm1 = pm2->create_vm("VM1", 1);
+ auto* vm2 = pm2->create_vm("VM2", 1);
run_test_process("( [X]1 [x]1 [ ]1 )2", vm0, flop_amount);
run_test_process("( [x]1 [X]1 [ ]1 )2", vm1, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [o]1 [o]1 [o]1 )2") {
XBT_INFO("### Put three VMs on a PM, and put a task to each VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 1);
- auto* vm1 = new simgrid::s4u::VirtualMachine("VM1", pm2, 1);
- auto* vm2 = new simgrid::s4u::VirtualMachine("VM2", pm2, 1);
+ vm0 = pm2->create_vm("VM0", 1);
+ auto* vm1 = pm2->create_vm("VM1", 1);
+ auto* vm2 = pm2->create_vm("VM2", 1);
run_test_process("( [X]1 [o]1 [o]1 )2", vm0, flop_amount * 2 / 3);
run_test_process("( [o]1 [X]1 [o]1 )2", vm1, flop_amount * 2 / 3);
run_test_process("( [o]1 [o]1 [X]1 )2", vm2, flop_amount * 2 / 3);
} else if (chooser == "( [o]2 )2") {
XBT_INFO("### Put a VM on a PM, and put a task to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [X]2 )2", vm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [oo]2 )2") {
XBT_INFO("### Put a VM on a PM, and put two tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [Xo]2 )2", vm0, flop_amount);
run_test_process("( [oX]2 )2", vm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [ooo]2 )2") {
XBT_INFO("### Put a VM on a PM, and put three tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [Xoo]2 )2", vm0, flop_amount * 2 / 3);
run_test_process("( [oXo]2 )2", vm0, flop_amount * 2 / 3);
run_test_process("( [ooX]2 )2", vm0, flop_amount * 2 / 3);
} else if (chooser == "( [ ]2 o )2") {
XBT_INFO("### Put a VM on a PM, and put a task to the PM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [ ]2 X )2", pm2, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [o]2 o )2") {
XBT_INFO("### Put a VM on a PM, put one task to the PM and one task to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [o]2 X )2", pm2, flop_amount);
run_test_process("( [X]2 o )2", vm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [oo]2 o )2") {
XBT_INFO("### Put a VM on a PM, put one task to the PM and two tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [oo]2 X )2", pm2, flop_amount * 2 / 3);
run_test_process("( [Xo]2 o )2", vm0, flop_amount * 2 / 3);
run_test_process("( [oX]2 o )2", vm0, flop_amount * 2 / 3);
} else if (chooser == "( [ooo]2 o )2") {
XBT_INFO("### Put a VM on a PM, put one task to the PM and three tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [ooo]2 X )2", pm2, flop_amount * 2 / 3);
run_test_process("( [Xoo]2 o )2", vm0, (flop_amount * 4 / 3) / 3); // VM_share/3
run_test_process("( [oXo]2 o )2", vm0, (flop_amount * 4 / 3) / 3); // VM_share/3
} else if (chooser == "( [ ]2 oo )2") {
XBT_INFO("### Put a VM on a PM, and put two tasks to the PM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [ ]2 Xo )2", pm2, flop_amount);
run_test_process("( [ ]2 oX )2", pm2, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [o]2 oo )2") {
XBT_INFO("### Put a VM on a PM, put one task to the PM and one task to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [o]2 Xo )2", pm2, flop_amount * 2 / 3);
run_test_process("( [o]2 oX )2", pm2, flop_amount * 2 / 3);
run_test_process("( [X]2 oo )2", vm0, flop_amount * 2 / 3);
} else if (chooser == "( [oo]2 oo )2") {
XBT_INFO("### Put a VM on a PM, put one task to the PM and two tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [oo]2 Xo )2", pm2, flop_amount / 2);
run_test_process("( [oo]2 oX )2", pm2, flop_amount / 2);
run_test_process("( [Xo]2 oo )2", vm0, flop_amount / 2);
} else if (chooser == "( [ooo]2 oo )2") {
XBT_INFO("### Put a VM on a PM, put one task to the PM and three tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm2, 2);
+ vm0 = pm2->create_vm("VM0", 2);
run_test_process("( [ooo]2 Xo )2", pm2, flop_amount * 2 / 4);
run_test_process("( [ooo]2 oX )2", pm2, flop_amount * 2 / 4);
run_test_process("( [Xoo]2 oo )2", vm0, flop_amount / 3);
} else if (chooser == "( [o]2 )4") {
XBT_INFO("### Put a VM on a PM, and put a task to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [X]2 )4", vm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [oo]2 )4") {
XBT_INFO("### Put a VM on a PM, and put two tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [Xo]2 )4", vm0, flop_amount);
run_test_process("( [oX]2 )4", vm0, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [ooo]2 )4") {
XBT_INFO("### ( [ooo]2 )4: Put a VM on a PM, and put three tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [Xoo]2 )4", vm0, flop_amount * 2 / 3);
run_test_process("( [oXo]2 )4", vm0, flop_amount * 2 / 3);
run_test_process("( [ooX]2 )4", vm0, flop_amount * 2 / 3);
} else if (chooser == "( [ ]2 o )4") {
XBT_INFO("### Put a VM on a PM, and put a task to the PM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [ ]2 X )4", pm4, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
test_energy_consumption(chooser, 1);
} else if (chooser == "( [ ]2 oo )4") {
XBT_INFO("### Put a VM on a PM, and put two tasks to the PM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [ ]2 Xo )4", pm4, flop_amount);
run_test_process("( [ ]2 oX )4", pm4, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [ ]2 ooo )4") {
XBT_INFO("### Put a VM on a PM, and put three tasks to the PM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [ ]2 Xoo )4", pm4, flop_amount);
run_test_process("( [ ]2 oXo )4", pm4, flop_amount);
run_test_process("( [ ]2 ooX )4", pm4, flop_amount);
} else if (chooser == "( [ ]2 oooo )4") {
XBT_INFO("### Put a VM on a PM, and put four tasks to the PM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [ ]2 Xooo )4", pm4, flop_amount);
run_test_process("( [ ]2 oXoo )4", pm4, flop_amount);
run_test_process("( [ ]2 ooXo )4", pm4, flop_amount);
} else if (chooser == "( [o]2 o )4") {
XBT_INFO("### Put a VM on a PM, and put one task to the PM and one task to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [X]2 o )4", vm0, flop_amount);
run_test_process("( [o]2 X )4", pm4, flop_amount);
simgrid::s4u::this_actor::sleep_for(2);
} else if (chooser == "( [o]2 oo )4") {
XBT_INFO("### Put a VM on a PM, and put two tasks to the PM and one task to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [X]2 oo )4", vm0, flop_amount);
run_test_process("( [o]2 Xo )4", pm4, flop_amount);
run_test_process("( [o]2 oX )4", pm4, flop_amount);
} else if (chooser == "( [oo]2 oo )4") {
XBT_INFO("### Put a VM on a PM, and put two tasks to the PM and two tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [Xo]2 oo )4", vm0, flop_amount);
run_test_process("( [oX]2 oo )4", vm0, flop_amount);
run_test_process("( [oo]2 Xo )4", pm4, flop_amount);
} else if (chooser == "( [o]2 ooo )4") {
XBT_INFO("### Put a VM on a PM, and put three tasks to the PM and one tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [X]2 ooo )4", vm0, flop_amount);
run_test_process("( [o]2 Xoo )4", pm4, flop_amount);
run_test_process("( [o]2 oXo )4", pm4, flop_amount);
} else if (chooser == "( [oo]2 ooo )4") {
XBT_INFO("### Put a VM on a PM, and put three tasks to the PM and two tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [Xo]2 ooo )4", vm0, flop_amount * 4 / 5);
run_test_process("( [oX]2 ooo )4", vm0, flop_amount * 4 / 5);
run_test_process("( [oo]2 Xoo )4", pm4, flop_amount * 4 / 5);
} else if (chooser == "( [ooo]2 ooo )4") {
XBT_INFO("### Put a VM on a PM, and put three tasks to the PM and three tasks to the VM");
- vm0 = new simgrid::s4u::VirtualMachine("VM0", pm4, 2);
+ vm0 = pm4->create_vm("VM0", 2);
run_test_process("( [Xoo]2 ooo )4", vm0, (flop_amount * 8 / 5) / 3); // The VM has 8/5 of the PM
run_test_process("( [oXo]2 ooo )4", vm0, (flop_amount * 8 / 5) / 3);
run_test_process("( [ooX]2 ooo )4", vm0, (flop_amount * 8 / 5) / 3);