From c160966829bfda9464576f05a2568c45059a7f21 Mon Sep 17 00:00:00 2001 From: alebre Date: Tue, 18 Feb 2014 13:27:41 +0100 Subject: [PATCH 1/1] Fix java example (still something weird related to the net BW between peers for migration tests) - adsein --- examples/java/cloud/Cloud.java | 3 +-- examples/java/cloud/Master.java | 20 +++++--------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/examples/java/cloud/Cloud.java b/examples/java/cloud/Cloud.java index 9da6a107f0..9848bc3e8d 100644 --- a/examples/java/cloud/Cloud.java +++ b/examples/java/cloud/Cloud.java @@ -9,14 +9,13 @@ package cloud; import org.simgrid.msg.Host; import org.simgrid.msg.Msg; import org.simgrid.msg.MsgException; - /** * Example showing the use of the new experimental Cloud API. */ public class Cloud { public static final double task_comp_size = 10; public static final double task_comm_size = 10; - public static final int hostNB = 89 ; + public static final int hostNB = 2 ; public static void main(String[] args) throws MsgException { Msg.init(args); diff --git a/examples/java/cloud/Master.java b/examples/java/cloud/Master.java index 467be23f96..57806fdc89 100644 --- a/examples/java/cloud/Master.java +++ b/examples/java/cloud/Master.java @@ -60,7 +60,7 @@ public class Master extends Process { Msg.info("Sleep long enough for everyone to be done with previous batch of work"); waitFor(1000 - Msg.getClock()); - Msg.info("Add one more process per VM."); +/* Msg.info("Add one more process per VM."); for (int i = 0; i < vms.size(); i++) { VM vm = vms.get(i); Slave slave = new Slave(vm,i + vms.size()); @@ -68,24 +68,14 @@ public class Master extends Process { } workBatch(slavesCount * 2); - - Msg.info("Migrate everyone to "+hosts[2].getName()); - for (int i = 0; i < vms.size(); i++) { - vms.get(i).migrate(hosts[2]); - } - -// Msg.info("Suspend everyone, move them to the third host, and resume them."); - Msg.info("Migrate everyone to the third host (please note that cold migration is not yet available"); - +*/ + Msg.info("Migrate everyone to "+hosts[3].getName()); for (int i = 0; i < vms.size(); i++) { - VM vm = vms.get(i); - // vm.suspend(); - vm.migrate(hosts[3]); - // vm.resume(); + Msg.info("Migrate "+vms.get(i).getName()+"from"+hosts[i+1].getName()+"to "+hosts[3].getName()); + vms.get(i).migrate(hosts[2]); } - Msg.info("Let's shut down the simulation and kill everyone."); -- 2.20.1