Job Submission Policy
The job submission behavior of Accelerator or Accelerator Plus can be controlled by the file vnc_policy.tcl, which resides in the vovserver configuration directory.
When placed in the configuration directory, it only affects that Accelerator instance. When placed in the 'local' directory, it affects all Accelerator instances.
Procedures for Customizing Job Submission
Procedure | Args | Description |
---|---|---|
VncPolicyDefaultPriority | { user } |
Assign the default priority to a job based on the user. |
VncPolicyDefaultResources | {} |
Compute the default resources required by a job. |
VncPolicyGetJobInfo | { key } |
Retrieve job information. Following are the available key values:
|
VncPolicyUserPriority | { user schedPriority } |
Limit the scheduling priority based on the maximum allowed to the user. |
VncPolicyUserPriorityExec | { user execPriority } |
Limit the execution priority for a job. By default, this returns the priority that has been passed in. |
VncPolicyValidateCommand | { commandLine } |
Make sure that the command line for a job obeys site-specific rules. |
VncPolicyValidateEnvironment | { envName } |
Make sure that the environment name for a job obeys site-specific rules. |
VncPolicyValidateOptions | { subCommand argv } |
Ensures the arguments obey site-specific rules. Returns a
modified list of options. See example below. |
VncPolicyValidateResources | { reslist } |
Ensure that the resource list for a job obeys rules defined by the Accelerator administrator. |
VncPolicyValidateOptions
:proc VncPolicyValidateOptions { subCommand argv } {
set nargv []
set maxAutoKill [VovParseTimeSpec 30d]
while { $argv ne {} } {
set arg [shift argv]
switch -glob -- $arg {
"-autokill" {
lappend nargv $arg
set value [VovParseTimeSpec [shift argv]]
if { $value > $maxAutoKill } {
lappend nargv "30d"
} else {
lappend nargv $value
}
}
default {
lappend nargv $arg
}
}
}
return $nargv
}
The VncPolicy* procedures are called at job submission time, and may cause the job entered into the server to have modified resources or priority compared to what the submission requested.
# This is an example of vnc_policy.tcl
proc VncPolicyDefaultResources {} {
global env
return "$env(VOVARCH) RAM/50"
}
proc VncPolicyValidateResources { resList } {
#
# This policy adds a minimum RAM requirement
# for all submitted jobs.
# global VOV_JOB_DESC
if { $VOV_JOB_DESC(tool) == "vovresgrab" } {
# Do not touch this type of jobs (see vovresreq).
return $resList
}
if [regexp "RAM/" $resList] {
# Job already has a RAM constraint.
} else {
# Add a RAM constraint.
lappend resList "RAM/100"
}
return $resList
}
The following is an example using the tool name. This can be used to send jobs of a certain tool to specific hosts. A Tcl catch{ } is used in case someone uses this file with an older version by mistake.
# This is a second example of vnc_policy.tcl
proc VncPolicyDefaultResources {} {
global env
return "$env(VOVARCH)"
}
proc VncPolicyValidateResources { resList } {
#
# This policy sends tharas jobs to vovtasker hosts offering 'tharas_host'
# and keeps other kinds of jobs off those hosts
#
catch {
set jtool [VncPolicyGetJobInfo tool]
if { "$jtool" == "tharas" } {
lappend_no_dup resList tharas_host
} else {
lappend_no_dup resList "!tharas_host"
}
}
return $resList
}
Throttling Job Submission Rate
Procedure | Args | Description |
---|---|---|
hog.protection.enable | ( ) |
The default is 0, which means it is disabled. Add a 1 to enable it. |
hog.protection.jobcountthreshold | ( N ) |
N represents the number of jobs which will trigger this threshold. Default is 100000. Min value is 1000. Max value is 999999. |
hog.protection.clientdelay | ( S ) |
S is the number of seconds to delay the submit of a user how has triggered this rule. The default is 1 second. Min is 1 second. Max is 600. |