lib/sushi_fabric/sushiApp.rb in sushi_fabric-0.5.8 vs lib/sushi_fabric/sushiApp.rb in sushi_fabric-0.5.9
- old
+ new
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
# encoding: utf-8
-# Version = '20160331-140604'
+# Version = '20160331-152819'
require 'csv'
require 'fileutils'
require 'yaml'
require 'drb/drb'
@@ -353,18 +353,18 @@
@scratch_dir = if @params['process_mode'] == 'SAMPLE'
@scratch_result_dir + "_" + @dataset['Name'] + '_temp$$'
else
@scratch_result_dir + '_temp$$'
end
- parent_data_set_job_ids = if @dataset_sushi_id and data_set = DataSet.find_by_id(@dataset_sushi_id.to_i)
- parent_data_set = data_set.data_set
- parent_data_set.jobs.map{|job| job.submit_job_id}.join(",")
+ hold_jid_option = if @dataset_sushi_id and parent_data_set = DataSet.find_by_id(@dataset_sushi_id.to_i) and !parent_data_set.jobs.empty?
+ parent_data_set_job_ids = parent_data_set.jobs.map{|job| job.submit_job_id}.join(",")
+ "#\$ -hold_jid #{parent_data_set_job_ids}"
else
''
end
@out.print <<-EOF
#!/bin/bash
-#\$ -hold_jid #{parent_data_set_job_ids}
+#{hold_jid_option}
set -e
set -o pipefail
#### SET THE STAGE
SCRATCH_DIR=#{@scratch_dir}