How to get the distance (hops) between NUMA nodes?

T

ttt

Hi! Maybe this is not the best place to ask this kind of questions,
but...

I'm working on a memory allocator that should be optimized for use on
NUMA architectures. It tries to take memory from the node where the
current thread resides, and if it can't find there, it "steals" from
other nodes.

Here comes the problem: I want to take memory from the nearest node
(lowest hop value) to the farthest (so the access is as low as
possible), but I couldn't find an API (at least in Windows) to get
this type of information (only which CPUs are in a node, not
relationships between nodes).

Is there any way to get the distance between nodes ? It must not be
necessarily an API, CPUID/APIC would be very good if there is no other
way.

Thanks in advance!
 
B

Branimir Maksimovic

ttt said:
Hi! Maybe this is not the best place to ask this kind of questions,
but...

I'm working on a memory allocator that should be optimized for use on
NUMA architectures. It tries to take memory from the node where the
current thread resides, and if it can't find there, it "steals" from
other nodes.
....

Is there any way to get the distance between nodes ? It must not be
necessarily an API, CPUID/APIC would be very good if there is no other
way.

Thanks in advance!

I think that numa api is always os specific. For example on linux
you have libnuma, that is, api for kernel numa support.

http://manpages.ubuntu.com/manpages/intrepid/man3/numa.3.html

Greets
 
T

ttt

I think that numa api is always os specific. For example on linux
you have libnuma, that is, api for kernel numa support.

http://manpages.ubuntu.com/manpages/intrepid/man3/numa.3.html

Greets

Thanks. libnuma has a 'distance' function which does what I want. But
I'm more interested in support for Windows.
I've found a new function that appeared in Win7 GetNumaProximityNode
but I couldn't understand from the documentation how it's supposed to
work. Has anyone used this function ?
 
T

ttt

Hi,

You might want to look at this link (though for x64):

http://software.intel.com/en-us/articles/intel-64-architecture-proces...

Bye,

I have found a solution for Windows (though not tested yet). The
distance can be found in the SLIT - System Locality Information Table
- an extensions provided by OEMs and available through ACPI. It
contains a nCpu x nCpu matrix that describes the distances. Windows
Vista+ has the method GetSystemFirmwareTable that can be used to
retrieve this table (and under XP it seems that it can be retrieved
from the Registry, but it's more difficult). The structure of this
table can be found in the ACPICA package (http://www.acpica.org).
 
R

red floyd

Thanks. libnuma has a 'distance' function which does what I want. But
I'm more interested in support for Windows.
I've found a new function that appeared in Win7 GetNumaProximityNode
but I couldn't understand from the documentation how it's supposed to
work. Has anyone used this function ?

At this point, you are better off asking in a Windows forum. You might
seriously consider MSDN.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top