Python Task object.
More...
Detailed Description
Python Task object.
This class is used to create a task specification.
Example:
task = Task('date > current.date')
task.specify_algorithm(WORK_QUEUE_SCHEDULE_FCFS)
task.specify_input_file('/usr/bin/date', 'date')
task.specify_tag('my date task')
work_queue = WorkQueue()
work_queue.submit(task)
Member Function Documentation
def work_queue::Task::__init__ |
( |
|
self, |
|
|
|
command | |
|
) |
| | |
Create a new task specification.
- Parameters:
-
| self | Reference to the current task object. |
| command | The shell command line to be exected by the task. |
def work_queue::Task::specify_algorithm |
( |
|
self, |
|
|
|
algorithm | |
|
) |
| | |
Set the worker selection algorithm for task.
- Parameters:
-
| self | Reference to the current task object. |
| algorithm | One of the following algorithms to use in assigning a task to a worker:
|
def work_queue::Task::specify_tag |
( |
|
self, |
|
|
|
tag | |
|
) |
| | |
Attach a user defined logical name to the task.
- Parameters:
-
| self | Reference to the current task object. |
| tag | The tag to attach to task. |
def work_queue::Task::specify_preferred_host |
( |
|
self, |
|
|
|
hostname | |
|
) |
| | |
Indicate that the task would be optimally run on a given host.
- Parameters:
-
| self | Reference to the current task object. |
| hostname | The hostname to which this task would optimally be sent. |
def work_queue::Task::specify_file |
( |
|
self, |
|
|
|
local_name, |
|
|
|
remote_name = None , |
|
|
|
type = None , |
|
|
|
flags = None , |
|
|
|
cache = True | |
|
) |
| | |
Add a file to the task.
- Parameters:
-
| self | Reference to the current task object. |
| local_name | The name of the file on local disk or shared filesystem. |
| remote_name | The name of the file at the execution site. |
| type | Must be one of the following values: WORK_QUEUE_INPUT or WORK_QUEUE_OUTPUT |
| flags | May be zero to indicate no special handling, or any of the following or'd together:
|
| cache | Legacy parameter for setting file caching attribute. By default this is enabled. |
Example:
>>> task.specify_file("/etc/hosts", type=WORK_QUEUE_INPUT, flags=WORK_QUEUE_NOCACHE)
>>> task.specify_file("/etc/hosts", "hosts", type=WORK_QUEUE_INPUT, cache=false)
def work_queue::Task::specify_input_file |
( |
|
self, |
|
|
|
local_name, |
|
|
|
remote_name = None , |
|
|
|
flags = None , |
|
|
|
cache = True | |
|
) |
| | |
def work_queue::Task::specify_output_file |
( |
|
self, |
|
|
|
local_name, |
|
|
|
remote_name = None , |
|
|
|
flags = None , |
|
|
|
cache = True | |
|
) |
| | |
def work_queue::Task::specify_buffer |
( |
|
self, |
|
|
|
buffer, |
|
|
|
remote_name, |
|
|
|
flags = None , |
|
|
|
cache = True | |
|
) |
| | |
Add an input bufer to the task.
- Parameters:
-
| self | Reference to the current task object. |
| buffer | The contents of the buffer to pass as input. |
| remote_name | The name of the remote file to create. |
| flags | May take the same values as specify_file. |
| cache | Legacy parameter for setting file caching attribute. By default this is enabled. |
def work_queue::Task::specify_file_command |
( |
|
self, |
|
|
|
remote_name, |
|
|
|
command, |
|
|
|
type, |
|
|
|
flags, |
|
|
|
cache = True | |
|
) |
| | |
Add a file created or handled by an arbitrary command to a task (eg.
wget, ftp, chirp_get|put).
- Parameters:
-
| self | Reference to the current task object. |
| remote_name | The name of the remote file at the execution site. |
| command | The contents of the buffer to pass as input. |
| type | Must be one of the following values: WORK_QUEUE_INPUT or WORK_QUEUE_OUTPUT |
| flags | May take the same values as specify_file. |
| cache | Legacy parameter for setting file caching attribute. By default this is enabled. |
The documentation for this class was generated from the following file: