6

I need to test performance of a multithreaded program on 1 CPU, but I have a dual CPU machine. I need to set affinity to those logical CPU's, that share their socket, oterwise they strongly benefit from larger number of FSB's. I tried affinity 0-7 and 8-15, but the results differ considerably, the first being faster. Therefore I do not know which logical CPU's share their socket.

lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-15
Thread(s) per core:    1
Core(s) per socket:    8
CPU socket(s):         2
NUMA node(s):          4
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 9
Stepping:              1
CPU MHz:               800.000
BogoMIPS:              4000.40
Virtualization:        AMD-V
L1d cache:             64K
L1i cache:             64K
L2 cache:              512K
L3 cache:              5118K
NUMA node0 CPU(s):     0-3
NUMA node1 CPU(s):     4-7
NUMA node2 CPU(s):     12-15
NUMA node3 CPU(s):     8-11


~]$ cat /proc/cpuinfo | grep 'core id'
core id         : 0
core id         : 1
core id         : 2
core id         : 3
core id         : 0
core id         : 1
core id         : 2
core id         : 3
core id         : 0
core id         : 1
core id         : 2
core id         : 3
core id         : 0
core id         : 1
core id         : 2
core id         : 3

2 Answers2

4

First 8 processors are from one chip and second 8 processors from another chip. You can distinguish it by physical id. As for difference in performance - I have no idea presently.

Serge
  • 2,768
0

The latency of 2 CPUs matters. Read the datasheets for your motherboard, and you will know that one of them is primal and essential to run platform.

For example, you can run the platform by populating socket0 and socket0, socket1, but you can't run the platform by populating socket1 only.

That's why you have difference performance on each one. They should be similar anyway, but they will not be identical.

jonsca
  • 4,084
tygore
  • 1