lib/origen/application/lsf.rb in origen-0.34.2 vs lib/origen/application/lsf.rb in origen-0.34.3
- old
+ new
@@ -16,17 +16,34 @@
# The queue parameter, default: 'short'
attr_accessor :queue
# When set to true no submissions will be made to LSF and instead the
# command that would have been submitted is printed to the terminal instead
attr_accessor :debug
+ # Specify the number of cores to use while submitting the job to LSF
+ # There is a restriction on the number of cores available per queue name
+ # Below is a table:
+ # Queue name equivalent Purpose
+ # interq gui Interactive jobs, like Virtuoso. Max 15 jobs/user
+ # batchq normal CPU intensive batch jobs, 1 .. 3 threads. Specify # of threads with bsub -n option. Slots/user: ~10% of total batch capacity.
+ # batchq_mt normal CPU intensive batch jobs, >= 4 threads. Specify # of threads with bsub -n option. Slots: shared with batchq.
+ # shortq short CPU intensive batch jobs, 1 thread (= 1 core), guaranteed run time 15 minutes. Slots/user: approximately 3x limit in batchq.
+ # offloadq - Used for offloading cpu intensive batch jobs to cloud, see CloudPortal.
+ # Do not submit directly into this queue. No real slot limit. Focused on CPU intensive jobs, not using much memory/data.
+ # distributed normal Run jobs than span multiple hosts.
+ # - prio High prio queue with low slot count, useful if you don't have slots available in normal queue. See PrioritizingMyJobs.
+ # - ondemand On-Demand Servers to satisfy urgent and short-term (2 weeks or less) customer compute requirements.
+ # - wam WAM cron processing
+ # - grid Low-priority batch jobs (random sim, regressions, etc). Access to all spare CPU cycles.
+ attr_accessor :cores
def initialize
- @group = nil
- @project = 'msg.te'
- @resource = 'linux'
- @queue = 'short'
- @debug = false
+ @group = Origen.site_config.lsf_group
+ @project = Origen.site_config.lsf_project
+ @resource = Origen.site_config.lsf_resource
+ @queue = Origen.site_config.lsf_queue
+ @debug = Origen.site_config.lsf_debug
+ @cores = Origen.site_config.lsf_cores
end
end
# Accessor for the global LSF configuration, use this to modify the default
# LSF configuration for a given setup. Typically an alternate configuration would
@@ -72,17 +89,19 @@
project = project ? "-P #{project}" : ''
resource = options[:resource] || config.resource
resource = resource ? "-R '#{resource}'" : ''
queue = options[:queue] || config.queue
queue = queue ? "-q #{queue}" : ''
+ cores = options[:cores] || config.cores
+ cores = cores ? "-n #{cores}" : ''
rerunnable = options[:rerunnable] ? '-r' : ''
if options[:dependents].empty?
dependents = ''
else
dependents = options[:dependents].map { |id| "ended(#{id})" }.join(' && ')
dependents = "-w '#{dependents}'"
end
- cmd = "bsub -oo /dev/null #{dependents} #{rerunnable} #{group} #{project} #{resource} #{queue} '#{command}'"
+ cmd = "bsub -oo /dev/null #{dependents} #{rerunnable} #{group} #{project} #{resource} #{queue} #{cores} '#{command}'"
if config.debug
puts cmd
'496212' # Return a dummy ID to keep the caller happy
else
output = `#{cmd}`