rbbt-util 5.30.3 → 5.30.4

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: 86a6fb4f62fc52b64a090ff3068452055f79ec65f5d11a1a497d1433370b76e2
4
- data.tar.gz: 453409b866e291e8971d13ef737ac8b6666ba89251b22a756bebc37339fa4ea7
3
+ metadata.gz: d45adac7949e3fea0d710418d93837cf0aa715bcedb2212c6e68f8dd749382ae
4
+ data.tar.gz: 9a9857c6b1565b9ed55f18f50fb1b242a1477dd6868111e10252ecc0c286ca44
5
5
  SHA512:
6
- metadata.gz: 8438fa94a7f460192656be9bd300b2b9991fd5b97d68cdfdf3d33baa76ed8f80c53caaa967e0ecd317cb6d99a32ca0e0fede252b58c96d913b5b44bbdcdfb8f0
7
- data.tar.gz: f6d50c0b5aba669526c0d044a15598a07ded038b3ae7964c84723de05c93e30b30763a5ceddbd300a9c5f79f1c84b9305ebaa786c67702de32c5a0b26ce56222
6
+ metadata.gz: 9dac4b1211fd40894f00b1a84f4f10abad83f2169579ec327a8da86f05b4274cc11e2192902638eb78b9de8f39351993f17a3b08dd5390a0f2c04ef385a0e1a2
7
+ data.tar.gz: 01b9d69b003088e78f2665b57e9ed8acc8104143bc826aabe49059e77fd0e20279d9393245f7bb20efcab807180273f31d2285a62113947cf151571a96f2d949
data/lib/rbbt/workflow.rb CHANGED
@@ -190,7 +190,7 @@ module Workflow
190
190
  return Misc.string2const Misc.camel_case(wf_name)
191
191
  end
192
192
 
193
- Log.info{"Loading workflow #{wf_name}"}
193
+ Log.high{"Loading workflow #{wf_name}"}
194
194
  require_local_workflow(wf_name) or
195
195
  (Workflow.autoinstall and `rbbt workflow install #{Misc.snake_case(wf_name)} || rbbt workflow install #{wf_name}` and require_local_workflow(wf_name)) or raise("Workflow not found or could not be loaded: #{ wf_name }")
196
196
  begin
@@ -232,7 +232,7 @@ puts resource[path].find(search_path)
232
232
  ppp Open.read(tmp_include_file)
233
233
  puts cmd
234
234
  else
235
- CMD.cmd_log(cmd)
235
+ CMD.cmd_log(cmd, :log => Log::INFO)
236
236
  end
237
237
  end
238
238
  end
@@ -78,6 +78,7 @@ class Step
78
78
  name = info[:name] || File.basename(path)
79
79
  status = :unsync if status == :done and not Open.exist?(path)
80
80
  status = :notfound if status == :noinfo and not Open.exist?(path)
81
+
81
82
  str = " " * offset
82
83
  str << prov_report_msg(status, name, path, info)
83
84
  step.dependencies.reverse.each do |dep|
@@ -90,7 +91,7 @@ class Step
90
91
  if expand_repeats
91
92
  str << Log.color(:green, Log.uncolor(prov_report(dep, offset+1, task)))
92
93
  else
93
- str << Log.color(:green, " " * (offset + 1) + Log.uncolor(prov_report_msg(status, name, path, info)))
94
+ str << Log.color(:green, " " * (offset + 1) + Log.uncolor(prov_report_msg(dep.status, dep.info[:name], dep.path, dep.info)))
94
95
  end
95
96
  end
96
97
  end if step.dependencies
@@ -107,6 +107,6 @@ real_paths.each do |source|
107
107
  puts cmd
108
108
  exit 0
109
109
  else
110
- CMD.cmd_log(cmd)
110
+ CMD.cmd_log(cmd, :log => Log::INFO)
111
111
  end
112
112
  end
@@ -98,15 +98,24 @@ workdir.glob("**/command.slurm").sort_by{|f| File.mtime(f)}.each do |fcmd|
98
98
  if File.exists?(fstatus = File.join(dir, 'job.status'))
99
99
  nodes = Open.read(fstatus).split("\n").last.split(/\s+/).last.split(",")
100
100
  elsif job_nodes[id]
101
- nodes = job_nodes[id]
101
+ nodes = job_nodes[id].reject{|n| n.include? "("}
102
102
  else
103
103
  nodes = []
104
104
  end
105
105
 
106
+ if File.exists?(File.join(dir, 'exit.status'))
107
+ now = File.ctime(File.join(dir, 'exit.status'))
108
+ else
109
+ now = Time.now
110
+ end
111
+
106
112
  if File.exists?(File.join(dir, 'std.out'))
113
+ cerrt = File.ctime File.join(dir, 'std.err')
114
+ coutt = File.ctime File.join(dir, 'std.out')
107
115
  outt = File.mtime File.join(dir, 'std.out')
