origen 0.64.0 → 0.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b03fe8629c607bb665e238b03b850e817be877c8b2a19c77482cff03e3621c18
4
- data.tar.gz: 5f47acaa1d3912d3d8c63dcffb9ac26779eec9e1f82acffc294c278fadb15612
3
+ metadata.gz: d4e07e1b6a3bea9223082c09bc4973655e22568dccfcbbc18783ffc35fab0680
4
+ data.tar.gz: 93da691fe484b9eeea0aff88a561895a0988b733dbb0839fe74d376846ea1625
5
5
  SHA512:
6
- metadata.gz: 461d621e129fee3edfe0da2e616ee5c4d459d4d10f457e48b1ff793564ec369a40f969a9256971a943c401493632fba93e3a58c2af76e27f2b4c9d3d6644b99e
7
- data.tar.gz: 6eac008eacd6b47be78f34da6542441b3a1d7fba6367fc6b95988cb27373258fea95315435d09a76aeb2bfcb6bb2c9b9238d434755246b893fdb6fa09f23477c
6
+ metadata.gz: 9bf222c1f02dd46d8e2b2d05f1f510c09fb008691b241a4996721ca634eccdb9d784e56b992100b9ed559add0a462db689c33288875aefc89c37e92a3218bef9
7
+ data.tar.gz: a8ada693fcbef89a9441e2fb81b583cbe2b0a1be7ced7a2fb00053d77eeba7d735d80fffe1470a2af2d71f2ef2c8f67be7347c1c16d3d72aafaf18875da4eb8b
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 64
4
- BUGFIX = 0
4
+ BUGFIX = 1
5
5
  DEV = nil
6
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
7
7
  end
@@ -42,6 +42,21 @@ module Origen
42
42
  # If set to true, then only jobs of the specified queue will be counted, effectively making
43
43
  # the max_jobs value a max_jobs per queue
44
44
  attr_accessor :queue_count_only
45
+ # Number of running jobs below which LSFManager#print_status emits a
46
+ # per-job detail table (LSF ID, execution host, elapsed time) so that
47
+ # operators can easily see which jobs are still running at the tail end
48
+ # of a large build without having to run bjobs manually.
49
+ #
50
+ # * Default: 0 — feature is OFF by default. Applications must opt in
51
+ # by setting a positive value in config/application.rb.
52
+ # * Set to N — show details when fewer than N jobs remain and
53
+ # nothing is still queuing.
54
+ # * Overridable — can also be set via ENV['ORIGEN_LSF_DETAIL_THRESHOLD']
55
+ # at runtime (takes precedence over this config value).
56
+ #
57
+ # Example (config/application.rb):
58
+ # config.lsf.detail_threshold = 10
59
+ attr_accessor :detail_threshold
45
60
 
46
61
  def initialize
47
62
  @group = Origen.site_config.lsf_group
@@ -52,6 +67,7 @@ module Origen
52
67
  @cores = Origen.site_config.lsf_cores
53
68
  @max_jobs = Origen.site_config.lsf_max_jobs || 400
54
69
  @queue_count_only = Origen.site_config.lsf_queue_count_only || false
70
+ @detail_threshold = 0
55
71
  end
56
72
  end
57
73
 
@@ -84,6 +84,22 @@ module Origen
84
84
  end
85
85
  end
86
86
 
87
+ # Prints the current LSF job counts and, when the build is nearly
88
+ # finished, a per-job detail table showing LSF ID, execution host, and
89
+ # elapsed time so operators can see which jobs are holding things up
90
+ # without leaving the terminal to run bjobs manually.
91
+ #
92
+ # The detail table fires when:
93
+ # running_jobs.size > 0 AND
94
+ # running_jobs.size < lsf.config.detail_threshold AND
95
+ # queuing_jobs.size == 0
96
+ #
97
+ # Downstream apps configure the threshold in config/application.rb:
98
+ # config.lsf.detail_threshold = 5 # show when < 5 jobs remain
99
+ # config.lsf.detail_threshold = 0 # disable entirely
100
+ #
101
+ # The ENV variable ORIGEN_LSF_DETAIL_THRESHOLD overrides the config
102
+ # value at runtime if set.
87
103
  def print_status(options = {})
