Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stuks When a process ( Slave ) Tries to Recieve a Task...
[simgrid.git] / src / bindings / ruby / Slave.rb
index 07e848e..e85da1f 100644 (file)
@@ -9,26 +9,34 @@ class Slave < RbProcess
     super()
   end
   
+  #for Testing
+  def msg_main2(args)
+    info("Hello From Slave")
+  end
+  
+  
+  
+  
+  
  # msg_main : that function that will be executed when Running Simulation
   def msg_main(args)
-    puts "Hello From Slave"
+    info("Hello From Slave")
     s_mailbox = "slave>>" + args[0]
+
     while true
-     
-      p "Hellow...................here3 "+s_mailbox
-      task = RbTask.receive(s_mailbox)
-      task_name = RbTask.name(task)
-      if ( task_name == "finalize" )
-       puts "Slave" + s_mailbox + "got finalize msg"
+        
+       info("Ready to Receive Task")
+       task = RbTask.receive(s_mailbox)
+       task_name = RbTask.name(task)
+       info ("Task Received : " + task_name)
+      if (task_name == "finalize")
+       info("Slave" + s_mailbox + "got finalize msg")
        break
       end
-      puts "Slave " + s_mailbox + "Processing" + RbTask.name(task)
-      RbTask.execute(task)
+      info("Slave " + s_mailbox + " ...Processing" + RbTask.name(task))
+       RbTask.execute(task)
     end
-    puts "Slave " + s_mailbox + "I'm Done , See You !!"
+    info("Slave " + s_mailbox +  "I'm Done , See You !!")
     end
     
   end
-  
-
-# slave = Slave.new
\ No newline at end of file