X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5b6830658ae00f48fbca5a43ed666c98301b163c..16dd4462054b2f22e97c7813f57088d5df7c27d4:/src/bindings/ruby/MasterSlave.rb diff --git a/src/bindings/ruby/MasterSlave.rb b/src/bindings/ruby/MasterSlave.rb index 377a530abf..1b0344fdb8 100644 --- a/src/bindings/ruby/MasterSlave.rb +++ b/src/bindings/ruby/MasterSlave.rb @@ -11,6 +11,7 @@ include MSG class Master < MSG::Process # main : that function that will be executed when Running Simulation + def main(args) # args is an array containing arguments for function master size = args.size for i in 0..size-1 @@ -43,6 +44,7 @@ class Master < MSG::Process finalize_task.send(mailbox) end MSG::info("Master : Everything's Done") + Thread.list.each {|t| p t} end end @@ -50,6 +52,7 @@ end # Class Slave ################################################# class Slave < MSG::Process + def main(args) mailbox = "slave " + args[0] for i in 0..args.size-1 @@ -66,12 +69,12 @@ class Slave < MSG::Process end MSG::info("Slave " + mailbox + " ...Processing" + task.name) task.execute + MSG::info("task "+ task.name + " Executed !!") end MSG::info("Slave " + mailbox + "I'm Done , See You !!") end end - ################################################# # main chunck ################################################# @@ -85,7 +88,8 @@ else #Thread.list.each {|t| p t} end -# Thread.list.each {|t| p t} MSG.run +Thread.list.each {|t| p t} puts "Simulation time : " + MSG.getClock .to_s + # exit()