X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2033091e2339a120d594b4cbf81a89d72faa0d05..ecd110f13bd1771203aa63d8bad992f9b77c0b96:/examples/java/basic/BasicTest.java diff --git a/examples/java/basic/BasicTest.java b/examples/java/basic/BasicTest.java index 6cea8585ea..e6c6a8f672 100644 --- a/examples/java/basic/BasicTest.java +++ b/examples/java/basic/BasicTest.java @@ -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(); }