Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

which logical core is hyperthread core in Core i7?

explore_zjx
Beginner
671 Views
Hi, all:
Now I have a Core i7-930 CMP platform. There are eight logical cores when executiong command top in linux(BIOS HT was enabled). And We can use the affinity interface of linux to set the process to a specified core. My question is how to identify which core is hyerthread core?Orwhich two cores share a physical processor? Fox example, there are 0, 1, 2,3,4,5,6,7 logical cores.
(0,1) (2,3) (4,5) (6,7) or (0,2) (1,3) (4,6) (5,7) or (0,3) (1,4).......
how to determine which two threads shared a physical core? I want to set my application to the two logical cores which shared a physical core?

Anyone have some suggestions? Thanks a lot!

Jason
0 Kudos
3 Replies
explore_zjx
Beginner
671 Views
I cat the /proc/cpuinfo file, I found the following discipline:

logical processor: 0 1 2 3 4 5 6 7
core id: 0 1 2 3 0 1 2 3
physical id :0 0 0 0 0 0 0 0

So I guess, (0,4) share a physical core. physical id represents a socket. core id represents four physical core.
so (0,4) (1,5) (2,6) (3,7) can be think that each pair share a physical core?


Linux tips: How to find out if a your CPU supports HT (Hyper-Threading)? http://www.ducea.com/2006/06/23/linux-tips-how-to-find-out-if-a-your-cpu-supports-ht-hyper-threading/ http://www.linuxforums.org/articles/finding-server-is-multi-processor-multi-core-or-hyperthreading-is-enabled-or-not-_856.html The above links assue my guess.
0 Kudos
jimdempseyatthecove
Honored Contributor III
671 Views
Please note that if you have core sensitive programming, you need to keep the code that makes this determination at run time. Do not assume that what you read for pairing today will be what you experience tomorrow. Boot optionsmay cause this to vary.

Jim Dempsey
0 Kudos
explore_zjx
Beginner
671 Views
good suggestions! thanks!
0 Kudos
Reply