lib/paraduct/parallel_runner.rb in paraduct-0.0.1.beta7 vs lib/paraduct/parallel_runner.rb in paraduct-0.0.1.beta8

- old
+ new

@@ -13,51 +13,40 @@ Paraduct.logger.info <<-EOS ====================================================== START matrix test EOS - product_variables.each do |params| - Paraduct.logger.info "params: #{params.map{ |key, value| "#{key}=#{value}" }.join(", ")}" - end pool = Thread.pool(Paraduct.config.max_threads) begin product_variables.each do |params| + runner = Paraduct::Runner.new( + script: script, + params: params, + base_job_dir: base_job_dir, + ) + runner.logger.info "[START] params: #{runner.formatted_params}" pool.process do - runner = Paraduct::Runner.new( - script: script, - params: params, - base_job_dir: base_job_dir, - ) - runner.setup_dir begin stdout = runner.perform successful = true rescue Paraduct::Errors::ProcessError => e stdout = e.message successful = false end - Paraduct.logger.info <<-EOS -====================================================== -params: #{runner.formatted_params} -job_name: #{runner.job_name} -job_dir: #{runner.job_dir} + runner.logger.info "[END] params: #{runner.formatted_params}" - #{stdout} - EOS - test_response.jobs_push( job_name: runner.job_name, params: runner.params, formatted_params: runner.formatted_params, successful: successful, stdout: stdout, ) end end - ensure pool.shutdown end test_response