views:

54

answers:

1

Is there any API/way to get the "distance" (called 'hops' in literature) between two NUMA nodes? I want to implement a memory allocation system that takes advantage of this (reuse memory from the nearest node, because the access is faster).
Windows doesn't seem to have such a feature... and libnuma (under Linux) doesn't seem to have it too. Is there any way to get this info (even with something like 'cpuid') ?

+1  A: 

For Linux it's possible to get the topology at least by parsing /proc. This is explained e.g. in chapter 5 of Ulrich Drepper's "What every programmer should know about memory". Chapter 6.5 is also somewhat relevant.

janneb