]> git.sesse.net Git - stockfish/commit
Fix processor group binding under Windows.
authornoobpwnftw <guo.bojun@gmail.com>
Fri, 12 Nov 2021 22:38:52 +0000 (06:38 +0800)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 15 Nov 2021 17:19:53 +0000 (18:19 +0100)
commit9048ac00db12a9ac48bff9b9eb145b30ff88d984
treeb92db59ed8dd96c08a657b5a708a6f71676f06e7
parent1a5c21dc56a30f4af3979fb47ec3681dc7077195
Fix processor group binding under Windows.

Starting with Windows Build 20348 the behavior of the numa API has been changed:
https://docs.microsoft.com/en-us/windows/win32/procthread/numa-support

Old code only worked because there was probably a limit on how many
cores/threads can reside within one NUMA node, and the OS creates extra NUMA
nodes when necessary, however the actual mechanism of core binding is
done by "Processor Groups"(https://docs.microsoft.com/en-us/windows/win32/procthread/processor-groups). With a newer OS, one NUMA node can have many
such "Processor Groups" and we should just consistently use the number
of groups to bind the threads instead of deriving the topology from
the number of NUMA nodes.

This change is required to spread threads on all cores on Windows 11 with
a 3990X CPU. It has only 1 NUMA node with 2 groups of 64 threads each.

closes https://github.com/official-stockfish/Stockfish/pull/3787

No functional change.
src/misc.cpp