1 import org.simgrid.msg.*;
2 import org.simgrid.msg.Process;
4 public class Test extends Process{
6 Test(Host host, String name, String[] args) throws HostNotFoundException, NativeException {
7 super(host, name, args);
10 public void main(String[] strings) throws MsgException {
15 /* get hosts 1 and 2*/
20 host0 = Host.getByName("host0");
21 host1 = Host.getByName("host1");
22 }catch (HostNotFoundException e) {
23 e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
39 -1, //size of disk image,
40 125, // Net bandwidth,
41 dpRate // Memory intensity
48 int collocatedSrc = 6;
59 for (int i=1 ; i<= collocatedSrc ; i++){
67 -1, //size of disk image,
68 125, // Net bandwidth,
69 dpRate // Memory intensity
72 tmp.setLoad(vmSrcLoad[i-1]);
75 int collocatedDst = 6;
85 for (int i=1 ; i <= collocatedDst ; i++){
93 -1, //size of disk image,
94 125, // Net bandwidth,
95 dpRate // Memory intensity
98 tmp.setLoad(vmDstLoad[i-1]);
105 Msg.info("Round trip of VM1 (load "+load1+"%)");
107 Msg.info(" - Launch migration from host 0 to host 1");
108 startTime = Msg.getClock();
110 endTime = Msg.getClock();
111 Msg.info(" - End of Migration from host 0 to host 1 (duration:"+(endTime-startTime)+")");
112 Msg.info(" - Launch migration from host 1 to host 0");
113 startTime = Msg.getClock();
115 endTime = Msg.getClock();
116 Msg.info(" - End of Migration from host 1 to host 0 (duration:"+(endTime-startTime)+")");
118 Msg.info("\n \n \nRound trip of VM1 (load "+load2+"%)");
120 Msg.info(" - Launch migration from host 0 to host 1");
121 startTime = Msg.getClock();
123 endTime = Msg.getClock();
124 Msg.info(" - End of Migration from host 0 to host 1 (duration:"+(endTime-startTime)+")");
125 Msg.info(" - Launch migration from host 1 to host 0");
126 startTime = Msg.getClock();
128 endTime = Msg.getClock();
129 Msg.info(" - End of Migration from host 1 to host 0 (duration:"+(endTime-startTime)+")");