A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Still have to kill runnin' processes (on simix level)and clean ruby world when nothi...
[simgrid.git]
/
src
/
bindings
/
ruby
/
MasterSlave.rb
diff --git
a/src/bindings/ruby/MasterSlave.rb
b/src/bindings/ruby/MasterSlave.rb
index
377a530
..
1b0344f
100644
(file)
--- 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
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
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")
finalize_task.send(mailbox)
end
MSG::info("Master : Everything's Done")
+ Thread.list.each {|t| p t}
end
end
end
end
@@
-50,6
+52,7
@@
end
# Class Slave
#################################################
class Slave < MSG::Process
# Class Slave
#################################################
class Slave < MSG::Process
+
def main(args)
mailbox = "slave " + args[0]
for i in 0..args.size-1
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
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
end
MSG::info("Slave " + mailbox + "I'm Done , See You !!")
end
end
-
#################################################
# main chunck
#################################################
#################################################
# main chunck
#################################################
@@
-85,7
+88,8
@@
else
#Thread.list.each {|t| p t}
end
#Thread.list.each {|t| p t}
end
-# Thread.list.each {|t| p t}
MSG.run
MSG.run
+Thread.list.each {|t| p t}
puts "Simulation time : " + MSG.getClock .to_s
puts "Simulation time : " + MSG.getClock .to_s
+
# exit()
# exit()