lib/SimControl/controller.rb in SimControl-0.1.9 vs lib/SimControl/controller.rb in SimControl-0.1.10

- old
+ new

@@ -25,19 +25,19 @@ instance_eval(@simulation_description) instance_eval(@scenario_description) host_scenarios = @hosts.partition(all_scenarios, @hostname) + threads = [] host_scenarios.each do |scenarios_per_core| - threads = [] - scenarios_per_core.each do |scenario| - threads << Thread.new do + threads << Thread.new do + scenarios_per_core.each do |scenario| current_simulation.simulate(scenario, seeds) end end - threads.each do |thread| - thread.join - end + end + threads.each do |thread| + thread.join end end def repetitions(number_of_repetitions) @number_of_repetitions = number_of_repetitions