Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv example from cloud to energy
[simgrid.git] / examples / java / energy / vm / Main.java
1 /* Copyright (c) 2016. The SimGrid Team. All rights reserved.               */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 package energy.vm;
7
8 import org.simgrid.msg.Msg;
9 import org.simgrid.msg.Host;
10 import org.simgrid.msg.HostNotFoundException;
11 import org.simgrid.msg.NativeException;
12
13 public class Main {
14
15   public static void main(String[] args) throws NativeException, HostNotFoundException {
16     Msg.energyInit();
17     Msg.init(args);
18
19     if (args.length < 1) {
20       Msg.info("Usage: Main ../platforms/energy_platform_file.xml");
21       System.exit(1);
22     }
23
24     /* construct the platform */
25     Msg.createEnvironment(args[0]);
26
27     /* Create and start a runner for the experiment */
28     new EnergyVMRunner(Host.all()[0],"energy VM runner",null).start();
29
30     Msg.run();
31   }
32 }