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') ?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With