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

  • Follow


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!
0
Reply ttt 1/23/2010 9:28:46 PM

ttt wrote:
> 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

0
Reply Branimir 1/24/2010 12:29:06 AM


On 24 ian., 02:29, Branimir Maksimovic <bm...@hotmail.com> wrote:
> ttt wrote:
> > 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

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 ?
0
Reply ttt 1/24/2010 8:29:29 AM

Hi,

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

http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/

Bye,
ttt wrote:
> 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.
0
Reply s 1/24/2010 9:34:53 AM

On 24 ian., 11:34, s <die9...@gmail.com> wrote:
> Hi,
>
> You might want to look at this link (though for x64):
>
> http://software.intel.com/en-us/articles/intel-64-architecture-proces...
>
> Bye,
>
>
>
> ttt wrote:
> > 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.

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).
0
Reply ttt 1/24/2010 11:35:51 AM

On 1/24/2010 12:29 AM, ttt wrote:

>
> 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.

0
Reply red 1/25/2010 1:37:50 AM

5 Replies
412 Views

(page loaded in 0.136 seconds)

Similiar Articles:






7/23/2012 8:28:49 PM


Reply: