X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/eee21ec5f99218189fc98898a09150294cd0fbf4..e99158dd85fe789ea5e1a40c29f196fa6c715bcf:/examples/java/cloud/Master.java diff --git a/examples/java/cloud/Master.java b/examples/java/cloud/Master.java index 1a2f0951c0..d3606c90dc 100644 --- a/examples/java/cloud/Master.java +++ b/examples/java/cloud/Master.java @@ -1,10 +1,9 @@ -/* - * Copyright (c) 2012-2013. The SimGrid Team. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. - */ +/* Copyright (c) 2012-2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + package cloud; import java.util.ArrayList; @@ -35,7 +34,7 @@ public class Master extends Process { vm.start(); vms.add(vm); Slave slave = new Slave(vm,i); - Msg.info("Put Worker "+slave.msgName()+ " on "+vm.getName()); + Msg.info("Put Worker "+slave.getName()+ " on "+vm.getName()); slave.start(); } @@ -61,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()); @@ -69,30 +68,19 @@ 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[3]); } - Msg.info("Let's shut down the simulation and kill everyone."); for (int i = 0; i < vms.size(); i++) { vms.get(i).shutdown(); - vms.get(i).destroy(); } Msg.info("Master done."); }