Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / examples / java / masterslave / Masterslave.java
1 /* Copyright (c) 2006-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 masterslave;
8
9 import java.io.File;
10
11 import org.simgrid.msg.Msg;
12 import org.simgrid.msg.NativeException;
13
14 public class Masterslave {
15   public static final int TASK_COMP_SIZE = 10000000;
16   public static final int TASK_COMM_SIZE = 10000000;
17   /* This only contains the launcher. If you do nothing more than than you can run java simgrid.msg.Msg
18    * which also contains such a launcher
19    */
20
21   public static void main(String[] args) throws NativeException {
22     /* initialize the MSG simulation. Must be done before anything else (even logging). */
23     Msg.init(args);
24
25     String platf  = args.length > 1 ? args[0] : "examples/java/platform.xml";
26     String deploy =  args.length > 1 ? args[1] : "examples/java/masterslave/masterslaveDeployment.xml";
27
28     Msg.verb("Platform: "+platf+"; Deployment:"+deploy+"; Current directory: "+new File(".").getAbsolutePath());
29
30     /* construct the platform and deploy the application */
31     Msg.createEnvironment(platf);
32     Msg.deployApplication(deploy);
33     /*  execute the simulation. */
34     Msg.run();
35   }
36 }