diff --git a/include/verilated_threads.cpp b/include/verilated_threads.cpp index 96911eda6..cf503fda9 100644 --- a/include/verilated_threads.cpp +++ b/include/verilated_threads.cpp @@ -156,7 +156,7 @@ std::string VlThreadPool::numaAssign() { // Make a reasonable processor affinity selection const int num_threads = static_cast(m_workers.size()); if (num_threads < 2) return "too few threads"; - if (static_cast(num_threads) > num_proc) return "too many threads"; + if (static_cast(num_threads) >= num_proc - 1) return "too many threads"; // Read CPU info. // Uncertain if any modern system has gaps in the processor id (Solaris diff --git a/test_regress/t/t_gantt_numa.py b/test_regress/t/t_gantt_numa.py index a58c53bda..87f1f1f10 100755 --- a/test_regress/t/t_gantt_numa.py +++ b/test_regress/t/t_gantt_numa.py @@ -41,7 +41,8 @@ for trial in range(0, trials): if sys.platform != "darwin": test.file_grep(gantt_log, r'CPU info:') - test.file_grep(gantt_log, r'NUMA status += (assigned|%Warning: no /proc/cpuinfo)') + test.file_grep(gantt_log, + r'NUMA status += (assigned|too many threads|%Warning: no /proc/cpuinfo)') # False fails occasionally # test.file_grep_not(gantt_log, r'%Warning:') # e.g. There were fewer CPUs (1) than threads (3).