rbbt-util 5.32.11 → 5.32.12

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: fab4cf5fb60bb998eeed28a4e07758efd68f1103de0eff61a5b5c1d4a9fd2583
4
- data.tar.gz: 47c9a2bdc555645ebc833c2a3b92a3452df259546c1dbf200d77dcee04b8969f
3
+ metadata.gz: 355cf2694fc6b449600580f6c09f2a0a6055013285b5c53ada6ad2f920d7f63c
4
+ data.tar.gz: 26e430d330e39371b8fb59f3508b3e1eb215bf042bf2faa5262040fd19369e24
5
5
  SHA512:
6
- metadata.gz: 92121d5df854b036a37413c27d2244cef0325874c018433abce1a93887c93efc650474e059c13b84c0be9a708d6fdc735daba6f861e1d05a670950fea3d32916
7
- data.tar.gz: 0d24d99a64101fd33f2ac5774c30267f238c81d6479a754445fc02424384ba716e4c672b8a7c0d1c6f22b9f16c2ac1e1104ba9d35f7697bf4a9631e3a776bb02
6
+ metadata.gz: ecec79da1a0b8ecdbcec6e600965d6cc8a336f6d33a4dd3ada4a75e2c6ae8d98300a210bc17eec7bb16639c4d73b4a6efe7bceb043037fa0aeaf76d3da20b172
7
+ data.tar.gz: 3af9d791b8423f99c67c473541fcc6b685c2cb4ca454423ff0b69d686442b40574d337df749dcf811369b81d68c648ff733dcf3c4e2e655953aba0f4569b85b1
data/lib/rbbt/util/cmd.rb CHANGED
@@ -202,8 +202,7 @@ module CMD
202
202
  serr.close
203
203
  end
204
204
  else
205
- Misc.consume_stream(serr, true)
206
- err_thread = nil
205
+ err_thread = Misc.consume_stream(serr, true)
207
206
  end
208
207
 
209
208
  sout.threads = [in_thread, err_thread, wait_thr].compact
@@ -12,32 +12,35 @@ module Log
12
12
  attr_accessor :history, :mean_max, :max_history
13
13
  def thr_msg
14
14
  if @history.nil?
15
- @history ||= [[@ticks, Time.now] ]
15
+ @history ||= [[0, @start], [@ticks, Time.now] ]
16
16
  elsif @last_ticks != @ticks
17
17
  @history << [@ticks, Time.now]
18
- max_history ||= case
19
- when @ticks > 20
20
- count = @ticks - @last_count
21
- count = 1 if count == 0
22
- if @max
23
- times = @max / count
24
- num = times / 20
25
- num = 2 if num < 2
26
- else
27
- num = 10
18
+ max_history ||= begin
19
+ max_history = case
20
+ when @ticks > 20
21
+ count = @ticks - @last_count
22
+ count = 1 if count == 0
23
+ if @max
24
+ times = @max / count
25
+ num = times / 20
26
+ num = 2 if num < 2
27
+ else
28
+ num = 10
29
+ end
30
+ count * num
31
+ else
32
+ 20
33
+ end
34
+ max_history = 30 if max_history > 30
35
+ max_history
28
36
  end
29
- count * num
30
- else
31
- 20
32
- end
33
- max_history = 30 if max_history > 30
34
37
  @history.shift if @history.length > max_history
35
38
  end
36
39
 
37
40
  @last_ticks = @ticks
38
41
 
39
42
  @mean_max ||= 0
40
- if @history.length > 2
43
+ if @history.length > 3
41
44
 
42
45
  sticks, stime = @history.first
43
46
  ssticks, sstime = @history[-3]
@@ -302,7 +302,7 @@ module Workflow
302
302
  workflow, task = m.values_at 1, 2
303
303
  workflow = self.to_s if workflow.empty?
304
304
  override_dependencies[workflow] ||= IndiferentHash.setup({})
305
- override_dependencies[workflow][task] = value.dup
305
+ override_dependencies[workflow][task] = value
306
306
  end
307
307
  end
308
308
  override_dependencies
@@ -161,7 +161,7 @@ class Step
161
161
 
162
162
  archived_info = {}
163
163
  dependencies.each do |dep|
164
- if Symbol === dep.overriden
164
+ if Symbol === dep.overriden && ! Open.exists?(dep.info_file)
165
165
  archived_info[dep.path] = dep.overriden
166
166
  else
167
167
  archived_info[dep.path] = dep.info
@@ -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
 
@@ -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
@@ -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
 
@@ -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
@@ -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
 
@@ -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
@@ -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
 
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.11
4
+ version: 5.32.12
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-05-17 00:00:00.000000000 Z
11
+ date: 2021-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake