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.

This file is used to define the procedures that are listed below.
Note: vnc_policy.tcl can now reside in vnc.swd/vnc_policy.tcl as well as $VOVDIR/local/vnc_policy.tcl.

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:
tool
Tool or command name, such as hsim
command
Complete command line (without wrapper)
user
Login name submitting the job
setName
Name of the set in which the job is to be placed
group
The group the submitter requested
inputs
Inputs to the job
outputs
Output files of the job
mailuser
Email address, if notification was requested
wrapper
Name of the FT wrapper program, such as vw
priority,default
Default submission priority
priority
Requested submission priority
resources
Requested submission resources
env
Name of requested job run environment
xdur
Expected duration of job
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.
Example for 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.

The following is an example for vnc_policy.tcl:
# 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.

Fragment of $VOVDIR/local/vnc_policy.tcl:
# 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

There is also a way to throttle users who have submitted a number of jobs over a configurable threshold. This was implemented so that users trying to submit too many job in a small time frame can not overload vovserver. The process adds a delay to job submission for users that have gone over that threshold.
Note: Although mentioned in this section because they affect job submission, these values are set in the vovserver configuration file policy.tcl.
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.