...
Restrictions are used to allow or restrict where jobs run, and are applied to both jobs and Workers. Restrictions are based on cluster names, but differ from the clusters themselves in an important way:
Note |
---|
Jobs and workers can belong to 1 and only 1 cluster, but can be restricted to none, 1, or several clusters |
This seems a bit hard to understand, until you remember that a . A job has preferential priority on a Worker whose cluster matches the job's cluster, but the job is free to run on any Worker in other clusters. The job's restriction value can be used to limit what other clusters the job could possibly run onany other cluster, subject to the restrictions defined here.
Restrictions defined for jobs
When a job has a restriction defined, it means only run on hosts that satisfy the restriction expression. Hosts that don't satisfy the restriction expression won't be considered as dispatch candidates (the job will never be sent to that Worker).
...
When a Worker has a restriction defined via its worker_restrictions value, it means only run jobs whose cluster value matches one of the clusters in that worker's restriction expression. The worker won't accept jobs whose cluster doesn't match one of the clusters in the worker's restriction expression.
Restrictions Syntax
A restriction is really defined as a "filter" for hosts based upon information in the queuing algorithm; the values are one or more cluster names. In the priority/cluster queuing system, a user specifies their the restrictions by with a directory structure format:
/[<segment>/][<segment>/][+|*]
- * means only the first level below.
- + means all levels below that level, regardless of depth in the hierarchy.
Tip |
---|
The restriction value is actually evaluated as an expression, and multiple clusters are specified in a "this cluster OR that cluster OR the other cluster" type of string, with the " || " symbol to mean OR. |
Examples
...
Job Restrictions
Define a host that will only run jobs in /private/very/deep
worker_cluster = "/private/very/deep"
...
Define a host that will run jobs in any cluster at /private or 1 level below - done with the *
worker_cluster = "/private"
worker_restrictions = "/private or /private/*"
...
worker_cluster = "/private/very"
...
Job Restrictions
Syntax | Meaning |
---|---|
qbsub -cl /private -restr /private <cmd> | Submit a job that will have highest priority in /private and run only in /private |
...
qbsub -cl /private/very -restr '/private || /private/*' <cmd> | Submit a job that will have highest priority in /private/very, but could run in any host in |
qbsub -cl /private/very/deep -restr '/private |
...
|| /private/ |
...
+' <cmd> | Submit a job that will have highest priority in /private/very/deep, but could run in any |
...
Worker Restrictions
Syntax | Meaning |
---|---|
worker_cluster = "/private/very/deep |
...
" | Define a host that will only run jobs in /private/very/deep |
worker_cluster = "/private" | Define a host that will run jobs in any cluster at /private or 1 level below - done with the * |
worker_cluster = "/private/very" | Define a host that will only run jobs in /private/very or any level below - done with the + |