rbbt-util 5.32.10 → 5.32.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rbbt +1 -0
  3. data/lib/rbbt/annotations/util.rb +1 -0
  4. data/lib/rbbt/entity.rb +6 -1
  5. data/lib/rbbt/hpc/batch.rb +26 -9
  6. data/lib/rbbt/hpc/orchestrate.rb +1 -0
  7. data/lib/rbbt/hpc/slurm.rb +29 -12
  8. data/lib/rbbt/resource.rb +51 -49
  9. data/lib/rbbt/tsv.rb +5 -0
  10. data/lib/rbbt/tsv/csv.rb +2 -2
  11. data/lib/rbbt/tsv/manipulate.rb +2 -0
  12. data/lib/rbbt/tsv/parallel/traverse.rb +8 -11
  13. data/lib/rbbt/util/R.rb +2 -2
  14. data/lib/rbbt/util/cmd.rb +39 -18
  15. data/lib/rbbt/util/log/progress/report.rb +20 -17
  16. data/lib/rbbt/util/log/progress/util.rb +2 -1
  17. data/lib/rbbt/util/misc/omics.rb +2 -2
  18. data/lib/rbbt/util/misc/system.rb +2 -2
  19. data/lib/rbbt/util/python.rb +63 -3
  20. data/lib/rbbt/util/simpleDSL.rb +4 -4
  21. data/lib/rbbt/workflow.rb +32 -4
  22. data/lib/rbbt/workflow/definition.rb +1 -1
  23. data/lib/rbbt/workflow/step.rb +37 -6
  24. data/lib/rbbt/workflow/step/accessor.rb +2 -2
  25. data/lib/rbbt/workflow/util/data.rb +35 -0
  26. data/lib/rbbt/workflow/util/provenance.rb +26 -7
  27. data/lib/rbbt/workflow/util/trace.rb +2 -1
  28. data/python/rbbt.py +7 -0
  29. data/share/install/software/lib/install_helpers +1 -1
  30. data/share/rbbt_commands/hpc/list +11 -7
  31. data/share/rbbt_commands/hpc/orchestrate +7 -1
  32. data/share/rbbt_commands/hpc/task +5 -0
  33. data/share/rbbt_commands/lsf/list +11 -7
  34. data/share/rbbt_commands/lsf/orchestrate +7 -1
  35. data/share/rbbt_commands/lsf/task +5 -0
  36. data/share/rbbt_commands/slurm/list +11 -7
  37. data/share/rbbt_commands/slurm/orchestrate +7 -1
  38. data/share/rbbt_commands/slurm/task +5 -0
  39. data/share/rbbt_commands/workflow/forget_deps +5 -4
  40. data/test/rbbt/util/test_python.rb +3 -2
  41. data/test/rbbt/util/test_simpleDSL.rb +3 -3
  42. data/test/rbbt/workflow/util/test_data.rb +48 -0
  43. metadata +86 -83
@@ -0,0 +1,35 @@
1
+ require 'rbbt/workflow'
2
+ require 'rbbt/workflow/examples'
3
+
4
+ module Workflow
5
+ module Data
6
+ def data(directory)
7
+ @@data_directory = directory
8
+ end
9
+
10
+ def get_datadir(clean_name)
11
+ data_dir = File.join(@@data_directory, clean_name)
12
+ raise "Data dir not found #{data_dir}" unless File.directory?(data_dir)
13
+ if Path === @@data_directory
14
+ @@data_directory.annotate data_dir
15
+ else
16
+ Path.setup(data_dir)
17
+ end
18
+ end
19
+
20
+ def data_task(name, workflow, oname, *rest, &block)
21
+ dep_task(name, workflow, oname, *rest) do |jobname, options|
22
+ data_dir = self.get_datadir(jobname)
23
+ task_info = workflow.task_info(oname)
24
+ dir_options = Workflow.load_inputs(data_dir.options, task_info[:inputs], task_info[:input_types])
25
+ data_options = block.call data_dir, dir_options, task_info
26
+ if data_options.include?(:inputs)
27
+ data_options
28
+ else
29
+ {:inputs => data_options.merge(options)}
30
+ end
31
+ end
32
+ end
33
+ end
34
+
35
+ end
@@ -26,7 +26,7 @@ class Step
26
26
  Log.color(color, status.to_s)
27
27
  end
28
28
 
29
- def self.prov_report_msg(status, name, path, info = nil)
29
+ def self.prov_report_msg(status, name, path, info, input = nil)
30
30
  parts = path.sub(/\{.*/,'').split "/"
31
31
 
32
32
  parts.pop
@@ -43,10 +43,17 @@ class Step
43
43
  rescue Exception
44
44
  nil
45
45
  end
46
+
47
+ if input.nil? || input.empty?
48
+ input_str = nil
49
+ else
50
+ input_str = Log.color(:magenta, "-> ") + input.collect{|dep,name| Log.color(:yellow, dep.task_name.to_s) + ":" + Log.color(:yellow, name) }.uniq * " "
51
+ end
52
+
46
53
  str = if ! (Open.remote?(path) || Open.ssh?(path)) && (Open.exists?(path) && $main_mtime && path_mtime && ($main_mtime - path_mtime) < -2)
47
- prov_status_msg(status.to_s) << " " << [workflow, task, path].compact * " " << " (#{Log.color(:red, "Mtime out of sync") })"
54
+ prov_status_msg(status.to_s) << " " << [workflow, task, path, input_str].compact * " " << " (#{Log.color(:red, "Mtime out of sync") })"
48
55
  else
49
- prov_status_msg(status.to_s) << " " << [workflow, task, path].compact * " "
56
+ prov_status_msg(status.to_s) << " " << [workflow, task, path, input_str].compact * " "
50
57
  end
51
58
 
52
59
  if $inputs and $inputs.any?
@@ -74,7 +81,7 @@ class Step
74
81
  str << "\n"
75
82
  end
76
83
 
77
- def self.prov_report(step, offset = 0, task = nil, seen = [], expand_repeats = false)
84
+ def self.prov_report(step, offset = 0, task = nil, seen = [], expand_repeats = false, input = nil)
78
85
  info = step.info || {}
79
86
  info[:task_name] = task
80
87
  path = step.path
@@ -85,13 +92,25 @@ class Step
85
92
  status = :notfound if status == :noinfo and not Open.exist?(path)
86
93
 
87
94
  str = " " * offset
88
- str << prov_report_msg(status, name, path, info)
95
+ str << prov_report_msg(status, name, path, info, input)
96
+
97
+ input_dependencies = {}
98
+ step.dependencies.each do |dep|
99
+ if dep.input_dependencies.any?
100
+ dep.input_dependencies.each do |id|
101
+ input_name = dep.inputs.fields.zip(dep.inputs).select{|f,d| d == id || String === d && d.start_with?(id.files_dir) }.first.first
102
+ input_dependencies[id] ||= []
103
+ input_dependencies[id] << [dep, input_name]
104
+ end
105
+ end
106
+ end
107
+
89
108
  step.dependencies.reverse.each do |dep|
90
109
  path = dep.path
91
110
  new = ! seen.include?(path)
92
111
  if new
93
112
  seen << path
94
- str << prov_report(dep, offset + 1, task, seen, expand_repeats)
113
+ str << prov_report(dep, offset + 1, task, seen, expand_repeats, input_dependencies[dep])
95
114
  else
96
115
  if expand_repeats
97
116
  str << Log.color(Step.status_color(dep.status), Log.uncolor(prov_report(dep, offset+1, task)))
@@ -103,7 +122,7 @@ class Step
103
122
  status = :unsync if status == :done and not Open.exist?(path)
104
123
  status = :notfound if status == :noinfo and not Open.exist?(path)
105
124
 
106
- str << Log.color(Step.status_color(status), " " * (offset + 1) + Log.uncolor(prov_report_msg(status, name, path, info)))
125
+ str << Log.color(Step.status_color(status), " " * (offset + 1) + Log.uncolor(prov_report_msg(status, name, path, info, input_dependencies[dep])))
107
126
  end
108
127
  end
109
128
  end if step.dependencies
@@ -188,6 +188,7 @@ rbbt.png_plot('#{plot}', 'plot(timeline)', width=#{width}, height=#{height}, poi
188
188
  seed_jobs.each do |step|
189
189
  jobs += step.rec_dependencies + [step]
190
190
  step.info[:archived_info].each do |path,ainfo|
191
+ next unless Hash === ainfo
191
192
  archived_step = Step.new path
192
193
 
193
194
  archived_step.define_singleton_method :info do
@@ -205,7 +206,7 @@ rbbt.png_plot('#{plot}', 'plot(timeline)', width=#{width}, height=#{height}, poi
205
206
 
206
207
  end
207
208
 
208
- jobs = jobs.uniq.sort_by{|job| t = job.info[:started] || Open.mtime(job.path) || Time.now; Time === t ? t : Time.parse(t) }
209
+ jobs = jobs.uniq.sort_by{|job| [job, job.info]; t = job.info[:started] || Open.mtime(job.path) || Time.now; Time === t ? t : Time.parse(t) }
209
210
 
210
211
  data = trace_job_times(jobs, options[:fix_gap])
211
212
 
data/python/rbbt.py ADDED
@@ -0,0 +1,7 @@
1
+ import warnings
2
+ import sys
3
+ import os
4
+ os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
5
+
6
+ def rbbt():
7
+ print("Rbbt")
@@ -499,7 +499,7 @@ install_jar(){
499
499
  local url="$2"
500
500
 
501
501
  [ -d "$OPT_DIR/$name/" ] || mkdir -p "$OPT_DIR/$name/"
502
- wget "$url" -O "$OPT_DIR/jars/$name.jar" || wget "$url" -O "$OPT_DIR/jars/$name.jar" --no-check-certificate || (rm "$OPT_DIR/jars/$name.jar"; exit -1)
502
+ wget "$url" -O "$OPT_DIR/$name/$name.jar" || wget "$url" -O "$OPT_DIR/$name/$name.jar" --no-check-certificate || (rm "$OPT_DIR/$name/$name.jar"; exit -1)
503
503
  link "$OPT_DIR/$name/$name.jar" "$OPT_JAR_DIR/$name.jar"
504
504
  }
505
505
 
@@ -173,7 +173,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
173
173
  select = true if queued && deps && (running_jobs & deps).any? || queued && is_running && nodes.empty?
174
174
  select = true if running && nodes.any? && (exit_status.nil? && running_jobs.include?(id)) && (!deps || (running_jobs & deps).empty?)
175
175
  select = true if jobid && jobid.split(",").include?(id)
176
- select = select && cmd.match(/#{search}/) if search
176
+ select = select && step_path.match(/#{search}/) if search
177
177
  next unless select
178
178
  elsif search
179
179
  select = false
@@ -206,9 +206,9 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
206
206
  puts Log.color(:magenta, "BATCH parameters: ")
207
207
  case job_batch_system
208
208
  when 'slurm'
209
- text = CMD.cmd('grep "^#SBATCH" |tail -n +5', :in => Open.read(fcmd)).read.strip
209
+ text = CMD.cmd('grep "^#SBATCH" ', :in => Open.read(fcmd)).read.strip
210
210
  when 'lsf'
211
- text = CMD.cmd('grep "^#BSUB" |tail -n +5', :in => Open.read(fcmd)).read.strip
211
+ text = CMD.cmd('grep "^#BSUB" ', :in => Open.read(fcmd)).read.strip
212
212
  else
213
213
  text = ""
214
214
  end
@@ -292,13 +292,17 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
292
292
  step_path = step_line.split(": ").last.strip
293
293
  step = Step.new step_path
294
294
  step.load_dependencies_from_info
295
+ has_bar = false
295
296
  (step.rec_dependencies + [step]).reverse.each do |j|
296
297
  next if j.done?
297
- next unless j.file(:progress).exists?
298
- bar = Log::ProgressBar.new
299
- bar.load(j.file(:progress).yaml)
300
- puts Log.color(:magenta, "Progress: ") + bar.report_msg + " " + Log.color(:yellow, j.task_signature)
298
+ if j.file(:progress).exists?
299
+ bar = Log::ProgressBar.new
300
+ bar.load(j.file(:progress).yaml)
301
+ puts Log.color(:magenta, "Progress: ") + bar.report_msg + " " + Log.color(:yellow, j.task_signature)
302
+ has_bar = true
303
+ end
301
304
  end
305
+ puts Log.color(:magenta, "Progress: ") + Log.color(:yellow, step.task_signature) + " #{step.status}" unless has_bar
302
306
  end
303
307
  end
304
308
 
@@ -19,6 +19,7 @@ $slurm_options = SOPT.get <<EOF
19
19
  -e--exclusive Make exclusive use of the node
20
20
  -hm--highmem Make use of highmem cores
21
21
  -wc--wipe_container* Wipe the jobs from the contain directory
22
+ -pd--purge_deps Purge job dependencies
22
23
  -CS--contain_and_sync Contain and sync to default locations
23
24
  -ci--copy_image When using a container directory, copy image there
24
25
  -t--tail Tail the logs
@@ -26,11 +27,16 @@ $slurm_options = SOPT.get <<EOF
26
27
  -q--queue* Queue
27
28
  -t--task_cpus* Tasks
28
29
  -tm--time* Time
30
+ -m--mem* SLURM minimum memory
31
+ --gres* SLURM Generic resources
32
+ -mcpu--mem_per_cpu* SLURM minimum memory per CPU
29
33
  -lin--licenses* SLURM licenses
30
34
  -cons--constraint* SLURM constraint
31
35
  -W--workflows* Additional workflows
32
- -OR--orchestration_rules* Orchestration rules
33
36
  -rmb--remove_batch_basedir Remove the SLURM working directory (command, STDIN, exit status, ...)
37
+ -lmod--lua_modules* Lua Modules to load
38
+ -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect)
39
+ -OR--orchestration_rules* Orchestration rules
34
40
  EOF
35
41
 
36
42
  batch_system = $slurm_options.delete :batch_system
@@ -18,6 +18,7 @@ $slurm_options = SOPT.get <<EOF
18
18
  -e--exclusive Make exclusive use of the node
19
19
  -hm--highmem Make use of highmem cores
20
20
  -wc--wipe_container* Wipe the jobs from the contain directory
21
+ -pd--purge_deps Purge job dependencies
21
22
  -CS--contain_and_sync Contain and sync to default locations
22
23
  -ci--copy_image When using a container directory, copy image there
23
24
  -t--tail Tail the logs
@@ -25,10 +26,14 @@ $slurm_options = SOPT.get <<EOF
25
26
  -q--queue* Queue
26
27
  -t--task_cpus* Tasks
27
28
  -tm--time* Time
29
+ -m--mem* SLURM minimum memory
30
+ --gres* SLURM Generic resources
31
+ -mcpu--mem_per_cpu* SLURM minimum memory per CPU
28
32
  -lin--licenses* SLURM licenses
29
33
  -cons--constraint* SLURM constraint
30
34
  -W--workflows* Additional workflows
31
35
  -rmb--remove_batch_dir Remove the batch working directory (command, STDIN, exit status, ...)
36
+ -lmod--lua_modules* Lua Modules to load
32
37
  -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect)
33
38
  EOF
34
39
 
@@ -173,7 +173,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
173
173
  select = true if queued && deps && (running_jobs & deps).any? || queued && is_running && nodes.empty?
174
174
  select = true if running && nodes.any? && (exit_status.nil? && running_jobs.include?(id)) && (!deps || (running_jobs & deps).empty?)
175
175
  select = true if jobid && jobid.split(",").include?(id)
176
- select = select && cmd.match(/#{search}/) if search
176
+ select = select && step_path.match(/#{search}/) if search
177
177
  next unless select
178
178
  elsif search
179
179
  select = false
@@ -206,9 +206,9 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
206
206
  puts Log.color(:magenta, "BATCH parameters: ")
207
207
  case job_batch_system
208
208
  when 'slurm'
209
- text = CMD.cmd('grep "^#SBATCH" |tail -n +5', :in => Open.read(fcmd)).read.strip
209
+ text = CMD.cmd('grep "^#SBATCH" ', :in => Open.read(fcmd)).read.strip
210
210
  when 'lsf'
211
- text = CMD.cmd('grep "^#BSUB" |tail -n +5', :in => Open.read(fcmd)).read.strip
211
+ text = CMD.cmd('grep "^#BSUB" ', :in => Open.read(fcmd)).read.strip
212
212
  else
213
213
  text = ""
214
214
  end
@@ -292,13 +292,17 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
292
292
  step_path = step_line.split(": ").last.strip
293
293
  step = Step.new step_path
294
294
  step.load_dependencies_from_info
295
+ has_bar = false
295
296
  (step.rec_dependencies + [step]).reverse.each do |j|
296
297
  next if j.done?
297
- next unless j.file(:progress).exists?
298
- bar = Log::ProgressBar.new
299
- bar.load(j.file(:progress).yaml)
300
- puts Log.color(:magenta, "Progress: ") + bar.report_msg + " " + Log.color(:yellow, j.task_signature)
298
+ if j.file(:progress).exists?
299
+ bar = Log::ProgressBar.new
300
+ bar.load(j.file(:progress).yaml)
301
+ puts Log.color(:magenta, "Progress: ") + bar.report_msg + " " + Log.color(:yellow, j.task_signature)
302
+ has_bar = true
303
+ end
301
304
  end
305
+ puts Log.color(:magenta, "Progress: ") + Log.color(:yellow, step.task_signature) + " #{step.status}" unless has_bar
302
306
  end
303
307
  end
304
308
 
@@ -19,6 +19,7 @@ $slurm_options = SOPT.get <<EOF
19
19
  -e--exclusive Make exclusive use of the node
20
20
  -hm--highmem Make use of highmem cores
21
21
  -wc--wipe_container* Wipe the jobs from the contain directory
22
+ -pd--purge_deps Purge job dependencies
22
23
  -CS--contain_and_sync Contain and sync to default locations
23
24
  -ci--copy_image When using a container directory, copy image there
24
25
  -t--tail Tail the logs
@@ -26,11 +27,16 @@ $slurm_options = SOPT.get <<EOF
26
27
  -q--queue* Queue
27
28
  -t--task_cpus* Tasks
28
29
  -tm--time* Time
30
+ -m--mem* SLURM minimum memory
31
+ --gres* SLURM Generic resources
32
+ -mcpu--mem_per_cpu* SLURM minimum memory per CPU
29
33
  -lin--licenses* SLURM licenses
30
34
  -cons--constraint* SLURM constraint
31
35
  -W--workflows* Additional workflows
32
- -OR--orchestration_rules* Orchestration rules
33
36
  -rmb--remove_batch_basedir Remove the SLURM working directory (command, STDIN, exit status, ...)
37
+ -lmod--lua_modules* Lua Modules to load
38
+ -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect)
39
+ -OR--orchestration_rules* Orchestration rules
34
40
  EOF
35
41
 
36
42
  batch_system = $slurm_options.delete :batch_system
@@ -18,6 +18,7 @@ $slurm_options = SOPT.get <<EOF
18
18
  -e--exclusive Make exclusive use of the node
19
19
  -hm--highmem Make use of highmem cores
20
20
  -wc--wipe_container* Wipe the jobs from the contain directory
21
+ -pd--purge_deps Purge job dependencies
21
22
  -CS--contain_and_sync Contain and sync to default locations
22
23
  -ci--copy_image When using a container directory, copy image there
23
24
  -t--tail Tail the logs
@@ -25,10 +26,14 @@ $slurm_options = SOPT.get <<EOF
25
26
  -q--queue* Queue
26
27
  -t--task_cpus* Tasks
27
28
  -tm--time* Time
29
+ -m--mem* SLURM minimum memory
30
+ --gres* SLURM Generic resources
31
+ -mcpu--mem_per_cpu* SLURM minimum memory per CPU
28
32
  -lin--licenses* SLURM licenses
29
33
  -cons--constraint* SLURM constraint
30
34
  -W--workflows* Additional workflows
31
35
  -rmb--remove_batch_dir Remove the batch working directory (command, STDIN, exit status, ...)
36
+ -lmod--lua_modules* Lua Modules to load
32
37
  -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect)
33
38
  EOF
34
39
 
@@ -173,7 +173,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
173
173
  select = true if queued && deps && (running_jobs & deps).any? || queued && is_running && nodes.empty?
174
174
  select = true if running && nodes.any? && (exit_status.nil? && running_jobs.include?(id)) && (!deps || (running_jobs & deps).empty?)
175
175
  select = true if jobid && jobid.split(",").include?(id)
176
- select = select && cmd.match(/#{search}/) if search
176
+ select = select && step_path.match(/#{search}/) if search
177
177
  next unless select
178
178
  elsif search
179
179
  select = false
@@ -206,9 +206,9 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
206
206
  puts Log.color(:magenta, "BATCH parameters: ")
207
207
  case job_batch_system
208
208
  when 'slurm'
209
- text = CMD.cmd('grep "^#SBATCH" |tail -n +5', :in => Open.read(fcmd)).read.strip
209
+ text = CMD.cmd('grep "^#SBATCH" ', :in => Open.read(fcmd)).read.strip
210
210
  when 'lsf'
211
- text = CMD.cmd('grep "^#BSUB" |tail -n +5', :in => Open.read(fcmd)).read.strip
211
+ text = CMD.cmd('grep "^#BSUB" ', :in => Open.read(fcmd)).read.strip
212
212
  else
213
213
  text = ""
214
214
  end
@@ -292,13 +292,17 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
292
292
  step_path = step_line.split(": ").last.strip
293
293
  step = Step.new step_path
294
294
  step.load_dependencies_from_info
295
+ has_bar = false
295
296
  (step.rec_dependencies + [step]).reverse.each do |j|
296
297
  next if j.done?
297
- next unless j.file(:progress).exists?
298
- bar = Log::ProgressBar.new
299
- bar.load(j.file(:progress).yaml)
300
- puts Log.color(:magenta, "Progress: ") + bar.report_msg + " " + Log.color(:yellow, j.task_signature)
298
+ if j.file(:progress).exists?
299
+ bar = Log::ProgressBar.new
300
+ bar.load(j.file(:progress).yaml)
301
+ puts Log.color(:magenta, "Progress: ") + bar.report_msg + " " + Log.color(:yellow, j.task_signature)
302
+ has_bar = true
303
+ end
301
304
  end
305
+ puts Log.color(:magenta, "Progress: ") + Log.color(:yellow, step.task_signature) + " #{step.status}" unless has_bar
302
306
  end
303
307
  end
304
308
 
@@ -19,6 +19,7 @@ $slurm_options = SOPT.get <<EOF
19
19
  -e--exclusive Make exclusive use of the node
20
20
  -hm--highmem Make use of highmem cores
21
21
  -wc--wipe_container* Wipe the jobs from the contain directory
22
+ -pd--purge_deps Purge job dependencies
22
23
  -CS--contain_and_sync Contain and sync to default locations
23
24
  -ci--copy_image When using a container directory, copy image there
24
25
  -t--tail Tail the logs
@@ -26,11 +27,16 @@ $slurm_options = SOPT.get <<EOF
26
27
  -q--queue* Queue
27
28
  -t--task_cpus* Tasks
28
29
  -tm--time* Time
30
+ -m--mem* SLURM minimum memory
31
+ --gres* SLURM Generic resources
32
+ -mcpu--mem_per_cpu* SLURM minimum memory per CPU
29
33
  -lin--licenses* SLURM licenses
30
34
  -cons--constraint* SLURM constraint
31
35
  -W--workflows* Additional workflows
32
- -OR--orchestration_rules* Orchestration rules
33
36
  -rmb--remove_batch_basedir Remove the SLURM working directory (command, STDIN, exit status, ...)
37
+ -lmod--lua_modules* Lua Modules to load
38
+ -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect)
39
+ -OR--orchestration_rules* Orchestration rules
34
40
  EOF
35
41
 
36
42
  batch_system = $slurm_options.delete :batch_system
@@ -18,6 +18,7 @@ $slurm_options = SOPT.get <<EOF
18
18
  -e--exclusive Make exclusive use of the node
19
19
  -hm--highmem Make use of highmem cores
20
20
  -wc--wipe_container* Wipe the jobs from the contain directory
21
+ -pd--purge_deps Purge job dependencies
21
22
  -CS--contain_and_sync Contain and sync to default locations
22
23
  -ci--copy_image When using a container directory, copy image there
23
24
  -t--tail Tail the logs
@@ -25,10 +26,14 @@ $slurm_options = SOPT.get <<EOF
25
26
  -q--queue* Queue
26
27
  -t--task_cpus* Tasks
27
28
  -tm--time* Time
29
+ -m--mem* SLURM minimum memory
30
+ --gres* SLURM Generic resources
31
+ -mcpu--mem_per_cpu* SLURM minimum memory per CPU
28
32
  -lin--licenses* SLURM licenses
29
33
  -cons--constraint* SLURM constraint
30
34
  -W--workflows* Additional workflows
31
35
  -rmb--remove_batch_dir Remove the batch working directory (command, STDIN, exit status, ...)
36
+ -lmod--lua_modules* Lua Modules to load
32
37
  -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect)
33
38
  EOF
34
39
 
@@ -38,11 +38,11 @@ step.copy_files_dir
38
38
  dependencies = step.dependencies
39
39
 
40
40
  if remove && remove.any?
41
- remove_paths = dependencies.select do |dep|
42
- remove.include?(dep.task_name) || remove.include?([dep.workflow.to_s, dep.task_name] * "#")
43
- end.collect{|dep| dep.path }
41
+ remove_paths = dependencies.select do |dep|
42
+ remove.include?(dep.task_name) || remove.include?([dep.workflow.to_s, dep.task_name] * "#")
43
+ end.collect{|dep| dep.path }
44
44
  else
45
- remove_paths = dependencies.collect{|dep| dep.path }
45
+ remove_paths = dependencies.collect{|dep| dep.path }
46
46
  end
47
47
 
48
48
  step.set_info :dependencies, step.info[:dependencies].reject{|info| remove_paths.include? info.last}
@@ -50,6 +50,7 @@ step.set_info :dependencies, step.info[:dependencies].reject{|info| remove_paths
50
50
  if options[:purge] || options[:recursive_purge]
51
51
  dependencies.each do |dependency|
52
52
  next unless remove_paths.include? dependency.path
53
+ next unless Open.exists?(dependency.info_file)
53
54
  Step.purge(dependency.path, options[:recursive_purge])
54
55
  end
55
56
  end