rbbt-util 5.33.19 → 5.33.20

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: 54df9c32ce443c2f2742391738139cc97d38cdfe343058149056ad942e35b4a0
4
- data.tar.gz: a603395d628ed6b4ca776c45b377b75bafb4e9d76d009d45636008017efd83b3
3
+ metadata.gz: 87f3c2c6750c49c90cce3fd4f8e24d270d471538f65374e388ec6ac83bf7134c
4
+ data.tar.gz: fb4909c5ef2ab2a751271f1f49db270ea1f91c4a84ed26504ddebebf23aae75a
5
5
  SHA512:
6
- metadata.gz: 16cfe134071945ab0d8fd16060fc9633c8b7dbbf8189246b3736d24ced7803ff13f33b89071939c16bdff2828d8f588612ecfbb7d5481ea4f46c451be233368b
7
- data.tar.gz: 9142954e50c256485563b7147117c35c97e87d2c6aebf4fd28500f28369323b597ba0f7f07393d1c186116744af1200884c0bfa527afdf0c5dee8033b904daa8
6
+ metadata.gz: 39ca36640608cc39e279e0402f55749d5851b3713ee1fabe1eac414ae8ec5bf8f3a7741a71551142aede5ba27c9143b54972720fe321c563ac47b5db4a868da6
7
+ data.tar.gz: a7f50b0bb6829c781c9b8081b63464997f1d2aa1e8ab68871af6d13799867f4f136385b704e1bf5badce2ed03171db421ba5f9452d491b02c96aa8fe36d8eeea
@@ -555,7 +555,7 @@ env > #{batch_options[:fenv]}
555
555
 
556
556
  batch_job = run_template(batch_dir, dry_run)
557
557
 
558
- return batch_job unless tail
558
+ return [batch_job, batch_dir] unless tail
559
559
 
560
560
  t_monitor = Thread.new do
561
561
  self.follow_job(batch_dir, :STDERR)
@@ -570,8 +570,8 @@ env > #{batch_options[:fenv]}
570
570
  Open.ln path + '.info', job.path + '.info' if Open.exists?(path + '.info')
571
571
  Open.ln path + '.files', job.path + '.files' if Open.exists?(path + '.files')
572
572
  end
573
- batch_job
574
-
573
+
574
+ [batch_job, batch_dir]
575
575
  end
576
576
  end
577
577
 
@@ -49,6 +49,8 @@ module HPC
49
49
  Log.high "Compute #{batches.length} batches"
50
50
 
51
51
  batch_ids = {}
52
+ last_id = nil
53
+ last_dir = nil
52
54
  while batches.any?
53
55
  top = batches.select{|b| b[:deps].nil? || (b[:deps] - batch_ids.keys).empty? }.first
54
56
  raise "No batch without unmet dependencies" if top.nil?
@@ -87,10 +89,12 @@ module HPC
87
89
  puts Log.color(:yellow, "Options: ") + job_options.inspect
88
90
  batch_ids[top] = top[:top_level].task_signature
89
91
  else
90
- id = run_job(top[:top_level], job_options)
91
- batch_ids[top] = id
92
+ id, dir = run_job(top[:top_level], job_options)
93
+ last_id = batch_ids[top] = id
94
+ last_dir = dir
92
95
  end
93
96
  end
97
+ [last_id, last_dir]
94
98
  end
95
99
 
96
100
  end
@@ -100,11 +100,13 @@ class Step
100
100
  step.dependencies.each do |dep|
101
101
  if dep.input_dependencies.any?
102
102
  dep.input_dependencies.each do |id|
103
- input_name = dep.recursive_inputs.fields.zip(dep.recursive_inputs).select{|f,d|
103
+ input_name, _dep = 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
- }.last.first
106
- input_dependencies[id] ||= []
107
- input_dependencies[id] << [dep, input_name]
105
+ }.last
106
+ if input_name
107
+ input_dependencies[id] ||= []
108
+ input_dependencies[id] << [dep, input_name]
109
+ end
108
110
  end
109
111
  end
110
112
  end
@@ -193,7 +193,11 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
193
193
  if different_system
194
194
  status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : Log.color(:green, id)
195
195
  else
196
- status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : (running_jobs.include?(id) || $norunningjobs ? Log.color(:green, id) : Log.color(:red, id) )
196
+ #status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : (running_jobs.include?(id) || $norunningjobs ? Log.color(:green, id) : Log.color(:red, id) )
197
+ status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" :
198
+ (running_jobs.include?(id) || $norunningjobs ?
199
+ (is_running ? Log.color(:green, id) : Log.color(:yellow, id) ) :
200
+ Log.color(:red, id) )
197
201
  end
