From 263a17d4bf8f74a7224572117adfc1d3a5470056 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Thu, 2 Jun 2016 17:47:49 +0200 Subject: [PATCH] try to make TestHostOnOff do something + kill a redundant platform + adapt another one + update other tests (including broken ones) + ... still not functional --- examples/java/cloud/migration/Main.java | 2 +- examples/java/cloud/migration/Test.java | 20 ++--- .../java/cloud/migration/TestHostOnOff.java | 40 ++++----- .../java/cloud/migration/cloud_migration.tesh | 58 ++++++------- .../msg/cloud-multicore/cloud-multicore.c | 86 +++++++++---------- .../msg/cloud-multicore/cloud-multicore.tesh | 18 ++-- examples/platforms/three_multicore_hosts.xml | 8 +- examples/platforms/two_hosts_platform.xml | 10 --- examples/s4u/basic/s4u_basic.cpp | 6 +- examples/s4u/basic/s4u_basic.tesh | 10 +-- tools/cmake/DefinePackages.cmake | 1 - 11 files changed, 123 insertions(+), 136 deletions(-) delete mode 100644 examples/platforms/two_hosts_platform.xml diff --git a/examples/java/cloud/migration/Main.java b/examples/java/cloud/migration/Main.java index 244569f6e5..af1aa2586b 100644 --- a/examples/java/cloud/migration/Main.java +++ b/examples/java/cloud/migration/Main.java @@ -32,7 +32,7 @@ public class Main { /* construct the platform and deploy the application */ Msg.createEnvironment(args[0]); - new cloud.migration.Test("host0","Test").start(); + new cloud.migration.Test("PM0","Test").start(); Msg.run(); } } diff --git a/examples/java/cloud/migration/Test.java b/examples/java/cloud/migration/Test.java index 5eee62d9ee..2e59f4be21 100644 --- a/examples/java/cloud/migration/Test.java +++ b/examples/java/cloud/migration/Test.java @@ -27,8 +27,8 @@ public class Test extends Process{ Host host1 = null; try { - host0 = Host.getByName("host0"); - host1 = Host.getByName("host1"); + host0 = Host.getByName("PM0"); + host1 = Host.getByName("PM1"); }catch (HostNotFoundException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } @@ -114,31 +114,31 @@ public class Test extends Process{ Msg.info("Round trip of VM1 (load "+load1+"%)"); vm1.setLoad(load1); - Msg.info(" - Launch migration from host 0 to host 1"); + Msg.info(" - Launch migration from PM0 to PM1"); startTime = Msg.getClock(); vm1.migrate(host1); endTime = Msg.getClock(); - Msg.info(" - End of Migration from host 0 to host 1 (duration:"+(endTime-startTime)+")"); - Msg.info(" - Launch migration from host 1 to host 0"); + Msg.info(" - End of Migration from PM0 to PM1 (duration:"+(endTime-startTime)+")"); + Msg.info(" - Launch migration from PM1 to PM0"); startTime = Msg.getClock(); vm1.migrate(host0); endTime = Msg.getClock(); - Msg.info(" - End of Migration from host 1 to host 0 (duration:"+(endTime-startTime)+")"); + Msg.info(" - End of Migration from PM1 to PM0 (duration:"+(endTime-startTime)+")"); Msg.info(""); Msg.info(""); Msg.info("Round trip of VM1 (load "+load2+"%)"); vm1.setLoad(load2); - Msg.info(" - Launch migration from host 0 to host 1"); + Msg.info(" - Launch migration from PM0 to PM1"); startTime = Msg.getClock(); vm1.migrate(host1); endTime = Msg.getClock(); - Msg.info(" - End of Migration from host 0 to host 1 (duration:"+(endTime-startTime)+")"); - Msg.info(" - Launch migration from host 1 to host 0"); + Msg.info(" - End of Migration from PM0 to PM1 (duration:"+(endTime-startTime)+")"); + Msg.info(" - Launch migration from PM1 to PM0"); startTime = Msg.getClock(); vm1.migrate(host0); endTime = Msg.getClock(); - Msg.info(" - End of Migration from host 1 to host 0 (duration:"+(endTime-startTime)+")"); + Msg.info(" - End of Migration from PM1 to PM0 (duration:"+(endTime-startTime)+")"); Main.setEndOfTest(); Msg.info("Forcefully destroy VMs"); diff --git a/examples/java/cloud/migration/TestHostOnOff.java b/examples/java/cloud/migration/TestHostOnOff.java index 0ffa765148..5fccb0bd75 100644 --- a/examples/java/cloud/migration/TestHostOnOff.java +++ b/examples/java/cloud/migration/TestHostOnOff.java @@ -15,38 +15,38 @@ import org.simgrid.msg.Process; // node or on the DST node. public class TestHostOnOff extends Process{ - public static Host host0 = null; - public static Host host1 = null; - public static Host host2 = null; + protected Host host0 = null; + protected Host host1 = null; + protected Host host2 = null; - TestHostOnOff(Host host, String name, String[] args) throws NativeException { - super(host, name, args); + TestHostOnOff(String hostname, String name) throws HostNotFoundException, NativeException { + super(hostname, name); } public void main(String[] strings) throws MsgException { /* get hosts 1 and 2*/ try { - host0 = Host.getByName("host0"); - host1 = Host.getByName("host1"); - host1 = Host.getByName("host2"); + host0 = Host.getByName("PM0"); + host1 = Host.getByName("PM1"); + host2 = Host.getByName("PM2"); }catch (HostNotFoundException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } // Robustness on the SRC node - //for (int i =0 ; i < 55000 ; i++) - // testVMMigrate(host1, i); + for (int i =100 ; i < 55000 ; i+=100) + testVMMigrate(host1, i); // Robustness on the DST node - //for (int i =0 ; i < 55000 ; i++) - // testVMMigrate(host2, i); + for (int i =0 ; i < 55000 ; i++) + testVMMigrate(host2, i); /* End of Tests */ Msg.info("Nor more tests, Bye Bye !"); Main.setEndOfTest(); } - public static void testVMMigrate (Host hostToKill, long killAt) throws MsgException { + public void testVMMigrate (Host hostToKill, long killAt) throws MsgException { Msg.info("**** **** **** ***** ***** Test Migrate with host shutdown ***** ***** **** **** ****"); Msg.info("Turn on one host, assign a VM on this host, launch a process inside the VM, migrate the VM and " + "turn off either the SRC or DST"); @@ -74,9 +74,9 @@ public class TestHostOnOff extends Process{ String[] args = new String[3]; args[0] = "vm0"; - args[1] = "host1"; - args[2] = "host2"; - new Process(host1, "Migrate-" + new Random().nextDouble(), args) { + args[1] = "PM1"; + args[2] = "PM2"; + new Process(host1, "Migrate-" + killAt, args) { public void main(String[] args) { Host destHost = null; Host sourceHost = null; @@ -94,8 +94,8 @@ public class TestHostOnOff extends Process{ Msg.info("Migrate vm "+args[0]+" to node "+destHost.getName()); VM.getVMByName(args[0]).migrate(destHost); } catch (HostFailureException e) { - e.printStackTrace(); Msg.info("Something occurs during the migration that cannot validate the operation"); + e.printStackTrace(); } } } @@ -104,10 +104,8 @@ public class TestHostOnOff extends Process{ // Wait killAt ms before killing thehost Process.sleep(killAt); + Msg.info("The migration process should be stopped and we should catch an exception"); hostToKill.off(); - Process.sleep(5); - Msg.info("The migration process should be stopped and we should catch an exception\n"); - Process.sleep(5); Process.sleep(50000); Msg.info("Destroy VMs"); @@ -115,7 +113,7 @@ public class TestHostOnOff extends Process{ Process.sleep(20000); } - public static void testVMShutdownDestroy () throws HostFailureException { + public void testVMShutdownDestroy () throws HostFailureException { Msg.info("**** **** **** ***** ***** Test shutdown a VM ***** ***** **** **** ****"); Msg.info("Turn on host1, assign a VM on host1, launch a process inside the VM, and turn off the vm, " + "and check whether you can reallocate the same VM"); diff --git a/examples/java/cloud/migration/cloud_migration.tesh b/examples/java/cloud/migration/cloud_migration.tesh index 73aec7ceca..4dfee29609 100644 --- a/examples/java/cloud/migration/cloud_migration.tesh +++ b/examples/java/cloud/migration/cloud_migration.tesh @@ -1,33 +1,33 @@ #! tesh -$ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/../platforms/two_hosts_platform.xml +$ java -classpath ${classpath:=.} cloud/migration/Main ${srcdir:=.}/../platforms/three_multicore_hosts.xml > [0.000000] [jmsg/INFO] Using regular java threads. -> [host0:Test:(1) 0.000000] [jmsg/INFO] This example evaluates the migration time of a VM in presence of collocated VMs on the source and the dest nodes -> [host0:Test:(1) 0.000000] [jmsg/INFO] The migrated VM has a memory intensity rate of 70% of the network BW and a cpu load of 90% " (see cloudcom 2013 paper "Adding a Live Migration Model Into SimGrid" for further information) -> [host0:Test:(1) 0.000000] [jmsg/INFO] Load of collocated VMs fluctuate between 0 and 90% in order to create a starvation issue and see whether it impacts or not the migration time -> [host0:Test:(1) 0.000000] [jmsg/INFO] Round trip of VM1 (load 90%) -> [host0:Test:(1) 0.000000] [jmsg/INFO] - Launch migration from host 0 to host 1 -> [host0:Test:(1) 0.000000] [jmsg/INFO] Start migration of VM vm0 to host1 -> [host0:Test:(1) 0.000000] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:8.10E+11 -> [host0:Test:(1) 35.084170] [jmsg/INFO] End of migration of VM vm0 to node host1 -> [host0:Test:(1) 35.084170] [jmsg/INFO] - End of Migration from host 0 to host 1 (duration:35.0841702956701) -> [host0:Test:(1) 35.084170] [jmsg/INFO] - Launch migration from host 1 to host 0 -> [host0:Test:(1) 35.084170] [jmsg/INFO] Start migration of VM vm0 to host0 -> [host0:Test:(1) 35.084170] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:6.22E+11 -> [host0:Test:(1) 67.551019] [jmsg/INFO] End of migration of VM vm0 to node host0 -> [host0:Test:(1) 67.551019] [jmsg/INFO] - End of Migration from host 1 to host 0 (duration:32.46684874546391) -> [host0:Test:(1) 67.551019] [jmsg/INFO] -> [host0:Test:(1) 67.551019] [jmsg/INFO] -> [host0:Test:(1) 67.551019] [jmsg/INFO] Round trip of VM1 (load 80%) -> [host0:Test:(1) 67.551019] [jmsg/INFO] - Launch migration from host 0 to host 1 -> [host0:Test:(1) 67.551019] [jmsg/INFO] Start migration of VM vm0 to host1 -> [host0:Test:(1) 67.551019] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:4.64E+11 -> [host0:Test:(1) 102.635189] [jmsg/INFO] End of migration of VM vm0 to node host1 -> [host0:Test:(1) 102.635189] [jmsg/INFO] - End of Migration from host 0 to host 1 (duration:35.08417029567006) -> [host0:Test:(1) 102.635189] [jmsg/INFO] - Launch migration from host 1 to host 0 -> [host0:Test:(1) 102.635189] [jmsg/INFO] Start migration of VM vm0 to host0 -> [host0:Test:(1) 102.635189] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:2.77E+11 -> [host0:Test:(1) 135.102038] [jmsg/INFO] End of migration of VM vm0 to node host0 -> [host0:Test:(1) 135.102038] [jmsg/INFO] - End of Migration from host 1 to host 0 (duration:32.46684874546395) -> [host0:Test:(1) 135.102038] [jmsg/INFO] Forcefully destroy VMs +> [PM0:Test:(1) 0.000000] [jmsg/INFO] This example evaluates the migration time of a VM in presence of collocated VMs on the source and the dest nodes +> [PM0:Test:(1) 0.000000] [jmsg/INFO] The migrated VM has a memory intensity rate of 70% of the network BW and a cpu load of 90% " (see cloudcom 2013 paper "Adding a Live Migration Model Into SimGrid" for further information) +> [PM0:Test:(1) 0.000000] [jmsg/INFO] Load of collocated VMs fluctuate between 0 and 90% in order to create a starvation issue and see whether it impacts or not the migration time +> [PM0:Test:(1) 0.000000] [jmsg/INFO] Round trip of VM1 (load 90%) +> [PM0:Test:(1) 0.000000] [jmsg/INFO] - Launch migration from PM0 to PM1 +> [PM0:Test:(1) 0.000000] [jmsg/INFO] Start migration of VM vm0 to PM1 +> [PM0:Test:(1) 0.000000] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:8.10E+11 +> [PM0:Test:(1) 35.084170] [jmsg/INFO] End of migration of VM vm0 to node PM1 +> [PM0:Test:(1) 35.084170] [jmsg/INFO] - End of Migration from PM0 to PM1 (duration:35.0841702956701) +> [PM0:Test:(1) 35.084170] [jmsg/INFO] - Launch migration from PM1 to PM0 +> [PM0:Test:(1) 35.084170] [jmsg/INFO] Start migration of VM vm0 to PM0 +> [PM0:Test:(1) 35.084170] [jmsg/INFO] currentLoad:90/ramSize:2048/dpIntensity:70/remaining:6.22E+11 +> [PM0:Test:(1) 67.551019] [jmsg/INFO] End of migration of VM vm0 to node PM0 +> [PM0:Test:(1) 67.551019] [jmsg/INFO] - End of Migration from PM1 to PM0 (duration:32.46684874546391) +> [PM0:Test:(1) 67.551019] [jmsg/INFO] +> [PM0:Test:(1) 67.551019] [jmsg/INFO] +> [PM0:Test:(1) 67.551019] [jmsg/INFO] Round trip of VM1 (load 80%) +> [PM0:Test:(1) 67.551019] [jmsg/INFO] - Launch migration from PM0 to PM1 +> [PM0:Test:(1) 67.551019] [jmsg/INFO] Start migration of VM vm0 to PM1 +> [PM0:Test:(1) 67.551019] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:4.64E+11 +> [PM0:Test:(1) 102.635189] [jmsg/INFO] End of migration of VM vm0 to node PM1 +> [PM0:Test:(1) 102.635189] [jmsg/INFO] - End of Migration from PM0 to PM1 (duration:35.08417029567006) +> [PM0:Test:(1) 102.635189] [jmsg/INFO] - Launch migration from PM1 to PM0 +> [PM0:Test:(1) 102.635189] [jmsg/INFO] Start migration of VM vm0 to PM0 +> [PM0:Test:(1) 102.635189] [jmsg/INFO] currentLoad:80/ramSize:2048/dpIntensity:70/remaining:2.77E+11 +> [PM0:Test:(1) 135.102038] [jmsg/INFO] End of migration of VM vm0 to node PM0 +> [PM0:Test:(1) 135.102038] [jmsg/INFO] - End of Migration from PM1 to PM0 (duration:32.46684874546395) +> [PM0:Test:(1) 135.102038] [jmsg/INFO] Forcefully destroy VMs > [135.102038] [jmsg/INFO] MSG_main finished; Cleaning up the simulation... diff --git a/examples/msg/cloud-multicore/cloud-multicore.c b/examples/msg/cloud-multicore/cloud-multicore.c index 9e2d68edbd..ebb0a22209 100644 --- a/examples/msg/cloud-multicore/cloud-multicore.c +++ b/examples/msg/cloud-multicore/cloud-multicore.c @@ -61,12 +61,12 @@ static void test_pm_pin(void) t3.task = MSG_task_create("Task3", 1e16, 0, NULL); t4.task = MSG_task_create("Task4", 1e16, 0, NULL); - MSG_process_create("worker1", worker_main, t1.task, pm1); - MSG_process_create("worker2", worker_main, t2.task, pm1); - MSG_process_create("worker3", worker_main, t3.task, pm1); - MSG_process_create("worker4", worker_main, t4.task, pm1); + MSG_process_create("worker1", worker_main, t1.task, pm2); + MSG_process_create("worker2", worker_main, t2.task, pm2); + MSG_process_create("worker3", worker_main, t3.task, pm2); + MSG_process_create("worker4", worker_main, t4.task, pm2); - XBT_INFO("## 1. start 4 tasks on PM1 (2 cores)"); + XBT_INFO("## 1. start 4 tasks on PM2 (2 cores)"); task_data_init_clock(&t1); task_data_init_clock(&t2); task_data_init_clock(&t3); @@ -79,10 +79,10 @@ static void test_pm_pin(void) task_data_get_clock(&t4); XBT_INFO("## 2. pin all tasks to CPU0"); - MSG_task_set_affinity(t1.task, pm1, 0x01); - MSG_task_set_affinity(t2.task, pm1, 0x01); - MSG_task_set_affinity(t3.task, pm1, 0x01); - MSG_task_set_affinity(t4.task, pm1, 0x01); + MSG_task_set_affinity(t1.task, pm2, 0x01); + MSG_task_set_affinity(t2.task, pm2, 0x01); + MSG_task_set_affinity(t3.task, pm2, 0x01); + MSG_task_set_affinity(t4.task, pm2, 0x01); MSG_process_sleep(10); task_data_get_clock(&t1); @@ -91,7 +91,7 @@ static void test_pm_pin(void) task_data_get_clock(&t4); XBT_INFO("## 3. clear the affinity of task4"); - MSG_task_set_affinity(t4.task, pm1, 0); + MSG_task_set_affinity(t4.task, pm2, 0); MSG_process_sleep(10); task_data_get_clock(&t1); @@ -100,7 +100,7 @@ static void test_pm_pin(void) task_data_get_clock(&t4); XBT_INFO("## 4. clear the affinity of task3"); - MSG_task_set_affinity(t3.task, pm1, 0); + MSG_task_set_affinity(t3.task, pm2, 0); MSG_process_sleep(10); task_data_get_clock(&t1); @@ -109,7 +109,7 @@ static void test_pm_pin(void) task_data_get_clock(&t4); XBT_INFO("## 5. clear the affinity of task2"); - MSG_task_set_affinity(t2.task, pm1, 0); + MSG_task_set_affinity(t2.task, pm2, 0); MSG_process_sleep(10); task_data_get_clock(&t1); @@ -120,8 +120,8 @@ static void test_pm_pin(void) XBT_INFO("## 6. pin all tasks to CPU0 of another PM (no effect now)"); MSG_task_set_affinity(t1.task, pm0, 0); MSG_task_set_affinity(t2.task, pm0, 0); - MSG_task_set_affinity(t3.task, pm2, 0); - MSG_task_set_affinity(t4.task, pm2, 0); + MSG_task_set_affinity(t3.task, pm1, 0); + MSG_task_set_affinity(t4.task, pm1, 0); MSG_process_sleep(10); task_data_get_clock(&t1); @@ -148,11 +148,11 @@ static void test_vm_pin(void) msg_host_t pm2 = xbt_dynar_get_as(hosts_dynar, 2, msg_host_t); // 4 cores xbt_dynar_free(&hosts_dynar); - /* set up VMs on PM2 (4 cores) */ - msg_vm_t vm0 = MSG_vm_create_core(pm2, "VM0"); - msg_vm_t vm1 = MSG_vm_create_core(pm2, "VM1"); - msg_vm_t vm2 = MSG_vm_create_core(pm2, "VM2"); - msg_vm_t vm3 = MSG_vm_create_core(pm2, "VM3"); + /* set up VMs on PM1 (4 cores) */ + msg_vm_t vm0 = MSG_vm_create_core(pm1, "VM0"); + msg_vm_t vm1 = MSG_vm_create_core(pm1, "VM1"); + msg_vm_t vm2 = MSG_vm_create_core(pm1, "VM2"); + msg_vm_t vm3 = MSG_vm_create_core(pm1, "VM3"); s_vm_params_t params; memset(¶ms, 0, sizeof(params)); @@ -187,7 +187,7 @@ static void test_vm_pin(void) MSG_process_create("worker3", worker_main, t3.task, vm3); /* start experiments */ - XBT_INFO("## 1. start 4 VMs on PM2 (4 cores)"); + XBT_INFO("## 1. start 4 VMs on PM1 (4 cores)"); task_data_init_clock(&t0); task_data_init_clock(&t1); task_data_init_clock(&t2); @@ -199,11 +199,11 @@ static void test_vm_pin(void) task_data_get_clock(&t2); task_data_get_clock(&t3); - XBT_INFO("## 2. pin all VMs to CPU0 of PM2"); - MSG_vm_set_affinity(vm0, pm2, 0x01); - MSG_vm_set_affinity(vm1, pm2, 0x01); - MSG_vm_set_affinity(vm2, pm2, 0x01); - MSG_vm_set_affinity(vm3, pm2, 0x01); + XBT_INFO("## 2. pin all VMs to CPU0 of PM1"); + MSG_vm_set_affinity(vm0, pm1, 0x01); + MSG_vm_set_affinity(vm1, pm1, 0x01); + MSG_vm_set_affinity(vm2, pm1, 0x01); + MSG_vm_set_affinity(vm3, pm1, 0x01); MSG_process_sleep(10); task_data_get_clock(&t0); @@ -211,12 +211,12 @@ static void test_vm_pin(void) task_data_get_clock(&t2); task_data_get_clock(&t3); - XBT_INFO("## 3. pin all VMs to CPU0 of PM1 (no effect at now)"); + XBT_INFO("## 3. pin all VMs to CPU0 of PM2(no effect at now)"); /* Because VMs are on PM2, the below operations do not effect computation now. */ - MSG_vm_set_affinity(vm0, pm1, 0x01); - MSG_vm_set_affinity(vm1, pm1, 0x01); - MSG_vm_set_affinity(vm2, pm1, 0x01); - MSG_vm_set_affinity(vm3, pm1, 0x01); + MSG_vm_set_affinity(vm0, pm2, 0x01); + MSG_vm_set_affinity(vm1, pm2, 0x01); + MSG_vm_set_affinity(vm2, pm2, 0x01); + MSG_vm_set_affinity(vm3, pm2, 0x01); MSG_process_sleep(10); task_data_get_clock(&t0); @@ -224,10 +224,10 @@ static void test_vm_pin(void) task_data_get_clock(&t2); task_data_get_clock(&t3); - XBT_INFO("## 4. unpin VM0, and pin VM2 and VM3 to CPU1 of PM2"); - MSG_vm_set_affinity(vm0, pm2, 0x00); - MSG_vm_set_affinity(vm2, pm2, 0x02); - MSG_vm_set_affinity(vm3, pm2, 0x02); + XBT_INFO("## 4. unpin VM0, and pin VM2 and VM3 to CPU1 of PM1"); + MSG_vm_set_affinity(vm0, pm1, 0x00); + MSG_vm_set_affinity(vm2, pm1, 0x02); + MSG_vm_set_affinity(vm3, pm1, 0x02); MSG_process_sleep(10); task_data_get_clock(&t0); @@ -253,11 +253,11 @@ static void test_vm_pin(void) task_data_get_clock(&t2); task_data_get_clock(&t3); - XBT_INFO("## 6. migrate all VMs to PM1 (2 CPU cores, with affinity settings)"); - MSG_vm_migrate(vm0, pm1); - MSG_vm_migrate(vm1, pm1); - MSG_vm_migrate(vm2, pm1); - MSG_vm_migrate(vm3, pm1); + XBT_INFO("## 6. migrate all VMs to PM2 (2 CPU cores, with affinity settings)"); + MSG_vm_migrate(vm0, pm2); + MSG_vm_migrate(vm1, pm2); + MSG_vm_migrate(vm2, pm2); + MSG_vm_migrate(vm3, pm2); MSG_process_sleep(10); task_data_get_clock(&t0); @@ -273,10 +273,10 @@ static void test_vm_pin(void) XBT_INFO("## 7. clear affinity settings on PM1"); - MSG_vm_set_affinity(vm0, pm1, 0); - MSG_vm_set_affinity(vm1, pm1, 0); - MSG_vm_set_affinity(vm2, pm1, 0); - MSG_vm_set_affinity(vm3, pm1, 0); + MSG_vm_set_affinity(vm0, pm2, 0); + MSG_vm_set_affinity(vm1, pm2, 0); + MSG_vm_set_affinity(vm2, pm2, 0); + MSG_vm_set_affinity(vm3, pm2, 0); MSG_process_sleep(10); task_data_get_clock(&t0); diff --git a/examples/msg/cloud-multicore/cloud-multicore.tesh b/examples/msg/cloud-multicore/cloud-multicore.tesh index ae23645e46..11c3790671 100644 --- a/examples/msg/cloud-multicore/cloud-multicore.tesh +++ b/examples/msg/cloud-multicore/cloud-multicore.tesh @@ -1,14 +1,14 @@ #! ./tesh $ $SG_TEST_EXENV ${bindir:=.}/cloud-multicore$EXEEXT --log=no_loc ${srcdir:=.}/three_multicore_hosts.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" -> [ 0.000000] (0:maestro@) PM0: 1 core(s), 100000000.000000 flops/s per each -> [ 0.000000] (0:maestro@) PM1: 2 core(s), 100000000.000000 flops/s per each -> [ 0.000000] (0:maestro@) PM2: 4 core(s), 100000000.000000 flops/s per each +> [ 0.000000] (0:maestro@) PM0: 4 core(s), 8095000000.000001 flops/s per each +> [ 0.000000] (0:maestro@) PM1: 4 core(s), 8095000000.000001 flops/s per each +> [ 0.000000] (0:maestro@) PM2: 2 core(s), 8095000000.000001 flops/s per each > [ 0.000000] (1:master@PM0) === Test PM (set affinity) === -> [ 0.000000] (1:master@PM0) ## 1. start 4 tasks on PM1 (2 cores) -> [ 10.000000] (1:master@PM0) Task1: 50000000.000000 fops/s -> [ 10.000000] (1:master@PM0) Task2: 50000000.000000 fops/s -> [ 10.000000] (1:master@PM0) Task3: 50000000.000000 fops/s -> [ 10.000000] (1:master@PM0) Task4: 50000000.000000 fops/s +> [ 0.000000] (1:master@PM0) ## 1. start 4 tasks on PM2 (2 cores) +> [ 10.000000] (1:master@PM0) Task1: 4047500000.000000 fops/s +> [ 10.000000] (1:master@PM0) Task2: 4047500000.000000 fops/s +> [ 10.000000] (1:master@PM0) Task3: 4047500000.000000 fops/s +> [ 10.000000] (1:master@PM0) Task4: 4047500000.000000 fops/s > [ 10.000000] (1:master@PM0) ## 2. pin all tasks to CPU0 -> [ 10.000000] (1:master@PM0) set affinity(0x0001@PM1) for Task1 +> [ 10.000000] (1:master@PM0) set affinity(0x0001@PM2) for Task1 diff --git a/examples/platforms/three_multicore_hosts.xml b/examples/platforms/three_multicore_hosts.xml index 7372bf946f..adbed975d8 100644 --- a/examples/platforms/three_multicore_hosts.xml +++ b/examples/platforms/three_multicore_hosts.xml @@ -2,11 +2,11 @@ - - - + + + - + diff --git a/examples/platforms/two_hosts_platform.xml b/examples/platforms/two_hosts_platform.xml deleted file mode 100644 index b78490919b..0000000000 --- a/examples/platforms/two_hosts_platform.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/examples/s4u/basic/s4u_basic.cpp b/examples/s4u/basic/s4u_basic.cpp index e4329fe4b9..13d01035ea 100644 --- a/examples/s4u/basic/s4u_basic.cpp +++ b/examples/s4u/basic/s4u_basic.cpp @@ -33,9 +33,9 @@ public: int main(int argc, char **argv) { simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv); - e->loadPlatform("../../platforms/two_hosts_platform.xml"); - new simgrid::s4u::Actor("worker", simgrid::s4u::Host::by_name("host0"), Worker()); - new simgrid::s4u::Actor("master", simgrid::s4u::Host::by_name("host1"), 0, Master()); + e->loadPlatform("../../platforms/two_hosts.xml"); + new simgrid::s4u::Actor("worker", simgrid::s4u::Host::by_name("Tremblay"), Worker()); + new simgrid::s4u::Actor("master", simgrid::s4u::Host::by_name("Jupiter"), 0, Master()); e->run(); return 0; } diff --git a/examples/s4u/basic/s4u_basic.tesh b/examples/s4u/basic/s4u_basic.tesh index e081aa7e32..111fea7d58 100644 --- a/examples/s4u/basic/s4u_basic.tesh +++ b/examples/s4u/basic/s4u_basic.tesh @@ -1,8 +1,8 @@ #! ./tesh $ $SG_TEST_EXENV ${bindir:=.}/s4u_basic -> [host0:worker:(0) 0.000000] [s4u_test/INFO] Hello s4u, I'm ready to serve -> [host1:master:(0) 0.000000] [s4u_test/INFO] Hello s4u, I have something to send -> [host0:worker:(0) 0.001301] [s4u_test/INFO] I received 'GaBuZoMeu' -> [host0:worker:(0) 0.001301] [s4u_test/INFO] I'm done. See you. -> [host1:master:(0) 0.001301] [s4u_test/INFO] I'm done. See you. +> [Tremblay:worker:(0) 0.000000] [s4u_test/INFO] Hello s4u, I'm ready to serve +> [Jupiter:master:(0) 0.000000] [s4u_test/INFO] Hello s4u, I have something to send +> [Tremblay:worker:(0) 0.001301] [s4u_test/INFO] I received 'GaBuZoMeu' +> [Tremblay:worker:(0) 0.001301] [s4u_test/INFO] I'm done. See you. +> [Jupiter:master:(0) 0.001301] [s4u_test/INFO] I'm done. See you. diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 7e7bb5f0da..44322a69e4 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -1088,7 +1088,6 @@ set(PLATFORMS_EXAMPLES examples/platforms/torus_cluster.xml examples/platforms/two_clusters.xml examples/platforms/two_hosts.xml - examples/platforms/two_hosts_platform.xml examples/platforms/two_hosts_platform_shared.xml examples/platforms/two_hosts_platform_with_availability.xml examples/platforms/two_hosts_platform_with_availability_included.xml -- 2.20.1