Add NumaPolicy "hardware" option that bypasses current processor affinity.

Can be used in case a GUI (e.g. ChessBase 17 see #5307) sets affinity to a
single processor group, but the user would like to use the full capabilities of
the hardware.  Improves affinity handling on Windows in case of multiple
available APIs and existing affinities.

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

No functional change
This commit is contained in:
Tomasz Sobczyk
2024-06-04 12:48:13 +02:00
committed by Joost VandeVondele
parent daaccd9fc9
commit 02ff76630b
2 changed files with 232 additions and 167 deletions

View File

@@ -133,6 +133,11 @@ void Engine::set_numa_config_from_option(const std::string& o) {
{
numaContext.set_numa_config(NumaConfig::from_system());
}
else if (o == "hardware")
{
// Don't respect affinity set in the system.
numaContext.set_numa_config(NumaConfig::from_system(false));
}
else if (o == "none")
{
numaContext.set_numa_config(NumaConfig{});