rbbt-util 5.32.28 → 5.32.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/hpc/orchestrate/batches.rb +17 -5
- data/lib/rbbt/util/migrate.rb +1 -1
- data/lib/rbbt/workflow/step/save_load_inputs.rb +14 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e173c4373fc6358b63964247a0d81bab2bd632a2e6bce1b93ff9ac1bd6aa53ca
|
4
|
+
data.tar.gz: 26c3352b53615f1e1c057727ac6f129dedbb9fabb09742513b2368b0b2bd7327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d84e234a76a38352786f869aaf5fee4f4b159a402b9241707c18f7cbe595d630a645e75bad7ae512652d664b98c61a13c24beb972e1c55db2b300a8c82744b
|
7
|
+
data.tar.gz: 0fdcfe8522907197eeacfffa0551dbde81db0fc859f0f85eb4281e87df44c9a0b90026423dfad79fd6c9cd8429be655eadc94e94c85cd79d0b971134ea6427ee
|
@@ -18,12 +18,24 @@ module HPC
|
|
18
18
|
|
19
19
|
def self.job_workload(job)
|
20
20
|
workload = []
|
21
|
+
path_jobs = {}
|
22
|
+
|
23
|
+
path_jobs[job.path] = job
|
24
|
+
|
21
25
|
heap = []
|
22
|
-
heap << job
|
23
|
-
while
|
26
|
+
heap << job.path
|
27
|
+
while job_path = heap.pop
|
28
|
+
job = path_jobs[job_path]
|
24
29
|
next if job.done?
|
25
30
|
workload << job
|
26
|
-
|
31
|
+
|
32
|
+
deps = job_dependencies(job)
|
33
|
+
|
34
|
+
deps.each do |d|
|
35
|
+
path_jobs[d.path] ||= d
|
36
|
+
end
|
37
|
+
|
38
|
+
heap.concat deps.collect(&:path)
|
27
39
|
heap.uniq!
|
28
40
|
end
|
29
41
|
workload.uniq
|
@@ -69,7 +81,7 @@ module HPC
|
|
69
81
|
jobs = batch[:jobs]
|
70
82
|
all_deps = jobs.collect{|d| job_dependencies(d) }.flatten.uniq
|
71
83
|
deps = all_deps.collect do |d|
|
72
|
-
(batches - [batch]).select{|batch| batch[:jobs].include? d }
|
84
|
+
(batches - [batch]).select{|batch| batch[:jobs].collect(&:path).include? d.path }
|
73
85
|
end.flatten.uniq
|
74
86
|
batch[:deps] = deps
|
75
87
|
end
|
@@ -130,7 +142,7 @@ module HPC
|
|
130
142
|
def self.job_batches(rules, job)
|
131
143
|
job_chains = self.job_chains(rules, job)
|
132
144
|
|
133
|
-
workload = job_workload(job)
|
145
|
+
workload = job_workload(job).uniq
|
134
146
|
|
135
147
|
batches = chain_batches(rules, job_chains, workload)
|
136
148
|
batches = add_batch_deps(batches)
|
data/lib/rbbt/util/migrate.rb
CHANGED
@@ -49,7 +49,7 @@ puts resource[path].find(search_path)
|
|
49
49
|
test_str = options[:test] ? '-nv' : ''
|
50
50
|
|
51
51
|
real_paths.each do |source_path|
|
52
|
-
Log.medium "Migrating #{source_path} #{options[:files].length} files to #{target} - #{Misc.fingerprint(options[:files])}}"
|
52
|
+
Log.medium "Migrating #{source_path} #{options[:files].length} files to #{target} - #{Misc.fingerprint(options[:files])}}" if options[:files]
|
53
53
|
if File.directory?(source_path) || source_path =~ /\/$/
|
54
54
|
source_path += "/" unless source_path[-1] == "/"
|
55
55
|
target += "/" unless target[-1] == "/"
|
@@ -24,7 +24,11 @@ module Workflow
|
|
24
24
|
|
25
25
|
type = :io if file.split(".").last == 'as_io'
|
26
26
|
|
27
|
+
type = :path if file.split(".").last == 'as_path'
|
28
|
+
|
27
29
|
case type
|
30
|
+
when :path
|
31
|
+
inputs[input.to_sym] = Open.realpath(Open.read(file).strip)
|
28
32
|
when :io
|
29
33
|
inputs[input.to_sym] = Open.open(Open.realpath(file))
|
30
34
|
when :file, :binary
|
@@ -96,12 +100,21 @@ class Step
|
|
96
100
|
Open.write(path, value.to_s)
|
97
101
|
when Step === value
|
98
102
|
Open.ln_s(value.path, path)
|
103
|
+
when type.to_s == "binary"
|
104
|
+
if String === value && File.exists?(value)
|
105
|
+
value = File.expand_path(value)
|
106
|
+
Open.ln_s(value, path)
|
107
|
+
elsif String === value && Misc.is_filename?(value, false)
|
108
|
+
Open.write(path + '.as_path' , value)
|
109
|
+
else
|
110
|
+
Open.write(path, value, :mode => 'wb')
|
111
|
+
end
|
99
112
|
when type.to_s == "file"
|
100
113
|
if String === value && File.exists?(value)
|
101
114
|
value = File.expand_path(value)
|
102
115
|
Open.ln_s(value, path)
|
103
116
|
else
|
104
|
-
value = value.collect{|v| v = "#{v}" if Path === v; v }if Array === value
|
117
|
+
value = value.collect{|v| v = "#{v}" if Path === v; v } if Array === value
|
105
118
|
value = "#{value}" if Path === value
|
106
119
|
Open.write(path + '.yaml', value.to_yaml)
|
107
120
|
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.
|
4
|
+
version: 5.32.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|