CPU
NUMA (Non-Uniform Memory Access)
On a typical two-socket server, each processor has RAM attached to it. A core can access RAM attached to either processor, but its local RAM is usually faster to reach. Linux represents these groups as NUMA nodes. That makes two placement decisions matter: which core runs your thread, and where its data lives.
Say you have one HPC compute node with two physical CPUs and 512 GiB of RAM. A simple layout would be:
One HPC compute node (one server)
├── NUMA node 0 → CPU socket 0 (32 cores) + 256 GiB of local RAM
└── NUMA node 1 → CPU socket 1 (32 cores) + 256 GiB of local RAM
Check NUMA settings passed to kernal at boot:
tr ' ' '\n' < /proc/cmdline | grep '^numa'
CPU Affinity
CPU affinity specifies which CPU cores a thread is allowed to run on.
taskset is the main command used for checking and changing process affinity settings.
| Flags | Description |
| -pc $PID |
Check the affinity settings for a PID |
| -pc $CORE $PID |
Set a specific core affinity for a PID. IE
|
| -pc $CORE-$CORE $PID |
Set a range of cores affinity for a PID. IE
|
|
-pc $CORE, $CORE, $CORE $PID |
Set a list of specified cores for a PID. IE
|
NICE
Niceness tells Linux how to share CPU time among competing threads on the cores they’re allowed to use, with lower nice values generally getting a larger share.