Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update the platform files: the root tag is now called 'platform', not 'platform_descr...
[simgrid.git] / examples / java / comm_time / Slave.java
index 086a192..78cde4f 100644 (file)
@@ -19,30 +19,24 @@ public class Slave extends simgrid.msg.Process {
       Channel channel = new Channel(0);
                
       while(true) {
-        int a;
-        double time1,time2;
-         
-        time1 = Msg.getClock();
-        
-        CommTimeTask task = (CommTimeTask)channel.get();
-        time2 = Msg.getClock();
-                               
-        if(task.getData() == 221297) {
-           Msg.info("Received " + task.getName() + " " + getHost().getName());
+        double time1 = Msg.getClock();       
+        Task t = channel.get();        
+        double time2 = Msg.getClock();
+        if (t instanceof FinalizeTask) {
            break;
         }
+        CommTimeTask task = (CommTimeTask)t;
             
         if(time1 < task.getTime())
           time1 = task.getTime();
         
-        Msg.info("Processing \"" + task.getName() + "\" " + getHost().getName() + 
+/*      Msg.info("Processing \"" + task.getName() + "\" " + getHost().getName() + 
                  " (Communication time : " +  (time2 - time1) + ")");
-            
+*/          
         task.execute();
-        
-        
       }
        
-      Msg.info("I'm done. See you!" + getHost().getName());
+      Msg.info("Received Finalize. I'm done. See you!");
    }
 }
\ No newline at end of file