Package gridmap :: Module gridmap :: Class Job

Class Job

source code

object --+
         |
        Job

Central entity that wraps a function and its data. Basically, a job consists of a function, its argument list, its keyword list and a field "ret" which is filled, when the execute method gets called.


Note: This can only be used to wrap picklable functions (i.e., those that are defined at the module or class level).

Instance Methods
 
__init__(self, f, args, kwlist=None, cleanup=True, mem_free=u'1G', name=u'gridmap_job', num_slots=1, queue=u'all.q')
Initializes a new Job.
source code
 
execute(self)
Executes function f with given arguments and writes return value to field ret.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  function
Function this job will execute.
  native_specification
define python-style getter
  args
  cleanup
  environment
  exception
  jobid
  kwlist
  mem_free
  name
  num_slots
  path
  queue
  replace_env
  ret
  uniq_id
  white_list
  working_dir

Inherited from object: __class__

Method Details

__init__(self, f, args, kwlist=None, cleanup=True, mem_free=u'1G', name=u'gridmap_job', num_slots=1, queue=u'all.q')
(Constructor)

source code 

Initializes a new Job.

Parameters:
  • f (function) - a function, which should be executed.
  • args (list) - argument list of function f
  • kwlist (dict) - dictionary of keyword arguments for f
  • cleanup (boolean) - flag that determines the cleanup of input and log file
  • mem_free (basestring) - Estimate of how much memory this job will need (for scheduling)
  • name (basestring) - Name to give this job
  • num_slots (int) - Number of slots this job should use.
  • queue (basestring) - SGE queue to schedule job on.
Overrides: object.__init__

execute(self)

source code 

Executes function f with given arguments and writes return value to field ret. If an exception is encountered during execution, ret will contain a pickled version of it. Input data is removed after execution to save space.


Property Details

function

Function this job will execute.

Get Method:
unreachable.function(self) - Function this job will execute.
Set Method:
unreachable.function(self, f) - setter for function that carefully takes care of namespace, avoiding __main__ as a module

native_specification

define python-style getter

Get Method:
unreachable.native_specification(self) - define python-style getter