Package Ganga :: Package GPIDev :: Package Adapters :: Module IBackend :: Class IBackend
[hide private]
[frames] | no frames]

Class IBackend

source code

          object --+        
                   |        
   Base.Objects.Node --+    
                       |    
Base.Objects.GangaObject --+
                           |
                          IBackend
Known Subclasses:

This is a Ganga.GPI.IBackend implementation class. Refer to Ganga.GPI.IBackend.__doc__ for documentation.

Nested Classes [hide private]
  _proxyClass
Base class for all backend objects.

Inherited from Base.Objects.GangaObject: __metaclass__

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
setup(self)
This is a hook called for each job when Ganga.Core services are started up.
source code
 
master_submit(self, rjobs, subjobconfigs, masterjobconfig, keep_going=False)
Submit the master job and all its subjobs.
source code
 
submit(self, subjobconfig, master_input_sandbox)
Submit an individual job.
source code
 
master_prepare(self, masterjobconfig)
Prepare the master job (shared sandbox files).
source code
 
master_auto_resubmit(self, rjobs)
A hook in case someone wanted to override the auto resubmission behaviour.
source code
 
check_auto_resubmit(self)
A hook for the backend to check if this job can be automatically resubmitted.
source code
 
master_resubmit(self, rjobs, backend=None)
Resubmit (previously submitted) job.
source code
 
resubmit(self) source code
 
master_kill(self)
Kill a job and all its subjobs.
source code
 
kill(self)
Kill a job (and also all its subjobs).
source code
 
peek(self, filename='', command='')
Allow viewing of job output files on the backend (i.e.
source code
 
remove(self)
When the job is removed then this backend method is called.
source code
 
getStateTime(self, status)
Get the timestamps for the job's transitions into the 'running' and 'completed' states.
source code
 
timedetails(self)
Returns all available backend specific timestamps.
source code

Inherited from Base.Objects.GangaObject: __construct__, __deepcopy__, __getstate__, __setstate__, _attribute_filter__set__, _auto__init__, accept, getJobObject

Inherited from Base.Objects.Node: __copy__, __eq__, __ne__, clone, copyFrom, printSummaryTree, printTree

Inherited from Base.Objects.Node (private): _getParent, _getRoot, _setParent

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

Class Methods [hide private]

Inherited from Base.Objects.GangaObject (private): _declared_property

Static Methods [hide private]
 
master_updateMonitoringInformation(jobs)
Update monitoring information for jobs: jobs is a list of jobs in this backend which require monitoring (either 'submitted' or 'running' state).
source code
 
updateMonitoringInformation(jobs)
Update monitoring information for individual jobs: jobs is a list which may contain subjobs as well as the non-split jobs.
source code
Class Variables [hide private]
  _schema = Schema(Version(0, 0), {})
  _category = 'backends'
  _hidden = 1
  _packed_input_sandbox = True

Inherited from Base.Objects.Node (private): _index_cache, _parent

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setup(self)

source code 

This is a hook called for each job when Ganga.Core services are started up. The hook is called before the monitoring subsystem is enabled. This hook may be used by some backends to do specialized setup (e.g. to open ssh transport pipes of the Remote backend)

master_submit(self, rjobs, subjobconfigs, masterjobconfig, keep_going=False)

source code 
Submit   the  master  job  and  all   its  subjobs.   The
masterjobconfig  is  shared,  individual  subjob  configs  are
defined  in  subjobconfigs.   Submission  of  individual  jobs
(not-split) also  always goes via  this method.  In  that case
the subjobconfigs contains just one element - the job itself.

The default  implementation of  this method emulates  the bulk
submission  calling  a submit()  method  on individual  subjob
objects.  If submission  of any of the subjobs  fails then the
whole   process  is  aborted   with  IncompleteSubmissionError
exception. The subjobs which  have already been submitted stay
submitted.

The default implementation does not process the masterjobconfig.
Therefore this method may be overriden in the derived class
in the following way:

def master_submit(self,masterjobconfig,subjobconfigs,keep_going):
   ... 
   do_some_processsing_of(masterjobconfig)
   ...
   return IBackend.master_submit(self,subjobconfigs,masterjobconfig,keep_joing)


Implementation note: we set keep_going to be optional in the
signature of IBackend.master_submit() to allow the existing
backend implementations which do not support keep_going=True
and which at some point may call IBackend.master_submit() to
work without change. It may sometimes be non-trivial to enable
support for keep_going=True in some backends, even if the
finally call IBackend.master_submit(). Therefore it is left to
the decision of backend developer to explicitly enable the
support for keep_going flag.

submit(self, subjobconfig, master_input_sandbox)

source code 

Submit an individual job. Return 1 in case of success.

master_input_sandbox is a list of file-names which is shared by all subjobs.

This method is not called directly by the framework. It is only called by the default implementation of master_submit() method.

Therefore if the implementation of master_submit() is able to cope with submission of individual jobs, then submit() is redundant.

Transition from Ganga 4.0.x:

  • subjobconfig is equvalent to jobconfig in the older interface.
  • jobid is an obsolte parameter which will be removed in the future

master_prepare(self, masterjobconfig)

source code 

Prepare the master job (shared sandbox files). This method is/should be called by master_submit() exactly once. The input sandbox is created according to self._packed_input_sandbox flag (a class attribute)

master_auto_resubmit(self, rjobs)

source code 

A hook in case someone wanted to override the auto resubmission behaviour. Otherwise, it auto_resubmit is equivalent for all practical purposes to a normal resubmit (so it automatcially benefits from bulk resubmit if implemented).

master_resubmit(self, rjobs, backend=None)

source code 

Resubmit (previously submitted) job. Configuration phase is skipped. Default implementation works is an emulated-bulk operation. If you override this method for bulk optimization then make sure that you call updateMasterJobStatus() on the master job, so the master job will be monitored by the monitoring loop.

master_kill(self)

source code 

Kill a job and all its subjobs. Return 1 in case of success.

The default implementation uses the kill() method and emulates the bulk operation on all subjobs. It tries to kill as many subjobs as possible even if there are failures. If the operation is incomplete then raise IncompleteKillError().

kill(self)

source code 

Kill a job (and also all its subjobs). This method is never called by the framework directly. It may only be called by the default implementation of master_kill().

peek(self, filename='', command='')

source code 

Allow viewing of job output files on the backend
(i.e. while job is in 'running' state)

Arguments other than self:
filename : name of file to be viewed
          => Path specified relative to work directory
command  : command to be used for file viewing

Return value: None

remove(self)

source code 

When the job is removed then this backend method is called. The primary use-case is the Remote (ssh) backend.

master_updateMonitoringInformation(jobs)
Static Method

source code 

Update monitoring information for jobs: jobs is a list of jobs in this backend which require monitoring (either 'submitted' or 'running' state). The jobs list never contains the subjobs.

The default implementation iterates over subjobs and calls updateMonitoringInformation().

updateMonitoringInformation(jobs)
Static Method

source code 

Update monitoring information for individual jobs: jobs is a list which may contain subjobs as well as the non-split jobs. This method is never called by the framework directly. It may only be called by the default implementation of master_updateMonitoringInformation().