Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not hide the issues that are there and shouldn't
[simgrid.git] / examples / ruby / MasterSlave.rb
index efc3a9d..198c4ca 100644 (file)
@@ -1,12 +1,9 @@
-# Debug it with this command:
-# make -C ../.. && valgrind ruby MasterSlave.rb --log=ruby.thres:debug 2>&1 | less
 require 'simgrid'
 include MSG
 #################################################
 # Class Master
 #################################################
 
-
 class Master < MSG::Process  
   # main : that function that will be executed when running simulation
 
@@ -24,7 +21,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,12 +34,15 @@ 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")
   end    
 end
+
+# end_of_master
+
 #################################################
 # Class Slave
 #################################################
@@ -65,6 +65,9 @@ class Slave < MSG::Process
     MSG::info("I'm done, see you")
   end
 end
+
+# end_of_slave
+
 #################################################
 # main chunck
 #################################################
@@ -77,4 +80,4 @@ else
 end
 MSG.run
 puts "Simulation time : " + MSG.getClock .to_s
-MSG.exit
\ No newline at end of file
+MSG.exit