108
116
  errt = File.mtime File.join(dir, 'std.err')
109
- time_diff = Time.now - [outt, errt].max
117
+ time_diff = now - [outt, errt].max
118
+ time_elapsed = now - [cerrt, coutt].min
110
119
  end
111
120
 
112
121
  fdep = File.join(dir, 'dependencies.list')
@@ -115,14 +124,19 @@ workdir.glob("**/command.slurm").sort_by{|f| File.mtime(f)}.each do |fcmd|
115
124
  fcadep = File.join(dir, 'canfail_dependencies.list')
116
125
  cadeps = Open.read(fcadep).split("\n") if File.exists?(fcadep)
117
126
 
118
- if done || error || aborted || running || queued || jobid || search
127
+ if done || error || aborted || running || queued || jobid
119
128
  select = false
120
129
  select = true if done && exit_status == 0
121
130
  select = true if error && exit_status && exit_status != 0
122
131
  select = true if aborted && (exit_status.nil? && ! running_jobs.include?(id))
123
- select = true if queued && deps && (running_jobs & deps).any?
124
- select = true if running && (exit_status.nil? && running_jobs.include?(id)) && (!deps || (running_jobs & deps).empty?)
132
+ is_running = exit_status.nil? && running_jobs.include?(id) && (!deps || (running_jobs & deps).empty?)
133
+ select = true if queued && deps && (running_jobs & deps).any? || queued && is_running && nodes.empty?
134
+ select = true if running && nodes.any? && (exit_status.nil? && running_jobs.include?(id)) && (!deps || (running_jobs & deps).empty?)
125
135
  select = true if jobid && jobid.split(",").include?(id)
136
+ select &= search && cmd.match(/#{search}/) if search
137
+ next unless select
138
+ elsif search
139
+ select = false
126
140
  select = true if search && cmd.match(/#{search}/)
127
141
  next unless select
128
142
  end
@@ -130,6 +144,7 @@ workdir.glob("**/command.slurm").sort_by{|f| File.mtime(f)}.each do |fcmd|
130
144
 
131
145
  puts Log.color :blue, dir
132
146
  puts Log.color(:magenta, "Creation: ") << File.mtime(File.join(dir, 'command.slurm')).to_s
147
+ puts Log.color(:magenta, "Started: ") << File.ctime(File.join(dir, 'std.err')).to_s if File.exist?(File.join(dir, 'std.err'))
133
148
  puts Log.color(:magenta, "Done: ") << File.mtime(File.join(dir, 'exit.status')).to_s if File.exist?(File.join(dir, 'exit.status'))
134
149
  puts Log.color(:magenta, "Exec: ") << (exe || "Missing")
135
150
  puts Log.color(:magenta, "CMD: ") << (Log.color(:yellow, cmd) || "Missing")
@@ -138,7 +153,8 @@ workdir.glob("**/command.slurm").sort_by{|f| File.mtime(f)}.each do |fcmd|
138
153
  puts Log.color(:magenta, "Dependencies: ") << deps * ", " if deps
139
154
  puts Log.color(:magenta, "Dependencies (can fail): ") << cadeps * ", " if cadeps
140
155
  puts Log.color(:magenta, "Nodes: ") << nodes * ", "
141
- puts Log.color(:magenta, "Output: ") << File.exists?(File.join(dir, 'std.out')).to_s << (id.nil? ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)")
156
+ puts Log.color(:magenta, "Time elapsed: ") << Misc.format_seconds(time_elapsed) if time_elapsed
157
+ puts Log.color(:magenta, "Output: ") << File.exists?(File.join(dir, 'std.out')).to_s << (id.nil? || File.exists?(File.join(dir, 'exit.status')) ? "" : " (last update " + Misc.format_seconds(time_diff) + " ago)")
142
158
 
143
159
  if options[:sbatch_parameters]
144
160
  puts Log.color(:magenta, "SBATCH parameters: ")
@@ -180,8 +196,11 @@ workdir.glob("**/command.slurm").sort_by{|f| File.mtime(f)}.each do |fcmd|
180
196
  start = rss_average.keys.sort.first
181
197
  eend = rss_average.keys.sort.last
182
198
  time_elapsed = eend - start
199
+ ticks = 1 if ticks == 0
200
+ time_elapsed = 1 if time_elapsed == 0
183
201
  puts Log.color(:yellow, "CPU average: ") + "%.2f" % ( ticks / clock_ticks / time_elapsed * 100).to_s
184
202
  puts Log.color(:yellow, "RSS average: ") + "%.2f GB" % Misc.mean(rss_average.collect{|t,l| Misc.sum(l) / (1024 * 1024 * 1024)}).to_s
203
+ puts Log.color(:yellow, "Time: ") + Misc.format_seconds((eend - start))
185
204
 
186
205
  end
187
206
 
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.30.3
4
+ version: 5.30.4
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-02-02 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake