Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://github.com/mpoquet/simgrid
[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 class Main {
14   private Main() {
15     throw new IllegalAccessError("Utility class");
16   }
17
18   public static void main(String[] args) throws NativeException, HostNotFoundException {
19     Msg.energyInit();
20     Msg.init(args);
21
22     if (args.length < 1) {
23       Msg.info("Usage: Main ../platforms/energy_platform_file.xml");
24       System.exit(1);
25     }
26
27     /* construct the platform */
28     Msg.createEnvironment(args[0]);
29
30     /* Create and start a runner for the experiment */
31     new EnergyVMRunner(Host.all()[0],"energy VM runner",null).start();
32
33     Msg.run();
34   }
35 }