198
202
  prog_rep = []
199
203
  if options[:progress]
@@ -204,7 +208,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
204
208
  step = Step.new step_path
205
209
  step.load_dependencies_from_info
206
210
  has_bar = false
207
- (step.rec_dependencies + [step]).reverse.each do |j|
211
+ [step].reverse.each do |j|
208
212
  next if j.done?
209
213
  if j.file(:progress).exists?
210
214
  bar = Log::ProgressBar.new
@@ -49,17 +49,27 @@ HPC::BATCH_MODULE = HPC.batch_system batch_system
49
49
  raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
50
50
 
51
51
  class Step
52
- def run(*args)
53
- if done?
54
- self.load
52
+ def join
53
+ HPC::BATCH_MODULE.wait_for_job(@batch_job_dir)
54
+ end
55
+
56
+ def run(no_load = true)
57
+ if done?
58
+ self.load
59
+ else
60
+ begin
61
+ Log.debug "Issuing SLURM job for #{self.path}"
62
+ @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
63
+ if no_load
64
+ self
55
65
  else
56
- begin
57
- Log.debug "Issuing SLURM job for #{self.path}"
58
- HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
59
- rescue HPC::SBATCH
60
- end
66
+ join
67
+ self.load
61
68
  end
69
+ rescue HPC::SBATCH
70
+ end
62
71
  end
72
+ end
63
73
  end
64
74
 
65
75
  ARGV.concat ['--detach']
@@ -47,17 +47,18 @@ HPC::BATCH_MODULE = HPC.batch_system batch_system
47
47
  raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
48
48
 
49
49
  class Step
50
- def run(*args)
51
- if done?
52
- self.load
53
- else
54
- begin
55
- Log.debug "Issuing SLURM job for #{self.path}"
56
- HPC::BATCH_MODULE.run_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
57
- rescue HPC::SBATCH
58
- end
59
- end
50
+
51
+ def run(*args)
52
+ if done?
53
+ self.load
54
+ else
55
+ begin
56
+ Log.debug "Issuing SLURM job for #{self.path}"
57
+ HPC::BATCH_MODULE.run_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
58
+ rescue HPC::SBATCH
59
+ end
60
60
  end
61
+ end
61
62
  end
62
63
 
63
64
  ARGV.concat ["-W", $slurm_options[:workflows]] if $slurm_options[:workflows]
@@ -193,7 +193,11 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
193
193
  if different_system
194
194
  status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : Log.color(:green, id)
195
195
  else
196
- status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : (running_jobs.include?(id) || $norunningjobs ? Log.color(:green, id) : Log.color(:red, id) )
196
+ #status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : (running_jobs.include?(id) || $norunningjobs ? Log.color(:green, id) : Log.color(:red, id) )
197
+ status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" :
198
+ (running_jobs.include?(id) || $norunningjobs ?
199
+ (is_running ? Log.color(:green, id) : Log.color(:yellow, id) ) :
200
+ Log.color(:red, id) )
197
201
  end
198
202
  prog_rep = []
199
203
  if options[:progress]
@@ -204,7 +208,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
204
208
  step = Step.new step_path
205
209
  step.load_dependencies_from_info
206
210
  has_bar = false
207
- (step.rec_dependencies + [step]).reverse.each do |j|
211
+ [step].reverse.each do |j|
208
212
  next if j.done?
209
213
  if j.file(:progress).exists?
210
214
  bar = Log::ProgressBar.new
@@ -49,17 +49,27 @@ HPC::BATCH_MODULE = HPC.batch_system batch_system
49
49
  raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
50
50
 
51
51
  class Step
52
- def run(*args)
53
- if done?
54
- self.load
52
+ def join
53
+ HPC::BATCH_MODULE.wait_for_job(@batch_job_dir)
54
+ end
55
+
56
+ def run(no_load = true)
57
+ if done?
58
+ self.load
59
+ else
60
+ begin
61
+ Log.debug "Issuing SLURM job for #{self.path}"
62
+ @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
63
+ if no_load
64
+ self
55
65
  else
56
- begin
57
- Log.debug "Issuing SLURM job for #{self.path}"
58
- HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
59
- rescue HPC::SBATCH
60
- end
66
+ join
67
+ self.load
61
68
  end
