The Options Block

Use the options block to set Service options and description information.

Use the following directives for features specific to PDriver jobs:

Options Block Keywords and Arguments

Keyword

Argument

Description

onerror

ignore, retry or fail

The default way to handle errors. See “Builtin Commands” below for details.

maxFailedTaskRetries

A numeric expression

The number of times to resubmit a failed task.

autoCancelMode

never, always or libloadfailure

Whether to cancel the entire job when a single task fails. The default is libloadfailure, which cancels the job if a task fails due to the inability to load a library on the Engine side. You can set this standard option with jobOption, but the autoCancelMode directive enables you to use mnemonic strings, rather than numbers, as arguments.

enableBlacklisting

An expression evaluating to true or false

This argument is the same as engineBlacklisting for other Services. The default value is false.

Set standard options (described in the C++ API reference documentation for the Options object) with the jobOption directive:

jobOption "engineBlacklisting" "true"
jobOption "priority" "8"

Set elements of the job description with the jobDescription directive:

    jobDescription "serviceName" "Distributed Grep"

Each argument to jobOption or jobDescription must be a string or an expression that evaluates to a string. Literal numbers are not allowed.

The following jobOption directives are common to both PDriver and CPPDriver:

jobOption Directive Keywords and Arguments

Keyword

Argument

Description

email

string

An email address that is notified when a Service is completed.

priority

integer

The priority of this Service. The default value is 5.

taskMaxTime

integer

If a running task exceeds this amount of time in seconds, the task is rescheduled or retried based on the setting of rescheduleOnTimeout. The task is rescheduled or retried when the rescheduler checks for expired tasks after each poll period. This poll period is 60 seconds by default; it can be changed at Admin > System Admin > Manager Configuration > Services, under the Service Rescheduler heading, with the Poll Period property. The default value of taskMaxTime is infinite.

autoCancel

0, 1, or 2

Whether to automatically cancel the Service on a task failure. Possible values include 0 (AUTO_CANCEL_NEVER), 1 (AUTO_CANCEL_LIBRARY_LOAD), or 2 (AUTO_CANCEL_ALWAYS). The default value is 1 (AUTO_CANCEL_LIBRARY_LOAD).

compressData

true or false

Whether to compress the task, input, and output data. Compression time is minimal and recommended for data sizes greater than 10K for each input or output. The default is false.

killCancelledTasks

true or false

Whether to kill and restart an Engine if a task is canceled. If false, the canceled method is called rather than killing the Engine, to provide user-defined interruption of the task and any necessary cleanup. The default value is true.

Tasks are canceled when canceled in the Administration Tool, when a Service is canceled, and when another Engine completes the task due to redundant rescheduling.

tasksPerMessage

integer

The maximum number of tasks for each submission or retrieval message. Regardless of this number, messages do not exceed 100 KB. The default is 100.

autoPackNum

integer

The number of tasks in an auto-packed task. In this mode, a tasklet processes multiple task inputs in one Service routine by packing task inputs into a single task and calling your Service routine on all inputs. Use this mode when there are more inputs than Engines, or tasks are of short duration, to maximize efficient use of memory and Engine processing power.

If inputs are added outside of createTaskInputs, the Service checks every second if there are any unsubmitted tasks and submits them in a package even if there are fewer than the number requested, to ensure that all tasks are submitted.

Task IDs in the Administration Tool are the IDs of the task packages, so they do not directly correspond to the task ID from the Driver and Engine’s point of view.

TaskletException auto-resubmission and task-level discrimination are not supported for this mode, and are ignored. Autopack is also not supported on multiplexed Engines.

The default value is 0.

sharedUnixDir

string

A directory in which the Driver and UNIX Engines exchange data. This directory must be an NFS mounted directory to which all UNIX Engines working on this job have read/write access. This overrides use of the file servers on the Driver and Engines, and is optimally a directory local to this Driver for minimum network bandwidth.

If set and using Windows Engines, the Windows shared directory must also be set to the equivalent of this directory.

sharedWinDir

string

A directory in which the Driver and Engines exchange data. This directory must be a Windows shared directory to which all Windows Engines working on this job have read/write access. This overrides use of the file servers on the Driver and Engines, and is optimally a directory local to this Driver for minimum network bandwidth. Typically, the share is Windows UNC format, such as \\server\data.

If set and using UNIX Engines, the UNIX shared directory must also be set to the equivalent of this directory.

checkpoint

true or false

Enables checkpointing for this Service. The default value is false.

maxEngines

integer

The maximum number of Engines that can be working on a task at a time. The default value is infinite.

statusExpires

true or false

Whether the status of the job in the Services > Services > Service Session Admin page expires. If false, the status must be manually removed. The default value is true.

engineBlacklisting

true or false

Whether to prevent Engines that fail at a task from taking other tasks from that Service. The default value is false.

unloadNativeLibrary

true or false

Whether to unload the native library once the Service finishes. Set the value to false for sharing global objects in the library. The default value is true.

deleteInvocationData

1 or 2

When to purge Service invocation data from display in the Administration Tool. The default value is 1 (SERVICE_COMPLETED), to purge when a Service completes. Set to 2 (SERVICE_REMOVED), to purge when a Service is removed from the Administration Tool.

maxTaskRetries

integer

The maximum number of retries allowed for any task that fails. A retry occurs if the task failed and serviceFailRetry is true, or if the task exceed the taskMaxTime and maxTaskReschedules is false. The default value is 3.

maxTaskReschedules

integer

The maximum number of redundant reschedules allowed for any task, if any of the rescheduler strategies are in effect on the Broker. The default value is 3.

rescheduleOnTimeout

true or false

How a task is dealt with if it exceeds the taskMaxTime. If true, the request is rescheduled, and the current one continues. If false, the Engine running the task is killed, and the task is retried. The default is false.

serviceFailRestart

true or false

Whether an Engine restarts itself on a Service invocation failure. The default is false.

serviceFailRetry

true or false

Whether a Service request is retried on a failure. If true, it is retried up to the maximum number of times, as set by maxTaskRetries. The default is false.

gridLibrary

string

A Grid Library that is used for this Service. The string argument specifies the name of the Grid Library.

gridLibraryVersion

string

The version of the Grid Library that is used for this Service. The string argument specifies the version of the Grid Library.

JobDescriptions

All Services have a JobDescription object created upon instantiation, with default settings. Predefined properties are stored in the database. You can define any other properties. The following JobDescriptions properties are set by default:

JobDescription Properties

Property

Description

appName

The application name.

appDescription

The application description.

deptName

A department name associated with the Service.

groupName

A group name associated with the Service.

individualName

An individual’s name associated with the Service.

serviceName

The name of the Service. By default, this is the Service ID.

class

The name of the class in the Service.

serviceType

The type of Service.