Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright headers.
[simgrid.git] / examples / java / io / file / Main.java
1 /* Copyright (c) 2012-2018. 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     Msg.fileSystemInit();
19     if(args.length < 1) {
20       Msg.info("Usage   : IO platform_file ");
21       Msg.info("example : IO ../platforms/storage/storage.xml ");
22       System.exit(1);
23     }
24
25     Msg.createEnvironment(args[0]);
26
27     Host[] hosts = Host.all();
28
29     Msg.info("Number of hosts:" + hosts.length);
30     for (int i = 0; i < hosts.length && i < 4; i++) {
31       new io.file.Node(hosts[i],i).start();
32     }
33
34     Msg.run();
35   }
36 }