Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add VM API from MSG (experimental, still buggy in MSG C part anyway)
[simgrid.git] / examples / async / Forwarder.java
index d17bb93..29e9d18 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 package async;
+import org.simgrid.msg.Host;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.MsgException;
 import org.simgrid.msg.Task;
@@ -13,7 +14,9 @@ import org.simgrid.msg.Process;
 
 
 public class Forwarder extends Process {
-
+       public Forwarder(Host host, String name, String[]args) {
+               super(host,name,args);
+       }
        public void main(String[] args) throws MsgException {
                if (args.length < 3) {   
                        Msg.info("Forwarder needs 3 arguments (input mailbox, first output mailbox, last one)");
@@ -37,7 +40,7 @@ public class Forwarder extends Process {
                                        Task tf = new FinalizeTask();
                                        tf.dsend("slave_"+cpt);
                                }
-                               simulatedSleep(20);
+                               waitFor(20);
                                break;
                        }
                        int dest = firstOutput + (taskCount % slavesCount);