Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modify ruby tesh files
authorcoldpeace <coldpeace@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 8 Apr 2010 16:32:02 +0000 (16:32 +0000)
committercoldpeace <coldpeace@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 8 Apr 2010 16:32:02 +0000 (16:32 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7482 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/ruby/MasterSlave.rb
examples/ruby/MasterSlave.tesh
examples/ruby/PingPong.tesh
examples/ruby/Quicksort.rb
examples/ruby/Quicksort.tesh
examples/ruby/README

index efc3a9d..bd6f69f 100644 (file)
@@ -1,5 +1,3 @@
-# Debug it with this command:
-# make -C ../.. && valgrind ruby MasterSlave.rb --log=ruby.thres:debug 2>&1 | less
 require 'simgrid'
 include MSG
 #################################################
@@ -24,7 +22,7 @@ class Master < MSG::Process
    
    # Creates and sends the tasks
     for i in 0..numberOfTask-1
-     task = RTask.new("Task_"+ i.to_s, taskComputeSize , taskCommunicationSize);
+     task = Task.new("Task_"+ i.to_s, taskComputeSize , taskCommunicationSize);
      mailbox = "slave " + (i%slaveCount).to_s
      MSG::info("Master Sending "+ task.name + " to " + mailbox + " with Comput Size " + 
            task.compSize.to_s)
@@ -37,7 +35,7 @@ class Master < MSG::Process
    MSG::info("Master: All tasks have been dispatched. Let's tell everybody the computation is over.")
    for i in 0..slaveCount-1
      mailbox = "slave " + i.to_s
-     finalize_task = RTask.new("finalize",0,0)
+     finalize_task = Task.new("finalize",0,0)
      finalize_task.send(mailbox)
    end
    MSG::info("Master : Everything's Done")
@@ -77,4 +75,4 @@ else
 end
 MSG.run
 puts "Simulation time : " + MSG.getClock .to_s
-MSG.exit
\ No newline at end of file
+MSG.exit
index da92c49..8eaf9d4 100644 (file)
@@ -1,5 +1,5 @@
 # MasterSlave Ruby Example
-$ ruby MasterSlave.rb
+$ ruby -I ../../src/bindings/ruby MasterSlave.rb
 > [Tremblay:Master:(1) 0.000000] [ruby/INFO] args[0]=20
 > [Tremblay:Master:(1) 0.000000] [ruby/INFO] args[1]=50000000
 > [Tremblay:Master:(1) 0.000000] [ruby/INFO] args[2]=1000000
index a483667..754bc15 100644 (file)
@@ -1,5 +1,5 @@
 #PingPong Example
-$ ruby PingPong.rb
+$ ruby -I ../../src/bindings/ruby PingPong.rb
 > [Inmos:Sender:(1) 0.000000] [ruby/INFO] Hello from Sender
 > [Inmos:Sender:(1) 0.000000] [ruby/INFO] Host count :1
 > [Inmos:Sender:(1) 0.000000] [ruby/INFO] sender time :0.0
index 4a32026..6c1b550 100644 (file)
@@ -36,10 +36,10 @@ class Sender < MSG::Process
    recv_mailbox = self.class
    res_task = MSG::Task.receive(recv_mailbox.to_s)
    result = res_task.data
-   MSG::info("Greate !! Thx Dude , you're my Best Friend !!")
+   MSG::info("Greate !! Thx !!")
    MSG::info("Here is my table after a quicksort :)")
    p result
-   MSG::info("Bye !! I finished My HomeWork !! Time to Sleep :)")
+   MSG::info("Bye Now :)")
    end
 
 end
@@ -55,14 +55,14 @@ class Receiver < MSG::Process
     lazy_friend = MSG::Host.getByName(args[0]).name
     send_mailbox = args[1]
     recv_mailbox = self.class
-    MSG::info("Oh Not Again !! Grrr")
+    MSG::info("Receiving Table from "+lazy_friend)
     task = MSG::Task.receive(recv_mailbox.to_s)
     table = task.data
     quicksort(table,0,table.size-1)
     task.join(table)
-    MSG::info("Ok "+lazy_friend+ "I did it, next time try to do it yourself:)")
+    MSG::info("Sort Done ... Sending Back the new table")
     task.send(send_mailbox)
-    MSG::info("Bye lazy Friend !!")
+    MSG::info("Bye lazy Boy!!")
     
   end    
   
@@ -87,7 +87,6 @@ def partition(list, p, r)
     return i + 1
 end
   
 end
 
 #################################################
index e11a164..c0fc118 100644 (file)
@@ -1,5 +1,5 @@
 #QuickSort Ruby Example
-$ ruby Quicksort.rb
+$ ruby -I ../../src/bindings/ruby Quicksort.rb
 > [Inmos:Sender:(1) 0.000000] [ruby/INFO] Hello Bellevue !!, Please !! I need you to help me to sort my table , Here it is :
 > [1, -2, 45, 67, 87, 76, 89, 56, 78, 3, -4, 99]
 > [Bellevue:Receiver:(2) 0.000000] [ruby/INFO] Receiving Table from Inmos
index 7e6c4d9..6a1d538 100644 (file)
@@ -15,7 +15,7 @@ Examples containing in this directory
 
     - Execute: 
     (WARNING: the current directory must be examples/ruby/)
-    ruby MasterSlave.rb
+    ruby -I ../../src/bindings/ruby MasterSlave.rb
 
 ===============================================================================
 * PingPong.rb
@@ -34,7 +34,7 @@ Examples containing in this directory
 
     - Execute: 
     (WARNING: the current directory must be examples/ruby/)
-    ruby PingPong.rb
+    ruby -I ../../src/bindings/ruby PingPong.rb
            
 ================================================================================
 * Quicksort.rb
@@ -54,5 +54,5 @@ Examples containing in this directory
 
     - Execute: 
     (WARNING: the current directory must be examples/ruby/)
-    ruby Quicksort.rb
+    ruby -I ../../src/bindings/ruby Quicksort.rb