base
index
/Users/mark/proj/bigjob/bigjob-svn-lsu/branches/bigjob_overhaul/api/base.py

This Module contains the API for the TROY PilotJob Framework.
TROY is an implementation of the P* Model.

 
Classes
       
__builtin__.object
Callback
PILOTJOB_TYPE
PilotJob
PilotJobDescription
PilotJobService
WorkUnit
WorkUnitDescription
WorkUnitService

 
class Callback(__builtin__.object)
    Callback class.
 
Specifies the structure for callback classes.
 
Callbacks can be set for WorkUnits on the state or state_detail members.
 
  Methods defined here:
cb(self, wu, member, value)
This is the method that needs to be implemented by the application
 
Keyword arguments:
wu -- The WU that is calling back.
member -- The member that triggered the callback.
value -- The new (detailed) state.
 
Return:
Keep -- Keep or remove the callback

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class PILOTJOB_TYPE(__builtin__.object)
    # Supported list of PilotJob backend types.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
BIGJOB = 1
CONDOR = 3
DIANE = 2
UNKNOWN = 0

 
class PilotJob(__builtin__.object)
    TROY PilotJob
 
This is the object that is returned by the PilotJobService when a 
new PilotJob is created based on a PilotJobDescription.
 
The PilotJob object can be used by the application to keep track 
of PilotJobs that are active.
 
PilotJob has state, can be queried, can be cancelled and be 
re-initialized.
 
  Methods defined here:
cancel(self)
Remove the PilotJob from the PilotJob Service.
 
Keyword arguments:
None
reinitialize(self, pilotjob_description)
Re-Initialize the PilotJob to the (new) PilotJobDescription.
 
Keyword arguments:
pilotjob_description -- A PilotJobDescription

Data descriptors defined here:
context
description
id
pj_type
rm
state
state_detail

 
class PilotJobDescription(__builtin__.object)
    TROY PilotJobDescription.
 
PilotJobDescription is a based on the SAGA Job Description.
 
The PilotJobDescription is used by the application to specify 
what kind of PilotJobs it requires.
 
  Methods defined here:
__init__(self)

Data descriptors defined here:
arguments
candidate_hosts
cleanup
contact
cpu_architecture
environment
error
executable
file_transfer
input
interactive
number_of_processes
operating_system_type
output
processes_per_host
project
queue
spmd_variation
start_time
threads_per_process
total_cpu_count
total_cpu_time
total_physical_memory
wall_time_limit
working_directory

 
class PilotJobService(__builtin__.object)
    TROY PilotJobService.
 
The PilotJobService is responsible for creating and managing 
the PilotJobs.
 
It is the application's interface to the Pilot-Manager in the 
P* Model.
 
  Methods defined here:
__init__(self, id=None)
Create a PilotJobService object.
 
Keyword arguments:
id -- Don't create a new, but connect to an existing (optional)
cancel(self)
Cancel the PilotJobService.
 
This also cancels all the PilotJobs that were under control of this PJS.
 
Keyword arguments:
None
 
Return value:
Result of operation
create(self, rm, pilotjob_desc, pj_type=None, context=None)
Add a PilotJob to the PilotJobService
 
Keyword arguments:
rm -- Contact string for the resource manager
pilotjob_desc -- PilotJob Description
pj_type -- TROY backend type (optional)
context -- Security context (optional)
 
Return value:
PilotJob handle

Data descriptors defined here:
id
pilot_jobs
state

 
class WorkUnit(__builtin__.object)
    TROY WorkUnit.
 
This is the object that is returned by the WorkUnitService when a 
new WorkUnit is created based on a WorkUnitDescription.
 
The WorkUnit object can be used by the application to keep track 
of WorkUnits that are active.
 
WorkUnit has state, can be queried and can be cancelled.
 
  Methods defined here:
add_callback(self, member, cb)
Add a callback function to a member.
 
Keyword arguments:
member -- The member to add the callback to (state / state_detail).
cb -- The callback object to call.
cancel(self)
Cancel the WU.
remove_callback(self, member)
Remove a callback function from a member
 
Keyword arguments:
member -- The member to remove the callback from.

Data descriptors defined here:
callback
description
id
state
state_detail

 
class WorkUnitDescription(__builtin__.object)
    TROY WorkUnitDescription.
 
The WorkUnitDescription is a job/task/call description based on 
SAGA Job Description. 
 
It offers the application to describe a WorkUnit in an abstract 
way that is dealt with by the Pilot-Manager.
 
  Methods defined here:
__init__(self)

Data descriptors defined here:
arguments
candidate_hosts
cleanup
contact
cpu_architecture
environment
error
executable
file_transfer
input
interactive
number_of_processes
operating_system_type
output
processes_per_host
project
queue
spmd_variation
start_time
threads_per_process
total_cpu_count
total_cpu_time
total_physical_memory
wall_time_limit
working_directory

 
class WorkUnitService(__builtin__.object)
    TROY WorkUnitService.
 
The WorkUnitService is the application's interface to submit 
WorkUnits to the Pilot-Manager in the P* Model.
 
It can provide the application with a list of WorkUnits that are 
managed by the Pilot-Manager.
 
The WorkUnitService is linked to a PilotJobService for the actual 
exection of the WorkUnits.
 
  Methods defined here:
__init__(self, id=None)
Create a Work Service object.
 
Keyword arguments:
id -- Reconnect to an existing WUS (optional).
add(self, pjs)
Add a PilotJobService to this WUS.
 
Keyword arguments:
pilotjob_services -- The PilotJob Service(s) to which this 
                     Work Unit Service will connect.
 
Return:
Result
cancel(self)
Cancel the WUS.
 
Cancelling the WUS also cancels all the WUs submitted to it.
 
Keyword arguments:
None
 
Return:
Result
remove(self, pjs)
Remove a PilotJobService from this WUS.
 
Note that it won't cancel the PilotJobService, it will just no
longer be connected to this WUS.
 
Keyword arguments:
pilotjob_services -- The PilotJob Service(s) to remove from this
                     Work Unit Service. 
 
Return:
Result
submit(self, wud)
Submit a WU to this Work Unit Service.
 
Keyword argument:
wud -- The WorkUnitDescription from the application
 
Return:
WorkUnit object

Data descriptors defined here:
id
pilotjob_services
state
work_units