From 9e4bb2e28bfde233433ecc7226e8e66b568618e3 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 14 Jun 2019 23:48:59 -0500 Subject: [PATCH] Disable the POSIX & Linux core count until stable. Some methods for quering the cpu counts are unreliable when run in a container or other cpuset restrictions. Disable them to prefer the std query. --- src/engine/sysinfo.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/engine/sysinfo.cpp b/src/engine/sysinfo.cpp index c3257e71e..28b35c1f0 100644 --- a/src/engine/sysinfo.cpp +++ b/src/engine/sysinfo.cpp @@ -100,10 +100,10 @@ unsigned int b2::system_info::cpu_core_count() { cpu_thread_count_ = macosx_physicalcpu(); } - if (cpu_thread_count_ == 0) - { - cpu_thread_count_ = sysconf_nprocs_configured(); - } + // if (cpu_thread_count_ == 0) + // { + // cpu_thread_count_ = sysconf_nprocs_configured(); + // } if (cpu_core_count_ <= 0) { cpu_core_count_ = 1; @@ -117,14 +117,14 @@ unsigned int b2::system_info::cpu_thread_count() { cpu_thread_count_ = macosx_logicalcpu(); } - if (cpu_thread_count_ == 0) - { - cpu_thread_count_ = sched_affinity_cpu_count(); - } - if (cpu_thread_count_ == 0) - { - cpu_thread_count_ = sysconf_nprocs_online(); - } + // if (cpu_thread_count_ == 0) + // { + // cpu_thread_count_ = sched_affinity_cpu_count(); + // } + // if (cpu_thread_count_ == 0) + // { + // cpu_thread_count_ = sysconf_nprocs_online(); + // } if (cpu_thread_count_ == 0) { cpu_thread_count_ = std_thread_hardware_concurrency();