Advanced Policy Configuration
Besides the vovserver configuration file policy.tcl, the
behavior of job submission to Accelerator can also be controlled
by the file $VOVDIR/local/vnc_policy.tcl, which is used to
define the following procedures:
VncPolicyDefaultResources | The default resources required by a job. |
VncPolicyValidateResources | Make sure that the resource list for a job obeys any number of rules. |
VncPolicyDefaultPriority { user } | Assign the default priority to a job based on the user. |
VncPolicyMaxPriority { user priority } | Limit the priority based on the maximum allowed to the user. |
In this tutorial, you will configure VncPolicyDefaultResources and VncPolicyValidateResources.
Configure Default Resources
By default, Accelerator takes machine architecture as the resource
of the job that you submit from a particular machine. This is controlled by the
default setting of
VncPolicyDefaultResources:
proc VncPolicyDefaultResources {} {
global env
return "$env(VOVARCH)"
}
To change this behavior, you can create or edit the file
$VOVDIR/local/vnc_policy.tcl, and add or edit the
procedure that follows. This procedure will set the default resources to be the
architecture and 50mb of memory. If you have more than one Accelerator setup, you can place the
vnc_policy.tcl file in the .swd
and it will apply only to that one.
proc VncPolicyDefaultResources {} {
global env
return "$env(VOVARCH) RAM/50"
}
Enforce Job Resource Rules
You can also enforce some rules of job resources by overriding the procedure
VncPolicyValidateResources. Here is the default
behavior:
proc VncPolicyValidateResources { resList } {
return $resList
}
But this process does nothing. Try the process described below:
To enforce a rule so that all jobs require a minimum RAM of 512 MB, create or
edit the file $VOVDIR/local/vnc_policy.tcl and add or edit
VncPolicyValidateResources procedure as follows:
proc VncPolicyValidateResources { resList } {
#
# This policy adds a minimum RAM requirement
# for all submitted jobs.
#
if [regexp "RAM/" $resList] {
# Already a RAM constaints.
} else {
lappend resList "RAM/512"
}
return $resList
}