Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename directory.
[simgrid.git] / examples / java / basic / BasicTest.java
index 6cea858..e6c6a8f 100644 (file)
@@ -1,8 +1,5 @@
 /*
- * $Id$
- *
- * Copyright 2006,2007 Martin Quinson, Malek Cherier         
- * All rights reserved. 
+ * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. 
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. 
@@ -17,27 +14,28 @@ public class BasicTest {
     * which also contains such a launcher
     */
    
-    public static void main(String[] args) throws JniException, NativeException {
+    public static void main(String[] args) throws NativeException {
        
-       /* initialize the MSG simulation. Must be done before anything else (even logging). */
-       Msg.init(args);
+       /* initialize the MSG simulation. Must be done before anything else (even logging). */
+       Msg.init(args);
+
+       if(args.length == 0) {
+               Msg.createEnvironment("basic_platform.xml");
+               Msg.deployApplication("basic_deployment.xml");
+          
+       } else if (args.length < 2) {
 
-       if(args.length < 2) {
                
          Msg.info("Usage   : Basic platform_file deployment_file");
          Msg.info("example : Basic basic_platform.xml basic_deployment.xml");
          System.exit(1);
-       }
-               
-       /* specify the number of channel for the process of the simulation. */
-       Channel.setNumber(1);
-        /* specify a paje output file. */
-        Msg.pajeOutput("basic.trace");
+       } else {
                
        /* construct the platform and deploy the application */
        Msg.createEnvironment(args[0]);
        Msg.deployApplication(args[1]);
-               
+       }
+       
        /*  execute the simulation. */
         Msg.run();
     }