(New in Rush 102.42a9c)
Processor affinity (or CPU Pinning) enables locking processes to use specific cpus.
By default (when unspecified), the operating system micromanages the realtime
scheduling of processes on a multiprocessor machine, assigning them to available
cpus dynamically.
If you set a cpu affinity for a machine, this tells Rush to run renders /only/ on
the specified physical processors. This is sometimes useful on e.g. workstations
where you want to assign only some of the machine's physical processors for rendering,
leaving some available for use by the user.
This is an optional field that can appear to the right of the cpu/criteria in the
Rush hosts file, and is of the form:
affinity=#
..where '#' is a hexadecimal value representing the bit field positions
of the cpus to lock the processes to. For instance, a value of '1' tells Rush
to use cpu #0 only, a value of '3' tells Rush to use cpus #0 and #1, and a value
of '7' to use cpus #0, #1 and #2.
When renders run on the machine, you should be able to clearly see your cpu affinity
setting in e.g. rushtop(1); the render's cpu use
should only show up on the cpus you assigned Rush to use.
Note that not all operating systems support cpu affinity. As of this writing (Oct 2012),
only Windows and Linux support cpu affinity, OSX does not.
By default when this field is unspecified, the operating system will control
which cpus Rush renders use, and all processors are available to the OS for rendering.
Only use cpu affinity if you want to force renders to only use certain physical
processors to ensure other processors are always available for other purposes.
A good example would be an 8 processor workstation, where the user might want
4 processors available for interactive use, while allowing the other 4 cpus
for rendering. In such a case you would want 'affinity=f' to lock
Rush to using cpus #0, #1, #2 and #3.
Common values you might want to use:
affinity=1 -- use only one processor (cpu #0)
affinity=3 -- use 2 processors (cpu #0 and #1)
affinity=7 -- use 3 processors (cpu #0, #1, #2)
affinity=f -- use 4 processors (cpu #0, #1, #2, #3)
affinity=1f -- use 5 processors (cpu #0, #1, #2, #3, #4)
affinity=3f -- use 6 processors (cpu #0, #1, #2, #3, #4, #5)
affinity=7f -- use 7 processors (cpu #0, #1, #2, #3, #4, #5, #6)
affinity=ff -- use 8 processors (cpu #0, #1, #2, #3, #4, #5, #6, #7)
affinity=1ff -- use 9 processors (cpu #0, #1, #2, #3, #4, #5, #6, #7, #8)
affinity=3ff -- use 10 processors (cpu #0, #1, #2, #3, #4, #5, #6, #7, #8, #9)
affinity=7ff -- use 11 processors (cpu #0, #1, #2, #3, #4, #5, #6, #7, #8, #9, #10)
affinity=fff -- use 12 processors (cpu #0, #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11)
affinity=1fff -- use 13 processors (cpu #0, #1, #2, #3, #4, #5, #6, #7, #8, #9, #10, #11, #12)
..etc..
Here's a table of incremental affinity values. Note that the values are bit fields,
and not a cpu count. This is so that one can uniquely specify any arrangement
of physical cpus to be enabled:
Affinity Value
|
CPU# Enabled
|
Binary Equiv
|
-- Cpu# --
0 1 2 3 4 5
- - - - - -
|
-- Total Cpus --
|
1 | 0 | 00001 | X - - - - - | 1 |
2 | 1 | 00010 | - X - - - - | 1 |
3 | 0,1 | 00011 | X X - - - - | 2 |
4 | 2 | 00100 | - - X - - - | 1 |
5 | 0,2 | 00101 | X - X - - - | 2 |
6 | 1,2 | 00110 | - X X - - - | 2 |
7 | 0,1,2 | 00111 | X X X - - - | 3 |
8 | 3 | 01000 | - - - X - - | 1 |
9 | 0,3 | 01001 | X - - X - - | 2 |
a | 1,3 | 01010 | - X - X - - | 2 |
b | 0,1,3 | 01011 | X X - X - - | 3 |
: : : |
e | 1,2,3 | 01110 | - X X X - - | 3 |
f | 0,1,2,3 | 01111 | X X X X - - | 4 |
10 | 4 | 10000 | - - - - X - | 1 |
11 | 0,4 | 10001 | X - - - X - | 2 |
: : : |