From: mquinson Date: Sat, 27 Feb 2010 23:06:06 +0000 (+0000) Subject: cosmetics, and add a README X-Git-Tag: SVN~603 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/eff77065e2847dfb52a0c1ce55e4b6c884e214fb cosmetics, and add a README git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7135 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/java/suspend/DreamMaster.java b/examples/java/suspend/DreamMaster.java index 368e16b468..5a9164c6b1 100644 --- a/examples/java/suspend/DreamMaster.java +++ b/examples/java/suspend/DreamMaster.java @@ -1,8 +1,7 @@ /* * $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. @@ -12,39 +11,29 @@ import simgrid.msg.*; public class DreamMaster extends simgrid.msg.Process { - public void main(String[] args) throws JniException, NativeException { - Msg.info("Hello !"); + public void main(String[] args) throws JniException, NativeException { + Msg.info("Hello !"); + Msg.info("Let's create a lazy guy."); - Msg.info("Let's create a lazy guy."); - - try - { - Host currentHost = Host.currentHost(); - - Msg.info("Current host name : " + currentHost.getName()); - - LazyGuy lazy = new LazyGuy(currentHost,"LazyGuy"); - - Msg.info("Let's wait a little bit..."); - - simgrid.msg.Process.waitFor(10.0); - - Msg.info("Let's wake the lazy guy up! >:) "); - - lazy.restart(); + try { + Host currentHost = Host.currentHost(); + Msg.info("Current hostname: " + currentHost.getName()); + + LazyGuy lazy = new LazyGuy(currentHost,"LazyGuy"); + Msg.info("Let's wait a little bit..."); + simgrid.msg.Process.waitFor(10.0); - } - catch(HostNotFoundException e) - { - System.err.println(e.toString()); - System.exit(1); - } + Msg.info("Let's wake the lazy guy up! >:) "); + lazy.restart(); + + } catch(HostNotFoundException e) { + System.err.println(e); + System.exit(1); + } - //lazy.migrate(currentHost); + //lazy.migrate(currentHost); - - - Msg.info("OK, goodbye now."); - } + Msg.info("OK, goodbye now."); + } } \ No newline at end of file diff --git a/examples/java/suspend/LazyGuy.java b/examples/java/suspend/LazyGuy.java index 225e6f6c1b..5dcaf01d40 100644 --- a/examples/java/suspend/LazyGuy.java +++ b/examples/java/suspend/LazyGuy.java @@ -1,8 +1,7 @@ /* * $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. @@ -11,26 +10,24 @@ import simgrid.msg.*; public class LazyGuy extends simgrid.msg.Process { - - - public LazyGuy() { - super(); + public LazyGuy() { + super(); } - - public LazyGuy(Host host,String name) + + public LazyGuy(Host host,String name) throws NullPointerException, HostNotFoundException, JniException, NativeException { - super(host,name,null); - } + super(host,name,null); + } - public void main(String[] args) throws JniException, NativeException { - Msg.info("Hello !"); - - Msg.info("Nobody's watching me ? Let's go to sleep."); - simgrid.msg.Process.currentProcess().pause(); - - Msg.info("Uuuh ? Did somebody call me ?"); - Msg.info("Mmmh, goodbye now."); - } + public void main(String[] args) throws JniException, NativeException { + Msg.info("Hello !"); + + Msg.info("Nobody's watching me ? Let's go to sleep."); + pause(); + + Msg.info("Uuuh ? Did somebody call me ?"); + Msg.info("Mmmh, goodbye now."); + } } \ No newline at end of file diff --git a/examples/java/suspend/README b/examples/java/suspend/README new file mode 100644 index 0000000000..e7d4d54ca5 --- /dev/null +++ b/examples/java/suspend/README @@ -0,0 +1 @@ +A simple example of the functions to stop and resume a process. \ No newline at end of file diff --git a/examples/java/suspend/SuspendTest.java b/examples/java/suspend/SuspendTest.java index 9868e56fe5..4a4cbffc59 100644 --- a/examples/java/suspend/SuspendTest.java +++ b/examples/java/suspend/SuspendTest.java @@ -25,9 +25,6 @@ public class SuspendTest { System.exit(1); } - /* specify a paje output file. */ - Msg.pajeOutput("suspend.trace"); - /* construct the platform and deploy the application */ Msg.createEnvironment(args[0]); Msg.deployApplication(args[1]);