From: coldpeace Date: Thu, 8 Apr 2010 16:32:02 +0000 (+0000) Subject: Modify ruby tesh files X-Git-Tag: SVN~258 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/838dca2dd964bd4db6576349e33eeeaea28fef3c Modify ruby tesh files git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7482 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/ruby/MasterSlave.rb b/examples/ruby/MasterSlave.rb index efc3a9d7fd..bd6f69f41d 100644 --- a/examples/ruby/MasterSlave.rb +++ b/examples/ruby/MasterSlave.rb @@ -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 diff --git a/examples/ruby/MasterSlave.tesh b/examples/ruby/MasterSlave.tesh index da92c498c1..8eaf9d4d32 100644 --- a/examples/ruby/MasterSlave.tesh +++ b/examples/ruby/MasterSlave.tesh @@ -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 diff --git a/examples/ruby/PingPong.tesh b/examples/ruby/PingPong.tesh index a483667f65..754bc158db 100644 --- a/examples/ruby/PingPong.tesh +++ b/examples/ruby/PingPong.tesh @@ -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 diff --git a/examples/ruby/Quicksort.rb b/examples/ruby/Quicksort.rb index 4a32026706..6c1b5500a7 100644 --- a/examples/ruby/Quicksort.rb +++ b/examples/ruby/Quicksort.rb @@ -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 ################################################# diff --git a/examples/ruby/Quicksort.tesh b/examples/ruby/Quicksort.tesh index e11a164d70..c0fc1181e6 100644 --- a/examples/ruby/Quicksort.tesh +++ b/examples/ruby/Quicksort.tesh @@ -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 diff --git a/examples/ruby/README b/examples/ruby/README index 7e6c4d9c8b..6a1d538907 100644 --- a/examples/ruby/README +++ b/examples/ruby/README @@ -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