Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
37509a07f74a95894cbff5ea85553ade9fc54a9e
[simgrid.git] / examples / java / migration / Migration.java
1 /* Copyright (c) 2012-2014, 2016. 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 migration;
8 import org.simgrid.msg.Msg;
9 import org.simgrid.msg.Mutex;
10 import org.simgrid.msg.Process;
11 import org.simgrid.msg.NativeException;
12
13 public class Migration {
14   public static Mutex mutex;
15   public static Process processToMigrate = null;
16
17   public static void main(String[] args) throws NativeException {      
18     Msg.init(args);
19     if(args.length < 2) {
20       Msg.info("Usage   : Migration platform_file deployment_file");
21       Msg.info("example : Migration ../platforms/platform.xml migrationDeployment.xml");
22       System.exit(1);
23     }
24     /* Create the mutex */
25     mutex = new Mutex();
26
27     /* construct the platform and deploy the application */
28     Msg.createEnvironment(args[0]);
29     Msg.deployApplication(args[1]);
30
31     /*  execute the simulation. */
32     Msg.run();
33   }
34 }