69
+ rescue HPC::SBATCH
70
+ end
62
71
  end
72
+ end
63
73
  end
64
74
 
65
75
  ARGV.concat ['--detach']
@@ -47,17 +47,18 @@ HPC::BATCH_MODULE = HPC.batch_system batch_system
47
47
  raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
48
48
 
49
49
  class Step
50
- def run(*args)
51
- if done?
52
- self.load
53
- else
54
- begin
55
- Log.debug "Issuing SLURM job for #{self.path}"
56
- HPC::BATCH_MODULE.run_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
57
- rescue HPC::SBATCH
58
- end
59
- end
50
+
51
+ def run(*args)
52
+ if done?
53
+ self.load
54
+ else
55
+ begin
56
+ Log.debug "Issuing SLURM job for #{self.path}"
57
+ HPC::BATCH_MODULE.run_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
58
+ rescue HPC::SBATCH
59
+ end
60
60
  end
61
+ end
61
62
  end
62
63
 
63
64
  ARGV.concat ["-W", $slurm_options[:workflows]] if $slurm_options[:workflows]
@@ -193,7 +193,11 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
193
193
  if different_system
194
194
  status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : Log.color(:green, id)
195
195
  else
196
- status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : (running_jobs.include?(id) || $norunningjobs ? Log.color(:green, id) : Log.color(:red, id) )
196
+ #status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" : (running_jobs.include?(id) || $norunningjobs ? Log.color(:green, id) : Log.color(:red, id) )
197
+ status = exit_status ? (exit_status == 0 ? Log.color(:green, "Done") : Log.color(:red, "Error")) + " (#{ id })" :
198
+ (running_jobs.include?(id) || $norunningjobs ?
199
+ (is_running ? Log.color(:green, id) : Log.color(:yellow, id) ) :
200
+ Log.color(:red, id) )
197
201
  end
198
202
  prog_rep = []
199
203
  if options[:progress]
@@ -204,7 +208,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
204
208
  step = Step.new step_path
205
209
  step.load_dependencies_from_info
206
210
  has_bar = false
207
- (step.rec_dependencies + [step]).reverse.each do |j|
211
+ [step].reverse.each do |j|
208
212
  next if j.done?
209
213
  if j.file(:progress).exists?
210
214
  bar = Log::ProgressBar.new
@@ -49,17 +49,27 @@ HPC::BATCH_MODULE = HPC.batch_system batch_system
49
49
  raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
50
50
 
51
51
  class Step
52
- def run(*args)
53
- if done?
54
- self.load
52
+ def join
53
+ HPC::BATCH_MODULE.wait_for_job(@batch_job_dir)
54
+ end
55
+
56
+ def run(no_load = true)
57
+ if done?
58
+ self.load
59
+ else
60
+ begin
61
+ Log.debug "Issuing SLURM job for #{self.path}"
62
+ @batch_job_id, @batch_job_dir = HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
63
+ if no_load
64
+ self
55
65
  else
56
- begin
57
- Log.debug "Issuing SLURM job for #{self.path}"
58
- HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
59
- rescue HPC::SBATCH
60
- end
66
+ join
67
+ self.load
61
68
  end
69
+ rescue HPC::SBATCH
70
+ end
62
71
  end
72
+ end
63
73
  end
64
74
 
65
75
  ARGV.concat ['--detach']
@@ -47,17 +47,18 @@ HPC::BATCH_MODULE = HPC.batch_system batch_system
47
47
  raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
48
48
 
49
49
  class Step
50
- def run(*args)
51
- if done?
52
- self.load
53
- else
54
- begin
55
- Log.debug "Issuing SLURM job for #{self.path}"
56
- HPC::BATCH_MODULE.run_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
57
- rescue HPC::SBATCH
58
- end
59
- end
50
+
51
+ def run(*args)
52
+ if done?
53
+ self.load
54
+ else
55
+ begin
56
+ Log.debug "Issuing SLURM job for #{self.path}"
57
+ HPC::BATCH_MODULE.run_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
58
+ rescue HPC::SBATCH
59
+ end
60
60
  end
61
+ end
61
62
  end
62
63
 
63
64
  ARGV.concat ["-W", $slurm_options[:workflows]] if $slurm_options[:workflows]
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.33.19
4
+ version: 5.33.20
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-05-26 00:00:00.000000000 Z
11
+ date: 2022-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake