Ruud H.G. van Tol on Sun, 03 Dec 2023 16:20:33 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: PARI/GP pthread questions


On 2023-12-03 16:05, Ruud H.G. van Tol wrote:
On 2023-12-03 15:31, Bill Allombert wrote:
On Sun, Dec 03, 2023 at 03:09:49PM +0100, Karim Belabas wrote:
[...]
For systems with hyper-threading, one can get the number of physical cores
as follows on my laptop:

# grep '^cpu cores' /proc/cpuinfo | uniq
cpu cores    : 4
This is only work if you have a single CPU!

$ grep '^physical id[^:]*:' /proc/cpuinfo |sort |uniq |wc -l
2

$ grep '^core id[^:]*:' /proc/cpuinfo |sort |uniq |wc -l
8

$ grep '^processor[^:]*:' /proc/cpuinfo |wc -l
32

$ grep '^cpu cores[^:]*:' /proc/cpuinfo |sort |uniq -c
     32 cpu cores       : 8

$ lscpu | grep -E '^(Thread|Core|Socket|CPU)[(]'
CPU(s):                32
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             2


Then see also `numactl`.

-- Ruud