Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Dig through git history, and update copyright lines.
[simgrid.git] / examples / java / masterslave / Masterslave.java
1 /*
2  * Copyright (c) 2006-2013. The SimGrid Team.
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package.
7  */
8
9 package masterslave;
10
11 import java.io.File;
12
13 import org.simgrid.msg.Msg;
14 import org.simgrid.msg.NativeException;
15
16 public class Masterslave {
17    public static final int TASK_COMP_SIZE = 10000000;
18    public static final int TASK_COMM_SIZE = 10000000;
19    /* This only contains the launcher. If you do nothing more than than you can run
20     *   java simgrid.msg.Msg
21     * which also contains such a launcher
22     */
23
24     public static void main(String[] args) throws NativeException {
25         /* initialize the MSG simulation. Must be done before anything else (even logging). */
26         Msg.init(args);
27
28         String platf  = args.length > 1 ? args[0] : "examples/java/platform.xml";
29         String deploy =  args.length > 1 ? args[1] : "examples/java/masterslave/masterslaveDeployment.xml";
30
31         Msg.verb("Platform: "+platf+"; Deployment:"+deploy+"; Current directory: "+new File(".").getAbsolutePath());
32
33         /* construct the platform and deploy the application */
34         Msg.createEnvironment(platf);
35         Msg.deployApplication(deploy);
36         /*  execute the simulation. */
37         Msg.run();
38     }
39 }