Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
If you don't start the processes, the VM are actually empty, bummer
[simgrid.git] / examples / java / energy / vm / EnergyVMRunner.java
index 0e636f6..6b37812 100644 (file)
@@ -28,7 +28,7 @@ public class EnergyVMRunner extends Process {
       Task  task = new Task(this.getHost().getName()+"-task", 300E6 , 0);
       try {
         task.execute();
-      } catch (HostFailureException | TaskCancelledException e) {
+      } catch (HostFailureException | TaskCancelledException e) { // If your compiler fails on that multicatch, please proceed to Java 1.7 or higher
         Msg.error(e.getMessage());
         e.printStackTrace();
       } 
@@ -55,16 +55,16 @@ public class EnergyVMRunner extends Process {
     vmHost3.start();
 
     Msg.info("Create two tasks on Host1: one inside a VM, the other directly on the host");
-    new DummyProcess (vmHost1, "p11"); 
-    new DummyProcess (host1, "p12"); 
+    new DummyProcess (vmHost1, "p11").start()
+    new DummyProcess (host1, "p12").start()
 
     Msg.info("Create two tasks on Host2: both directly on the host");
-    new DummyProcess (host2, "p21"); 
-    new DummyProcess (host2, "p22"); 
+    new DummyProcess (host2, "p21").start()
+    new DummyProcess (host2, "p22").start()
 
     Msg.info("Create two tasks on Host3: both inside a VM");
-    new DummyProcess (vmHost3, "p31"); 
-    new DummyProcess (vmHost3, "p312"); 
+    new DummyProcess (vmHost3, "p31").start()
+    new DummyProcess (vmHost3, "p312").start()
 
     Msg.info("Wait 5 seconds. The tasks are still running (they run for 3 seconds, but 2 tasks are co-located, "
              + "so they run for 6 seconds)");