Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into hypervisor
[simgrid.git] / examples / java / io / IO.java
1 /*
2  * 2012. The SimGrid Team. 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;
8
9 import org.simgrid.msg.Host;
10 import org.simgrid.msg.Msg;
11 import org.simgrid.msg.MsgException;
12 /**
13  * This example demonstrates of how to use the other
14  * kind of resources, such as disk or GPU. These resources are quite
15  * experimental for now, but here we go anyway.
16  */
17 public class IO {
18     public static void main(String[] args) throws MsgException {        
19                 Msg.init(args);
20                 if(args.length < 1) {
21                         Msg.info("Usage   : IO platform_file ");
22                 Msg.info("example : IO platform.xml ");
23                 System.exit(1);
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.Node(hosts[i],i).start();
32                 }
33                 
34                 Msg.run();              
35     }
36 }