NUMA, PROCESSOR GROUPs, System Topology, Powershell...

Hi

I see below

http://msdn.microsoft.com/en-us/library/windows/hardware/ff553035(v=vs.85).aspx
In Windows 7, the maximum number of groups in a multiprocessor system is 4, but this value might change in future versions of Windows.
The safest way to determine the maximum number of groups in Windows 7 or a later versions of the Windows operating system is to call KeQueryMaximumGroupCount.

Search on WDK gives below
typedef struct _PNP_REPLACE_PROCESSOR_LIST {

PKAFFINITY Affinity;
Field_range(<=, MAXIMUM_GROUPS) ULONG GroupCount;
ULONG AllocatedCount;
ULONG Count;
ULONG ApicIds[ANYSIZE_ARRAY];

} PNP_REPLACE_PROCESSOR_LIST, *PPNP_REPLACE_PROCESSOR_LIST;

Q1) Where is MAXIMUM_GROUPS defined?

Q2) I want to get system topology information basically what NumaExplorer or CoreInfo does, Are there any powershell cmdlets as well, to get all that information.

Thanks

Hi

Q3) Also is there any way to know how many logical_processors belong to each NUMA Node?
I see below WDK APIs not sure if any of these give me above directly?
KeQueryHighestNodeNumber();
KeQueryActiveGroupCount();
KeQueryMaximumGroupCount();
KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS);
KeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS);
KeQueryMaximumProcessorCountEx(group#);
KeQueryGroupAffinity(group#);

Thx

wrote in message news:xxxxx@ntdev…
> Hi
>Q1) Where is MAXIMUM_GROUPS defined?

Q1) Don’t use that, because you will use the value defined for your
(minimum) target OS. use the value returned by KeQueryMaximumGroupCount
instead.

>
> Q3) Also is there any way to know how many logical_processors belong to
> each NUMA Node?

Q3) Use KeQueryNodeMaximumProcessorCount.

BTW NUMA nodes cannot span multiple processor groups. No code should ever
assume that any processor group consists of 64 or more CPUs. There are boot
parameters that allows you to set the maximum number of a processors in a
group, create groups on systems with little CPUs, as well as special
features that
allow you to test your NUMA or group aware code.

//Daniel

Thanks.

Also I build one binary for 2k8 SP2 x64 and 2k8 R2*. I use “WLH” as the build param.
Below call compiles in but the binary won’t load on 2k8 SP2 x64
KeQueryActiveGroupCount();

Not sure if it is something to do with procgrp.lib below at http://msdn.microsoft.com/en-us/library/dd834198.aspx - But is talking about down-leveling
“Drivers calling the new group-aware DDIs can opt into being able to run downlevel by including procgrp.h and linking against procgrp.lib included with the Server 2008 R2 or later DDK. A runtime check determines the actual DDIs called. Because downlevel operating systems by definition have exactly one group, the new group-aware DDI calls are routed to an alternate implementation that leverages the legacy non-group-aware DDIs.”

Q4)
I guess I will have same issue for below, since PG(+NUMA) api?
KeQueryNodeMaximumProcessorCount(grp#)

Q5)
But want to know If I will have same issue for below NUMA ONLY (i.e no PG related) Ke*Node*() calls i.e. do I have NUMA API runtime (they compile in with WLH) support in 2k8SP2 x64 (i.e. WLH)
KeQueryNodeMaximumProcessorCount();
KeQueryHighestNodeNumber()

Thx

Most of these function require Window 7 or later, you can look up the
minimum requirements in MSDN. The procgrp feature makes things easy if you
want to compile for earlier versions of Windows, without requiring you to
compile separate binaries or look up system routines yourself at runtime.

//Daniel

wrote in message news:xxxxx@ntdev…
> Thanks.
>
> Also I build one binary for 2k8 SP2 x64 and 2k8 R2*. I use “WLH” as the
> build param.
> Below call compiles in but the binary won’t load on 2k8 SP2 x64
> KeQueryActiveGroupCount();
>
> Not sure if it is something to do with procgrp.lib below at
> http://msdn.microsoft.com/en-us/library/dd834198.aspx - But is talking
> about down-leveling
> “Drivers calling the new group-aware DDIs can opt into being able to run
> downlevel by including procgrp.h and linking against procgrp.lib included
> with the Server 2008 R2 or later DDK. A runtime check determines the
> actual DDIs called. Because downlevel operating systems by definition have
> exactly one group, the new group-aware DDI calls are routed to an
> alternate implementation that leverages the legacy non-group-aware DDIs.”
>
> Q4)
> I guess I will have same issue for below, since PG(+NUMA) api?
> KeQueryNodeMaximumProcessorCount(grp#)
>
> Q5)
> But want to know If I will have same issue for below NUMA ONLY (i.e no PG
> related) KeNode() calls i.e. do I have NUMA API runtime (they compile in
> with WLH) support in 2k8SP2 x64 (i.e. WLH)
> KeQueryNodeMaximumProcessorCount();
> KeQueryHighestNodeNumber()
>
> Thx
>

My impression was that a NUMA node is defined by physical processor
connectivity. You can chech out my NUMAExplorer source which you can find
via www.flounder.com/mvp_tips.htm, where I do the user-level versions of
soe of those calls, but it has not been extended to support the concept of
groups (yet).

Maybe when my development machine returns I’ll put Win8 up on a VM.
joe

Hi

Q3) Also is there any way to know how many logical_processors belong to
each NUMA Node?
I see below WDK APIs not sure if any of these give me above directly?
KeQueryHighestNodeNumber();
KeQueryActiveGroupCount();
KeQueryMaximumGroupCount();
KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS);
KeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS);
KeQueryMaximumProcessorCountEx(group#);
KeQueryGroupAffinity(group#);

Thx


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer