Module xg :: Class JobSpecification
[hide private]
[frames] | no frames]

Class JobSpecification

source code

object --+
         |
        JobSpecification

A class used for constructing multi-task batch jobs.

Instance Methods [hide private]
 
__init__(self)
This class is used to setup the plist file for multi-task jobs.
source code
 
_checkSchedulerParameters(self) source code
 
_checkInputFiles(self) source code
 
jobSpec(self)
Prints the full job specification dictionary.
source code
 
setName(self, name)
Set the name (a string) of the job.
source code
 
name(self)
Returns the job name.
source code
 
setEmail(self, email)
Set the notification email for the batch job.
source code
 
email(self)
Returns the notification email.
source code
 
setTasksMustStartSimultaneously(self, simul)
Sets the tasksMustStartSimultanously flag.
source code
 
tasksMustStartSimultaneously(self)
Returns the value of tasksMustStartSimultaneously.
source code
 
setMinimumTaskCount(self, count)
Sets the min number of tasks that should be started.
source code
 
minimumTaskCount(self)
Returns the value of minimumTaskCount.
source code
 
setDependsOnJobs(self, jobArray)
Takes a list of Xgrid job ids that must complete before this job begins.
source code
 
dependsOnJobs(self)
Returns the value of dependsOnJobs.
source code
 
addFile(self, localFilePath, fileName, isExecutable=0)
Specifies a local file to copy to the Xgrid agents.
source code
 
delFile(self, fileName)
Deletes the file named fileName from the JobSpecification.
source code
 
files(self)
Prints a list of included filenames.
source code
 
addTask(self, cmd, args=u'', env={}, inputStream=u'', dependsOnTasks=[])
Adds a task to the jobSpecification.
source code
 
copyTask(self) source code
 
delTask(self, task)
Deletes the task named task.
source code
 
editTask(self) source code
 
tasks(self)
Return a list of the task names.
source code
 
printTasks(self)
Print the task specifications of all tasks.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

This class is used to setup the plist file for multi-task jobs.

Overrides: object.__init__

addFile(self, localFilePath, fileName, isExecutable=0)

source code 

Specifies a local file to copy to the Xgrid agents.

This file is encoded into a base64 string and inserted into the job specification dictionary.

Parameters:
  • localFilePath (unicode or str) - The full path of the file on the client (local) computer
  • fileName (unicode or str) - The name to call the file on the agent
  • isExecutable (boolean) - Set to 1 if the file should be executable

delFile(self, fileName)

source code 

Deletes the file named fileName from the JobSpecification.

List filenames using the flies() method.

addTask(self, cmd, args=u'', env={}, inputStream=u'', dependsOnTasks=[])

source code 

Adds a task to the jobSpecification.

Parameters:
  • cmd (str) - The command to execute as a string. The executable is not copied if the full path is given, otherwise it is.
  • args (list or str) - The command line arguments to be passed to the command.
  • env (unicode or str) - A Python dictionary of environment variables to use on the agents.
  • inputStream (unicode or str) - A local file to send to the agents that will be used as stdin for the task
  • dependsOnTasks (list) - A list of task ids that must complete before this one begins

delTask(self, task)

source code 

Deletes the task named task.

List the task names using the tasks() method.