Class: OodCore::Job::Adapters::Sge
- Inherits:
-
OodCore::Job::Adapter
- Object
- OodCore::Job::Adapter
- OodCore::Job::Adapters::Sge
- Defined in:
- lib/ood_core/job/adapters/sge.rb
Overview
The adpater class for Grid Engine (GE) flavors like Sun Grid Engine.
Defined Under Namespace
Instance Attribute Summary collapse
-
#bin ⇒ Pathname
readonly
The path to the Sun Grid Engine client installation binaries.
-
#cluster ⇒ String?
readonly
The cluster of the Sun Grid Engine batch server.
-
#conf ⇒ Pathname?
readonly
The path to the Sun Grid Engine configuration file.
Instance Method Summary collapse
-
#delete(id) ⇒ void
Delete the submitted job.
- #directive_prefix ⇒ Object
-
#hold(id) ⇒ void
Put the submitted job on hold.
-
#info(id) ⇒ Info
Retrieve job info from the resource manager.
-
#info_all(attrs: nil) ⇒ Array<Info>
Retrieve info for all jobs from the resource manager.
-
#info_where_owner(owner, attrs: nil) ⇒ Array<Info>
Retrieve info for all jobs for a given owner or owners from the resource manager.
-
#initialize(batch:) ⇒ Sge
constructor
A new instance of Sge.
-
#release(id) ⇒ void
Release the job that is on hold.
-
#status(id) ⇒ Status
Retrieve job status from resource manager.
-
#submit(script, after: [], afterok: [], afternotok: [], afterany: []) ⇒ String
Submit a job with the attributes defined in the job template instance.
Methods inherited from OodCore::Job::Adapter
#accounts, #cluster_info, #info_all_each, #info_where_owner_each, #job_name_illegal_chars, #nodes, #queues, #sanitize_job_name, #supports_job_arrays?
Constructor Details
Instance Attribute Details
#bin ⇒ Pathname (readonly)
The path to the Sun Grid Engine client installation binaries
50 51 52 |
# File 'lib/ood_core/job/adapters/sge.rb', line 50 def bin @bin end |
#cluster ⇒ String? (readonly)
The cluster of the Sun Grid Engine batch server
38 39 40 |
# File 'lib/ood_core/job/adapters/sge.rb', line 38 def cluster @cluster end |
#conf ⇒ Pathname? (readonly)
The path to the Sun Grid Engine configuration file
44 45 46 |
# File 'lib/ood_core/job/adapters/sge.rb', line 44 def conf @conf end |
Instance Method Details
#delete(id) ⇒ void
This method returns an undefined value.
Delete the submitted job
157 158 159 160 161 |
# File 'lib/ood_core/job/adapters/sge.rb', line 157 def delete(id) @batch.delete(id.to_s) rescue Batch::Error => e raise JobAdapterError, e. end |
#directive_prefix ⇒ Object
163 164 165 |
# File 'lib/ood_core/job/adapters/sge.rb', line 163 def directive_prefix '#$' end |
#hold(id) ⇒ void
This method returns an undefined value.
Put the submitted job on hold
137 138 139 140 141 |
# File 'lib/ood_core/job/adapters/sge.rb', line 137 def hold(id) @batch.hold(id.to_s) rescue Batch::Error => e raise JobAdapterError, e. end |
#info(id) ⇒ Info
Retrieve job info from the resource manager
117 118 119 120 121 |
# File 'lib/ood_core/job/adapters/sge.rb', line 117 def info(id) @batch.get_info_enqueued_job(id) rescue Batch::Error => e raise JobAdapterError, e. end |
#info_all(attrs: nil) ⇒ Array<Info>
Retrieve info for all jobs from the resource manager
95 96 97 98 99 |
# File 'lib/ood_core/job/adapters/sge.rb', line 95 def info_all(attrs: nil) @batch.get_all(owner: '*') rescue Batch::Error => e raise JobAdapterError, e. end |
#info_where_owner(owner, attrs: nil) ⇒ Array<Info>
Retrieve info for all jobs for a given owner or owners from the resource manager
106 107 108 109 110 111 |
# File 'lib/ood_core/job/adapters/sge.rb', line 106 def info_where_owner(owner, attrs: nil) owner = Array.wrap(owner).map(&:to_s).join(',') @batch.get_all(owner: owner) rescue Batch::Error => e raise JobAdapterError, e. end |
#release(id) ⇒ void
This method returns an undefined value.
Release the job that is on hold
147 148 149 150 151 |
# File 'lib/ood_core/job/adapters/sge.rb', line 147 def release(id) @batch.release(id.to_s) rescue Batch::Error => e raise JobAdapterError, e. end |
#status(id) ⇒ Status
Retrieve job status from resource manager
127 128 129 130 131 |
# File 'lib/ood_core/job/adapters/sge.rb', line 127 def status(id) info(id).status rescue Batch::Error => e raise JobAdapterError, e. end |
#submit(script, after: [], afterok: [], afternotok: [], afterany: []) ⇒ String
Submit a job with the attributes defined in the job template instance
84 85 86 87 88 89 90 91 |
# File 'lib/ood_core/job/adapters/sge.rb', line 84 def submit(script, after: [], afterok: [], afternotok: [], afterany: []) # SGE supports jod dependencies on job completion args = @helper.batch_submit_args(script, after: after, afterok: afterok, afternotok: afternotok, afterany: afterany) @batch.submit(script.content, args) rescue Batch::Error => e raise JobAdapterError, e. end |