From 58de6e0115d311e93b28c712e9e74b89fd81d40a Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 21 Dec 2015 22:39:17 +0100 Subject: [PATCH] give all machines the exact same energetic profil, and adapt the tests accordingly --- .../energy/consumption/energy_consumption.tesh | 14 +++++++------- examples/msg/energy/vm/energy_vm.c | 18 +++++++++--------- examples/msg/energy/vm/energy_vm.tesh | 14 +++++++------- examples/platforms/energy_platform.xml | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/examples/msg/energy/consumption/energy_consumption.tesh b/examples/msg/energy/consumption/energy_consumption.tesh index a937e91de4..017188af41 100644 --- a/examples/msg/energy/consumption/energy_consumption.tesh +++ b/examples/msg/energy/consumption/energy_consumption.tesh @@ -4,20 +4,20 @@ p Testing the mechanism for computing host energy consumption ! output sort 19 $ $SG_TEST_EXENV energy/consumption/energy_consumption$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml ${srcdir:=.}/energy/consumption/deployment_consumption.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" -> [ 0.000000] (1:dvfs_test@MyHost1) Energetic profile: 95.0:200.0, 93.0:170.0, 90.0:150.0 +> [ 0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:200.0, 93.0:170.0, 90.0:150.0 > [ 0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J > [ 0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds -> [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=950.00 J +> [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J > [ 10.000000] (1:dvfs_test@MyHost1) Run a task for 100E6 flops -> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 95W to 200W depending on load; Energy dissipated=1150 J +> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 100W to 200W depending on load; Energy dissipated=1200 J > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 20000000.00 flop/s and is of 20000000.00 flop/s) > [ 11.000000] (1:dvfs_test@MyHost1) Run a task for 100E6 flops -> [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1900 J +> [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1950 J > [ 16.000000] (1:dvfs_test@MyHost1) Sleep for 4 seconds -> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2260 J +> [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2310 J > [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far. > [ 30.000000] (0:@) Total simulation time: 30.00 -> [ 30.000000] (0:@) Total energy of host MyHost1: 3160.000000 Joules +> [ 30.000000] (0:@) Total energy of host MyHost1: 3210.000000 Joules > [ 30.000000] (0:@) Total energy of host MyHost2: 2100.000000 Joules > [ 30.000000] (0:@) Total energy of host MyHost3: 3000.000000 Joules -> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=3160 J +> [ 30.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=3210 J diff --git a/examples/msg/energy/vm/energy_vm.c b/examples/msg/energy/vm/energy_vm.c index edc741b761..d05c3ffe15 100644 --- a/examples/msg/energy/vm/energy_vm.c +++ b/examples/msg/energy/vm/energy_vm.c @@ -33,13 +33,13 @@ static int dvfs(int argc, char *argv[]) /* Host 1 */ XBT_INFO("Creating and starting two VMs"); - msg_vm_t vm1 = MSG_vm_create(host1, "vm1", 4, 2048, 100, NULL, 1024 * 20, 10,50); - MSG_vm_start(vm1); - msg_vm_t vm2 = MSG_vm_create(host3, "vm2", 4, 2048, 100, NULL, 1024 * 20, 10,50); - MSG_vm_start(vm2); + msg_vm_t vm_host1 = MSG_vm_create(host1, "vm_host1", 4, 2048, 100, NULL, 1024 * 20, 10,50); + MSG_vm_start(vm_host1); + msg_vm_t vm_host3 = MSG_vm_create(host3, "vm_host3", 4, 2048, 100, NULL, 1024 * 20, 10,50); + MSG_vm_start(vm_host3); XBT_INFO("Create two tasks on Host1: one inside a VM, the other directly on the host"); - MSG_process_create("p11", worker_func, NULL, vm1); + MSG_process_create("p11", worker_func, NULL, vm_host1); MSG_process_create("p12", worker_func, NULL, host1); XBT_INFO("Create two tasks on Host2: both directly on the host"); @@ -47,16 +47,16 @@ static int dvfs(int argc, char *argv[]) MSG_process_create("p22", worker_func, NULL, host2); XBT_INFO("Create two tasks on Host3: both inside a VM"); - MSG_process_create("p31", worker_func, NULL, vm2); - MSG_process_create("p32", worker_func, NULL, vm2); + MSG_process_create("p31", worker_func, NULL, vm_host3); + MSG_process_create("p32", worker_func, NULL, vm_host3); XBT_INFO("Wait 5 seconds. The tasks are still running (they run for 3 seconds, but 2 tasks are co-located, so they run for 6 seconds)"); MSG_process_sleep(5); XBT_INFO("Wait another 5 seconds. The tasks stop at some point in between"); MSG_process_sleep(5); - MSG_vm_shutdown(vm1); - MSG_vm_shutdown(vm2); + MSG_vm_shutdown(vm_host1); + MSG_vm_shutdown(vm_host3); return 0; } diff --git a/examples/msg/energy/vm/energy_vm.tesh b/examples/msg/energy/vm/energy_vm.tesh index ce66ee7b33..bb5b40895a 100644 --- a/examples/msg/energy/vm/energy_vm.tesh +++ b/examples/msg/energy/vm/energy_vm.tesh @@ -4,8 +4,8 @@ p Testing the mechanism for computing host energy consumption in case of VMs $ $SG_TEST_EXENV energy/vm/energy_vm$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (1:dvfs@MyHost1) Creating and starting two VMs -> [ 0.000000] (0:@) Create VM(vm1)@PM(MyHost1) with 0 mounted disks -> [ 0.000000] (0:@) Create VM(vm2)@PM(MyHost3) with 0 mounted disks +> [ 0.000000] (0:@) Create VM(vm_host1)@PM(MyHost1) with 0 mounted disks +> [ 0.000000] (0:@) Create VM(vm_host3)@PM(MyHost3) with 0 mounted disks > [ 0.000000] (1:dvfs@MyHost1) Create two tasks on Host1: one inside a VM, the other directly on the host > [ 0.000000] (1:dvfs@MyHost1) Create two tasks on Host2: both directly on the host > [ 0.000000] (1:dvfs@MyHost1) Create two tasks on Host3: both inside a VM @@ -14,10 +14,10 @@ $ $SG_TEST_EXENV energy/vm/energy_vm$EXEEXT ${srcdir:=.}/../platforms/energy_pla > [ 6.000000] (4:p21@MyHost2) This worker is done. > [ 6.000000] (5:p22@MyHost2) This worker is done. > [ 6.000000] (3:p12@MyHost1) This worker is done. -> [ 6.000000] (2:p11@vm1) This worker is done. -> [ 6.000000] (6:p31@vm2) This worker is done. -> [ 6.000000] (7:p32@vm2) This worker is done. +> [ 6.000000] (2:p11@vm_host1) This worker is done. +> [ 6.000000] (6:p31@vm_host3) This worker is done. +> [ 6.000000] (7:p32@vm_host3) This worker is done. > [ 10.000000] (0:@) Total simulation time: 10.00; All hosts must have the exact same energy consumption. -> [ 10.000000] (0:@) Total energy of host MyHost1: 1580.000000 Joules > [ 10.000000] (0:@) Total energy of host MyHost2: 1600.000000 Joules -> [ 10.000000] (0:@) Total energy of host MyHost3: 1600.000000 Joules +> [ 10.000000] (0:@) Total energy of host vm_host1: 1600.000000 Joules +> [ 10.000000] (0:@) Total energy of host vm_host3: 1600.000000 Joules diff --git a/examples/platforms/energy_platform.xml b/examples/platforms/energy_platform.xml index 9e0e4ac85c..944d1dda91 100644 --- a/examples/platforms/energy_platform.xml +++ b/examples/platforms/energy_platform.xml @@ -7,7 +7,7 @@ - + -- 2.20.1