4

What does numactl --localalloc do? Does it bind program allocation to only the single node that numactl --localalloc was run on? Or does it ensure that whenever the program allocates its given memory from its local memory?

oconnor0
  • 143
  • 1
  • 5

2 Answers2

3

--localalloc will force memory allocation to come from the local pool for the node the process is running on, whatever node that may be.

To force bind to a specific processor, the --physcpubind option must be specified. When used in conjunction with localalloc, it'll force a process to run on a specified node and only draw memory from that node.

--preferred tells it to allocate from a specific node if possible, but use remote memory if not.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
  • How does `--localalloc` work when the process is running across all of the nodes - as there wouldn't be _a_ node the process is running on? – oconnor0 Sep 20 '11 at 20:01
  • @oconnor0 To my understanding, it's considered point-in-time. The memory allocation request will come in a single thread (it has to), and the memory allocation will be satisfied from the node-local memory of the node the process-thread is running on. If a process is running across 8 nodes, it'll allocate memory on all 8 nodes over time. `--interleave` may be a better choice for such node-spanning processes, especially if the process has no concept of node-locality. – sysadmin1138 Sep 20 '11 at 20:16
1

My understanding of the documentation is that --localalloc will allocate memory on the node of the CPU that made the system call. This should work well for applications that have worker threads pinned to individual CPUs, and in conjunction with malloc libraries that keep per-thread memory pools such as TCMalloc.

Isac Casapu
  • 235
  • 1
  • 10