A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branches 'master' and 'master' of github.com:simgrid/simgrid
[simgrid.git]
/
examples
/
java
/
cloud
/
migration
/
Test.java
diff --git
a/examples/java/cloud/migration/Test.java
b/examples/java/cloud/migration/Test.java
index
d3d6a09
..
df9a19f
100644
(file)
--- a/
examples/java/cloud/migration/Test.java
+++ b/
examples/java/cloud/migration/Test.java
@@
-1,5
+1,4
@@
-/* Copyright (c) 2014, 2016. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2014-2017. 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. */
/* 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. */
@@
-8,12
+7,17
@@
package cloud.migration;
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
-import org.simgrid.msg.*;
+import org.simgrid.msg.Host;
+import org.simgrid.msg.HostFailureException;
+import org.simgrid.msg.HostNotFoundException;
+import org.simgrid.msg.Msg;
+import org.simgrid.msg.MsgException;
import org.simgrid.msg.Process;
import org.simgrid.msg.Process;
+import org.simgrid.msg.VM;
public class Test extends Process{
public class Test extends Process{
- Test(String hostname, String name) throws HostNotFoundException
, NativeException
{
+ Test(String hostname, String name) throws HostNotFoundException {
super(hostname, name);
}
super(hostname, name);
}
@@
-27,15
+31,8
@@
public class Test extends Process{
}
public void main(String[] strings) throws MsgException {
}
public void main(String[] strings) throws MsgException {
- Host host0 = null;
- Host host1 = null;
- try {
- /* get hosts 1 and 2*/
- host0 = Host.getByName("PM0");
- host1 = Host.getByName("PM1");
- }catch (HostNotFoundException e) {
- e.printStackTrace();
- }
+ Host host0 = Host.getByName("PM0");
+ Host host1 = Host.getByName("PM1");
List<VM> vms = new ArrayList<>();
List<VM> vms = new ArrayList<>();
@@
-52,11
+49,7
@@
public class Test extends Process{
Msg.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");
XVM vm1 = new XVM(host0, "vm0",
Msg.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");
XVM vm1 = new XVM(host0, "vm0",
- 1, // Nb of vcpu
2048, // Ramsize,
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
125, // Net bandwidth,
dpRate // Memory intensity
);
@@
-64,7
+57,6
@@
public class Test extends Process{
vm1.start();
/* Collocated VMs */
vm1.start();
/* Collocated VMs */
- int collocatedSrc = 6;
int[] vmSrcLoad = {
80,
0,
int[] vmSrcLoad = {
80,
0,
@@
-75,13
+67,9
@@
public class Test extends Process{
};
XVM tmp;
};
XVM tmp;
- for (int i=1 ; i<=
collocatedSrc
; i++){
+ for (int i=1 ; i<=
vmSrcLoad.length
; i++){
tmp = new XVM(host0, "vm"+i,
tmp = new XVM(host0, "vm"+i,
- 1, // Nb of vcpu
2048, // Ramsize,
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
125, // Net bandwidth,
dpRate // Memory intensity
);
@@
-90,7
+78,6
@@
public class Test extends Process{
tmp.setLoad(vmSrcLoad[i-1]);
}
tmp.setLoad(vmSrcLoad[i-1]);
}
- int collocatedDst = 6;
int[] vmDstLoad = {
0,
40,
int[] vmDstLoad = {
0,
40,
@@
-100,13
+87,9
@@
public class Test extends Process{
80,
};
80,
};
- for (int i=1 ; i <= collocatedDst ; i++){
- tmp = new XVM(host1, "vm"+(i+collocatedSrc),
- 1, // Nb of vcpu
+ for (int i=1 ; i <= vmDstLoad.length ; i++){
+ tmp = new XVM(host1, "vm"+(i+vmSrcLoad.length),
2048, // Ramsize,
2048, // Ramsize,
- 125, // Net Bandwidth
- null, //VM disk image
- -1, //size of disk image,
125, // Net bandwidth,
dpRate // Memory intensity
);
125, // Net bandwidth,
dpRate // Memory intensity
);