Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'surf++'
[simgrid.git] / examples / java / priority / Priority.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 package priority;
9 import org.simgrid.msg.Msg;
10 import org.simgrid.msg.NativeException;
11 /**
12  * Demonstrates the use of Task.setPriority to change
13  * the computation priority of a task
14  */ 
15 public class Priority  {
16
17    /* This only contains the launcher. If you do nothing more than than you can run 
18     *   java simgrid.msg.Msg
19     * which also contains such a launcher
20     */
21     
22     public static void main(String[] args) throws NativeException {     
23                 /* initialize the MSG simulation. Must be done before anything else (even logging). */
24                 Msg.init(args);
25                 if(args.length < 2) {
26                         Msg.info("Usage   : Priority platform_file deployment_file");
27                 Msg.info("example : Priority ping_pong_platform.xml ping_pong_deployment.xml");
28                 System.exit(1);
29                 }
30         
31                 /* construct the platform and deploy the application */
32                 Msg.createEnvironment(args[0]);
33                 Msg.deployApplication(args[1]);
34                 
35                 /*  execute the simulation. */
36             Msg.run();
37     }
38 }