Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
make an io package
[simgrid.git] / examples / java / io / file / Main.java
1 /* Copyright (c) 2012-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 package io.file;
8
9 import org.simgrid.msg.Msg;
10 import org.simgrid.msg.Host;
11 import org.simgrid.msg.MsgException;
12
13 public class Main {
14   public static void main(String[] args) throws MsgException {
15     Msg.init(args);
16     if(args.length < 1) {
17       Msg.info("Usage   : IO platform_file ");
18       Msg.info("example : IO ../platforms/storage/storage.xml ");
19       System.exit(1);
20     }
21
22     Msg.createEnvironment(args[0]);
23
24     Host[] hosts = Host.all();
25
26     Msg.info("Number of hosts:" + hosts.length);
27     for (int i = 0; i < hosts.length && i < 4; i++) {
28       new io.file.Node(hosts[i],i).start();
29     }
30
31     Msg.run();
32   }
33 }