Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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
share|improve this question
Could you post complete /proc/cpuinfo please – Serge Sep 30 '12 at 20:06
It is here, probably too long to fit in the question. – Vladimir F Oct 1 '12 at 10:59
Are you sure that you are only scheduling your program to run on those cores? Try running your performance test with the application being run with real-time priority (or as high as possible), to prevent other parts of the OS from interfering. From your Pastebin, you/Serge are correct (CPUs 0-7 are the first physical processor, 8-15 are the second). – Breakthrough Oct 1 '12 at 11:30
up vote 2 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .