Jobs can have requirements, which are resources or other conditions which must be available before the job can run. Qube!'s requirement specification is expression based. The syntax for specifying the expression is similar to Perl or C. The proper use of these expressions will allow a user to specify the host and/or the conditions required.
An expression consists of operators and operands. Operators are either text or symbolic. These are equivalent:
eq, ==, =
String and numeric comparisons are automatically resolved based upon the values they resolve to.
Since a job requirement can include a number of operator characters, any reference to a property or resource that includes an operator should be quoted so the interpreter can differentiate between the literal character and the operator.
10 min 12
10 max 12
10 sub 8
1 + 2
3 * 4
14 / 7
12 xor 8
10 % 4
value in list (string with commas)
"v" in "x,y,v"
list (string with commas) has value
"x,y,v" has "v"
eq, =, ==
10 == 10
ne, <>, !=
10 != 10
1 and 0
|or, ||||OR||1 or 0||true|
12 & 8
||||bitwise OR||8 | 4||12|
5 < 10
5 > 10
less than or equal
4 >= 6
greater than or equal
4 <= 6
bitwise right shift (used to divide by 2n)
4 >> 1
bitwise left shift (used to multiply by 2n)
4 << 1
The reason for multiple definitions for most operators is to allow a programmer more flexibility in the case of Unix command line applications where reserved characters such as ">", unless otherwise escaped, will be interpreted by the shell.
Operands in Qube! also have a syntax. They all follow a base
"linux", "irix", "winnt", "osx"
CPU speed in MHz
Version reported by the operating system.
Comma delimited list of group names
Cluster specification string
List of restricted cluster specification strings
Numeric representation of the Worker's flags
Worker version of Qube!
Comma delimited list of job types
true if the flag exists
Comma delimited list of job properties for jobs on the worker.
are slightly different and include those defined by your administrator host.
host.processors.[ used | avail | total ]
Number of processors available on the worker
host.memory.[ used | avail | total ]
Memory in Mb available on the worker
host.swap.[ used | avail | total ]
Swap space available in Mb on the worker
The possible operands for a job.type are:
job's parent id
job process group
job's cluster value
user defined job "kind"
job's flags numeric value
true if the flag exists
|Command line example that uses a host resource expression|
|Run my job only on Linux hosts|
|Run on a Windows machine that has a processor speed of at least 3GHz|
|Run my job on any host except qb001|
|Run the job on a host with the Maya job type|
|Run my job only on dual processor hosts|
|Run my job only if there isn't already one of this job's instances running on it|
(Also see How to restrict a host to only one instance of a given kind of job, but still allow other jobs)
Run only one "kind" of job on a worker at the same time