Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'actor-yield' of github.com:Takishipp/simgrid into actor-yield
[simgrid.git] / examples / java / io / file / Main.java
1 /* Copyright (c) 2012-2017. 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 io.file;
7
8 import org.simgrid.msg.Msg;
9 import org.simgrid.msg.Host;
10
11 public class Main {
12   private Main() {
13     throw new IllegalAccessError("Utility class");
14   }
15
16   public static void main(String[] args) {
17     Msg.init(args);
18     if(args.length < 1) {
19       Msg.info("Usage   : IO platform_file ");
20       Msg.info("example : IO ../platforms/storage/storage.xml ");
21       System.exit(1);
22     }
23
24     Msg.createEnvironment(args[0]);
25
26     Host[] hosts = Host.all();
27
28     Msg.info("Number of hosts:" + hosts.length);
29     for (int i = 0; i < hosts.length && i < 4; i++) {
30       new io.file.Node(hosts[i],i).start();
31     }
32
33     Msg.run();
34   }
35 }