Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics, and add a README
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 27 Feb 2010 23:06:06 +0000 (23:06 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 27 Feb 2010 23:06:06 +0000 (23:06 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7135 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/java/suspend/DreamMaster.java
examples/java/suspend/LazyGuy.java
examples/java/suspend/README [new file with mode: 0644]
examples/java/suspend/SuspendTest.java

index 368e16b..5a9164c 100644 (file)
@@ -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
index 225e6f6..5dcaf01 100644 (file)
@@ -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. 
 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 (file)
index 0000000..e7d4d54
--- /dev/null
@@ -0,0 +1 @@
+A simple example of the functions to stop and resume a process.
\ No newline at end of file
index 9868e56..4a4cbff 100644 (file)
@@ -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]);