88
104
  options = {
89
105
  print_insructions: true
@@ -132,6 +148,39 @@ module Origen
132
148
  Origen.log.info 'Reset the LSF manager (clear all jobs): origen lsf -c -t all'
133
149
  Origen.log.info ''
134
150
  end
151
+ # ── End-of-run detail table ──────────────────────────────────────────
152
+ # ENV var takes precedence over config; config.detail_threshold is set
153
+ # by each downstream app (default 0 = disabled; set a positive value to enable).
154
+ threshold = (ENV['ORIGEN_LSF_DETAIL_THRESHOLD'] || lsf.config.detail_threshold).to_i
155
+ if threshold > 0 &&
156
+ running_jobs.size > 0 &&
157
+ running_jobs.size < threshold &&
158
+ queuing_jobs.size == 0
159
+
160
+ valid_jobs = running_jobs.reject { |j| j[:lsf_id].nil? || j[:lsf_id] == :error }
161
+ unless valid_jobs.empty?
162
+ lsf_ids = valid_jobs.map { |j| j[:lsf_id].to_s }
163
+ hosts = lsf_exec_hosts(lsf_ids)
164
+
165
+ Origen.log.info ''
166
+ Origen.log.info "LSF Running Job Details (#{valid_jobs.size} job(s) < threshold #{threshold}):"
167
+ Origen.log.info '-' * 66
168
+ Origen.log.info ''
169
+ Origen.log.info " #{'LSF ID'.ljust(12)} #{'EXEC_HOST'.ljust(22)} Duration"
170
+ Origen.log.info " #{'-' * 12} #{'-' * 22} #{'-' * 18}"
171
+
172
+ valid_jobs.each do |job|
173
+ id = job[:lsf_id].to_s
174
+ host = hosts[id] || '-'
175
+ elapsed = job[:submitted_at] ? time_ago(job[:submitted_at]) : '(unknown)'
176
+ cmd = "#{job[:command]}#{job[:switches]}".gsub(' --exec_remote', '').strip
177
+ Origen.log.info " #{id.ljust(12)} #{host.ljust(22)} #{elapsed}"
178
+ Origen.log.info " => #{cmd}"
179
+ end
180
+
181
+ Origen.log.info ''
182
+ end
183
+ end
135
184
  end
136
185
 
137
186
  def print_details(options = {})
@@ -644,6 +693,32 @@ module Origen
644
693
  end
645
694
  end
646
695
 
696
+ private
697
+
698
+ # Queries bjobs for the given LSF job IDs and returns a Hash of
699
+ # { id_string => exec_host_shortname }. Returns {} gracefully when
700
+ # bjobs is not in PATH or exits non-zero.
701
+ #
702
+ # Standard plain-text bjobs column layout (no -json flag):
703
+ # JOBID USER STAT QUEUE FROM_HOST EXEC_HOST JOB_NAME SUBMIT_TIME
704
+ # [0] [1] [2] [3] [4] [5]
705
+ def lsf_exec_hosts(lsf_ids)
706
+ hosts = {}
707
+ `bjobs #{lsf_ids.join(' ')} 2>&1`.each_line do |line|
708
+ parts = line.split
709
+ next if parts.size < 6
710
+ next if parts[0] =~ /\A(JOBID|Job)/i # skip header and error lines
711
+
712
+ hosts[parts[0]] = parts[5].split('.').first
713
+ end
714
+ hosts
715
+ rescue => e
716
+ Origen.log.debug "LSFManager#lsf_exec_hosts: bjobs query failed — #{e.message}"
717
+ {}
718
+ end
719
+
720
+ public
721
+
647
722
  def execute_remotely(options = {})
648
723
  job_started(options[:id])
649
724
  begin
data/lib/origen/ports.rb CHANGED
@@ -3,7 +3,7 @@ module Origen
3
3
  autoload :Port, 'origen/ports/port'
4
4
  autoload :Section, 'origen/ports/section'
5
5
  autoload :BitCollection, 'origen/ports/bit_collection'
6
- autoload :PortCollection, 'origen/ports/port_collection'
6
+ autoload :PortCollection, 'origen/ports/port_collection'
7
7
 
8
8
  def add_port(name, options = {})
9
9
  p = Port.new(self, name, options)
@@ -1008,9 +1008,9 @@ module Origen
1008
1008
  bit_options = options.dup
1009
1009
  bit_options[:data] = options[:data][n]
1010
1010
  if options[:res].is_a?(Symbol)
1011
- bit_options[:res] = options[:res]
1011
+ bit_options[:res] = options[:res]
1012
1012
  else
1013
- bit_options[:res] = options[:res][n]
1013
+ bit_options[:res] = options[:res][n]
1014
1014
  end
1015
1015
  @bits.delete_at(position + n)
1016
1016
  @bits.insert(position + n, Bit.new(self, position + n, bit_options))
@@ -1040,7 +1040,7 @@ module Origen
1040
1040
  size.times do |n|
1041
1041
  bit_options = options.dup
1042
1042
  bit_options[:data] = options[:data][n]
1043
- bit_options[:res] = options[:res][n]
1043
+ bit_options[:res] = options[:res][n]
1044
1044
  @bits.delete_at(position + n)
1045
1045
  @bits.insert(position + n, Bit.new(self, position + n, bit_options))
1046
1046
  end
data/lib/origen/specs.rb CHANGED
@@ -741,8 +741,8 @@ module Origen
741
741
  attrs_to_be_shown = {
742
742
  name: SpecTableAttr.new('Name', true, 'Name'.length + whitespace_padding),
743
743
  symbol: SpecTableAttr.new('Symbol', false, 'Symbol'.length + whitespace_padding),
744
- mode: SpecTableAttr.new('Mode', true, 'Mode'.length + whitespace_padding),
745
- type: SpecTableAttr.new('Type', true, 'Type'.length + whitespace_padding),
744
+ mode: SpecTableAttr.new('Mode', true, 'Mode'.length + whitespace_padding),
745
+ type: SpecTableAttr.new('Type', true, 'Type'.length + whitespace_padding),
746
746
  sub_type: SpecTableAttr.new('Sub-Type', false, 'Sub-Type'.length + whitespace_padding),
747
747
  # spec SpecTableAttribute :description is called parameter in the spec table output to match historical docs
748
748
  description: SpecTableAttr.new('Parameter', false, 'Parameter'.length + whitespace_padding),
data/lib/origen/users.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Origen
2
2
  # Methods related to individual users and groups
3
3
  module Users
4
- autoload :User, 'origen/users/user'
5
- autoload :LDAP, 'origen/users/ldap'
4
+ autoload :User, 'origen/users/user'
5
+ autoload :LDAP, 'origen/users/ldap'
6
6
 
7
7
  def app_users
8
8
  # Had to do some shenanigans here due to Origen.root not being available
@@ -175,11 +175,11 @@ module Origen
175
175
  type = source_output[pointer].type
176
176
  case type
177
177
  when :added
178
- added(pointer, size = get_block_size(pointer, :added))
178
+ added(pointer, size = get_block_size(pointer, :added))
179
179
  when :deleted
180
- deleted(pointer, size = get_block_size(pointer, :deleted))
180
+ deleted(pointer, size = get_block_size(pointer, :deleted))
181
181
  when :changed
182
- changed(pointer, size = get_block_size(pointer, :changed))
182
+ changed(pointer, size = get_block_size(pointer, :changed))
183
183
  end
184
184
  file.puts unless type == :unchanged
185
185
  pointer += size
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.64.0
4
+ version: 0.64.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-08-13 00:00:00.000000000 Z
12
+ date: 2026-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport