rbbt-util 5.32.17 → 5.32.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e7aa425415a69c6615edd3fd7f38ce4c0bba0b1a911e7f97e927bf433483401
4
- data.tar.gz: d2e8045de7f45d961afd8671b694c4c92f629dbc41d96057c84b9e97fc8cf15c
3
+ metadata.gz: bff9b30f50c873f7db46003571a8557c0ea756aaf342041119d4737da78e461b
4
+ data.tar.gz: 0765a797be1c16f90cd5ebf4f18fe5adb3d154aa69d07ab666cfe464fcb0a6bd
5
5
  SHA512:
6
- metadata.gz: b4f577d5d647b6c9ce1226062e7f5a459e6dee13e151e782d5938494a3e061d4b3fcc41bd14a8276ea646e58b726571445a45db7f2fe03dc34f4ca28d94c2d9a
7
- data.tar.gz: d8432ea0d5232ddd9ac89c9e9cf0880a677cf708772ea5d0a6b6e28bd2204831d676e613a218c616c950c509c381a0ab2cf1acf88b98a85e9d4f18c3480ef48c
6
+ metadata.gz: 9ba97c967d615145553d0f73bd84debbceee41c7ce1ca0c4fda512eeaf54880c256d36a4cf9d215ddce97b43a44a2cf19aa17f7e3b086512633210401cdfc085
7
+ data.tar.gz: c58f507abee878f56945886b06582271ace368c00808ff6fc7d0f0343373070a40dac797aff440a8abffd8cce3647fec9affeff078150bab8b7f52625754c91b
@@ -44,6 +44,7 @@ export BATCH_SYSTEM=SLURM
44
44
  time = Misc.format_seconds Misc.timespan(time) unless time.include? ":"
45
45
 
46
46
  sbatch_params = {"job-name" => batch_name,
47
+ "qos" => queue,
47
48
  "output" => fout,
48
49
  "error" => ferr,
49
50
  "cpus-per-task" => task_cpus,
@@ -122,7 +122,12 @@ module Rbbt::Config
122
122
  Log.debug "Value #{value.inspect} for config key '#{ key }': #{tokens * ", "}"
123
123
  GOT_KEYS << [key, value, tokens]
124
124
 
125
- value
125
+ if String === value && m = value.match(/^env:(.*)/)
126
+ variable = m.captures.first
127
+ ENV[variable]
128
+ else
129
+ value
130
+ end
126
131
  end
127
132
 
128
133
  def self.with_config
@@ -320,7 +320,9 @@ module Misc
320
320
  end
321
321
  end
322
322
  when String
323
- if Misc.is_filename?(obj, false) and ! %w(. ..).include?(obj) and ! Path === obj
323
+ good_filename = Misc.is_filename?(obj, false) && ! %w(. ..).include?(obj) && %w(. /).include?(obj[0])
324
+ is_path = Path === obj
325
+ if good_filename && ! is_path
324
326
  obj2str Path.setup(obj.dup)
325
327
  else
326
328
  obj = obj.chomp if String === obj
@@ -77,15 +77,15 @@ module Workflow
77
77
  returns workflow.tasks[oname].result_description if workflow.tasks.include?(oname) unless @result_description
78
78
  task name do
79
79
  raise RbbtException, "dependency not found in dep_task" if dependencies.empty?
80
- Step.wait_for_jobs dependencies
80
+ Step.wait_for_jobs dependencies.select{|d| d.streaming? }
81
81
  dep = dependencies.last
82
82
  dep.join
83
83
  raise dep.get_exception if dep.error?
84
84
  raise Aborted, "Aborted dependency #{dep.path}" if dep.aborted?
85
85
  set_info :result_type, dep.info[:result_type]
86
- forget = config :forget_dep_tasks, "forget_dep_tasks", "key:forget_dep_tasks", :default => FORGET_DEP_TASKS
86
+ forget = config :forget_dep_tasks, "forget_dep_tasks", :default => FORGET_DEP_TASKS
87
87
  if forget
88
- remove = config :remove_dep_tasks, "remove_dep_tasks", "key:remove_dep_tasks", :default => REMOVE_DEP_TASKS
88
+ remove = config :remove_dep_tasks, "remove_dep_tasks", :default => REMOVE_DEP_TASKS
89
89
 
90
90
  self.archive_deps
91
91
  self.copy_files_dir
@@ -93,15 +93,17 @@ module Workflow
93
93
  Open.rm_rf self.files_dir if Open.exist? self.files_dir
94
94
  FileUtils.cp_r dep.files_dir, self.files_dir if Open.exist?(dep.files_dir)
95
95
  Open.ln_h dep.path, self.tmp_path
96
+
96
97
  case remove.to_s
97
98
  when 'true'
98
99
  dep.clean
99
100
  when 'recursive'
100
- dep.rec_dependencies.each do |d|
101
+ (dep.dependencies + dep.rec_dependencies).uniq.each do |d|
102
+ next if d.overriden
101
103
  d.clean unless config(:remove_dep, d.task_signature, d.task_name, d.workflow.to_s, :default => true).to_s == 'false'
102
104
  end
103
105
  dep.clean unless config(:remove_dep, dep.task_signature, dep.task_name, dep.workflow.to_s, :default => true).to_s == 'false'
104
- end
106
+ end unless dep.overriden
105
107
  else
106
108
  if Open.exists?(dep.files_dir)
107
109
  Open.rm_rf self.files_dir
@@ -71,7 +71,7 @@ module Workflow
71
71
 
72
72
  def setup_override_dependency(dep, workflow, task_name)
73
73
  return [] if dep == :skip || dep == 'skip'
74
- dep = Step === dep ? dep : Workflow.load_step(dep)
74
+ dep = Step === dep ? dep.dup : Workflow.load_step(dep)
75
75
  dep.workflow = workflow
76
76
  dep.info[:name] = dep.name
77
77
  dep.original_task_name ||= dep.task_name if dep.workflow
@@ -83,8 +83,9 @@ module Workflow
83
83
  rescue
84
84
  Log.exception $!
85
85
  end
86
+
86
87
  dep.task_name = task_name
87
- dep.overriden = dep.original_task_name.to_sym
88
+ dep.overriden = dep.original_task_name.to_sym if dep.original_task_name
88
89
 
89
90
  dep.extend step_module
90
91
 
@@ -351,38 +351,6 @@ class Step
351
351
  end
352
352
  end
353
353
 
354
- #connected = true means that dependency searching ends when a result is done
355
- #but dependencies are absent, meanining that the file could have been dropped
356
- #in
357
- def rec_dependencies(connected = false, seen = [])
358
-
359
- # A step result with no info_file means that it was manually
360
- # placed. In that case, do not consider its dependencies
361
- return [] if ! (defined? WorkflowRemoteClient && WorkflowRemoteClient::RemoteStep === self) && ! Open.exists?(self.info_file) && Open.exists?(self.path.to_s)
362
-
363
- return [] if dependencies.nil? or dependencies.empty?
364
-
365
- new_dependencies = []
366
- if self.overriden?
367
- archived_deps = []
368
- else
369
- archived_deps = self.info[:archived_info] ? self.info[:archived_info].keys : []
370
- end
371
-
372
- dependencies.each{|step|
373
- #next if self.done? && Open.exists?(info_file) && info[:dependencies] && info[:dependencies].select{|task,name,path| path == step.path }.empty?
374
- next if archived_deps.include? step.path
375
- next if seen.include? step.path
376
- next if self.done? && connected && ! updatable?
377
-
378
- r = step.rec_dependencies(connected, new_dependencies.collect{|d| d.path})
379
- new_dependencies.concat r
380
- new_dependencies << step
381
- }
382
-
383
- new_dependencies.uniq
384
- end
385
-
386
354
  def writable?
387
355
  Open.writable?(self.path) && Open.writable?(self.info_file)
388
356
  end
@@ -206,7 +206,7 @@ class Step
206
206
  if dup and step.streaming? and not step.result.nil?
207
207
  if dep_step[step.path] and dep_step[step.path].length > 1
208
208
  stream = step.result
209
- other_steps = dep_step[step.path].uniq
209
+ other_steps = dep_step[step.path].uniq.reject{|d| d.overriden }
210
210
  return unless other_steps.length > 1
211
211
  log_dependency_exec(step, "duplicating #{other_steps.length}")
212
212
  copies = Misc.tee_stream_thread_multiple(stream, other_steps.length)
@@ -523,4 +523,36 @@ class Step
523
523
  set_info :dependencies, dependencies.collect{|dep| [dep.task_name, dep.name, dep.path]} if dependencies
524
524
  end
525
525
 
526
+ #connected = true means that dependency searching ends when a result is done
527
+ #but dependencies are absent, meanining that the file could have been dropped
528
+ #in
529
+ def rec_dependencies(connected = false, seen = [])
530
+
531
+ # A step result with no info_file means that it was manually
532
+ # placed. In that case, do not consider its dependencies
533
+ return [] if ! (defined? WorkflowRemoteClient && WorkflowRemoteClient::RemoteStep === self) && ! Open.exists?(self.info_file) && Open.exists?(self.path.to_s)
534
+
535
+ return [] if dependencies.nil? or dependencies.empty?
536
+
537
+ new_dependencies = []
538
+ if self.overriden?
539
+ archived_deps = []
540
+ else
541
+ archived_deps = self.info[:archived_info] ? self.info[:archived_info].keys : []
542
+ end
543
+
544
+ dependencies.each{|step|
545
+ #next if self.done? && Open.exists?(info_file) && info[:dependencies] && info[:dependencies].select{|task,name,path| path == step.path }.empty?
546
+ next if archived_deps.include? step.path
547
+ next if seen.include? step.path
548
+ next if self.done? && connected && ! updatable?
549
+
550
+ r = step.rec_dependencies(connected, new_dependencies.collect{|d| d.path})
551
+ new_dependencies.concat r
552
+ new_dependencies << step
553
+ }
554
+
555
+ new_dependencies.uniq
556
+ end
557
+
526
558
  end
@@ -102,7 +102,7 @@ class Step
102
102
  dep.input_dependencies.each do |id|
103
103
  input_name = dep.recursive_inputs.fields.zip(dep.recursive_inputs).select{|f,d|
104
104
  d == id || (String === d && d.start_with?(id.files_dir)) || (Array === d && d.include?(id))
105
- }.first.first
105
+ }.last.first
106
106
  input_dependencies[id] ||= []
107
107
  input_dependencies[id] << [dep, input_name]
108
108
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.32.17
4
+ version: 5.32.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-13 00:00:00.000000000 Z
11
+ date: 2021-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake