Class: OodCore::Job::Adapter Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/ood_core/job/adapter.rb

Overview

This class is abstract.

A class that handles the communication with a resource manager for submitting/statusing/holding/deleting jobs

Instance Method Summary collapse

Instance Method Details

#delete(id) ⇒ void

This method is abstract.

Subclass is expected to implement #delete

This method returns an undefined value.

Delete the submitted job

Raises:

  • (NotImplementedError)

    if subclass did not define #delete


84
85
86
# File 'lib/ood_core/job/adapter.rb', line 84

def delete(id)
  raise NotImplementedError, "subclass did not define #delete"
end

#hold(id) ⇒ void

This method is abstract.

Subclass is expected to implement #hold

This method returns an undefined value.

Put the submitted job on hold

Raises:

  • (NotImplementedError)

    if subclass did not define #hold


66
67
68
# File 'lib/ood_core/job/adapter.rb', line 66

def hold(id)
  raise NotImplementedError, "subclass did not define #hold"
end

#info(id) ⇒ Info

This method is abstract.

Subclass is expected to implement #info

Retrieve job info from the resource manager

Raises:

  • (NotImplementedError)

    if subclass did not define #info


47
48
49
# File 'lib/ood_core/job/adapter.rb', line 47

def info(id)
  raise NotImplementedError, "subclass did not define #info"
end

#info_allArray<Info>

This method is abstract.

Subclass is expected to implement #info_all

Retrieve info for all jobs from the resource manager

Raises:

  • (NotImplementedError)

    if subclass did not define #info_all


38
39
40
# File 'lib/ood_core/job/adapter.rb', line 38

def info_all
  raise NotImplementedError, "subclass did not define #info_all"
end

#release(id) ⇒ void

This method is abstract.

Subclass is expected to implement #release

This method returns an undefined value.

Release the job that is on hold

Raises:

  • (NotImplementedError)

    if subclass did not define #release


75
76
77
# File 'lib/ood_core/job/adapter.rb', line 75

def release(id)
  raise NotImplementedError, "subclass did not define #release"
end

#status(id) ⇒ Status

This method is abstract.

Subclass is expected to implement #status

Note:

Optimized slightly over retrieving complete job information from server

Retrieve job status from resource manager

Raises:

  • (NotImplementedError)

    if subclass did not define #status


57
58
59
# File 'lib/ood_core/job/adapter.rb', line 57

def status(id)
  raise NotImplementedError, "subclass did not define #status"
end

#submit(script, after: [], afterok: [], afternotok: [], afterany: []) ⇒ String

This method is abstract.

Subclass is expected to implement #submit

Submit a job with the attributes defined in the job template instance

Examples:

Submit job template to cluster

solver_id = job_adapter.submit(solver_script)#=> "1234.server"

Submit job that depends on previous job

post_id = job_adapter.submit(
  post_script,
  afterok: solver_id
)#=> "1235.server"

Raises:

  • (NotImplementedError)

    if subclass did not define #submit


30
31
32
# File 'lib/ood_core/job/adapter.rb', line 30

def submit(script, after: [], afterok: [], afternotok: [], afterany: [])
  raise NotImplementedError, "subclass did not define #submit"
end