Processor Cores

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Processor Cores

Post by bob »

jsgroby wrote:I have also followed this and the results are still 4 cores.

So why does the machine report 2 cores in the OS and in MacTracker? Do I have a freak machine?

http://stackoverflow.com/questions/1715 ... n-mac-os-x
The "about this mac" is reporting physical cores. When you use something like activity monitor it shows all 4 logical cores.

You can write a pretty straightforward CPUID program to see the actual CPU info if you want.
User avatar
jsgroby
Posts: 83
Joined: Mon Mar 24, 2014 12:26 am
Location: Glen Carbon, IL USA

Re: Processor Cores

Post by jsgroby »

bob wrote:
jsgroby wrote:I have also followed this and the results are still 4 cores.

So why does the machine report 2 cores in the OS and in MacTracker? Do I have a freak machine?

http://stackoverflow.com/questions/1715 ... n-mac-os-x
The "about this mac" is reporting physical cores. When you use something like activity monitor it shows all 4 logical cores.

You can write a pretty straightforward CPUID program to see the actual CPU info if you want.
Thanks. I was finally able to sort it all out based on the information you and others provided here.

Just as an aside, I set my engine up against the latest Crafty version for 20 5 min blitz games. I am not sure why I did this, because I have been working my way up from lesser engines and making coding changes where needed. I guess it was morbid curiosity. Crafty beat my engine in all 20 games.

So now, back to working my way up the ranks and making the changes as needed.

Jeff
Engin
Posts: 918
Joined: Mon Jan 05, 2009 7:40 pm
Location: Germany
Full name: Engin Üstün

Re: Processor Cores

Post by Engin »

Hello, i am using the program CPU-Z to get a good hardware infos

here the link: http://www.cpuid.com/
abulmo
Posts: 151
Joined: Thu Nov 12, 2009 6:31 pm

Re: Processor Cores

Post by abulmo »

Yes, as far as chess programs are concerned. One typically wants the number of threads used for searching to equal the number of physical cores.
Why?
HT actually works. Of course 4 threads on 2 real cores × HT would not be as fast as on 4 real cores but it will be faster than 2 threads on 2 real cores without HT.
Richard
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Processor Cores

Post by bob »

jsgroby wrote:
bob wrote:
jsgroby wrote:I have also followed this and the results are still 4 cores.

So why does the machine report 2 cores in the OS and in MacTracker? Do I have a freak machine?

http://stackoverflow.com/questions/1715 ... n-mac-os-x
The "about this mac" is reporting physical cores. When you use something like activity monitor it shows all 4 logical cores.

You can write a pretty straightforward CPUID program to see the actual CPU info if you want.
Thanks. I was finally able to sort it all out based on the information you and others provided here.

Just as an aside, I set my engine up against the latest Crafty version for 20 5 min blitz games. I am not sure why I did this, because I have been working my way up from lesser engines and making coding changes where needed. I guess it was morbid curiosity. Crafty beat my engine in all 20 games.

So now, back to working my way up the ranks and making the changes as needed.

Jeff
I've spent some time trying to develop a "topology map" that Crafty can use. I'd like to know which physical cores are on the same cpu chip so that they share the same L3 cache and same bank of memory (since multi-cpu chip boxes are all NUMA nowadays). I want to try to optimize which threads use which cpus and that shallow splits are done between threads sharing the same local memory and L3.

Turns out to be a gigantic pain in the ass however. Operating systems don't enumerate processors the same way. One linux box I have enumerates 12 physical/24 logical cores as 0-11 physical, 12-23 logical processors that map 1-1 with physical cores 0-11, so 0-12, 1-13, etc. And I think "Aha, this will work." Then along comes apple and numbers the physical cores 0 and 2, and the corresponding logical cores 1-3. And then there are systems that use the APICID, which doesn't map 'em into consecutive numbers at all.

I finally thought "hell with it right now, too much inconsistency" I started to use the CPUID (which is painful and you have to force your thread onto each individual CPU to get its hardware numbering. But then it turns out the software can change that anyway. So again "hell with it." :)

Be nice if we had some sort of POSIX standard for topology and a corresponding library function that works everywhere. And notice I didn't even mention Micro$oft.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Processor Cores

Post by zullil »

abulmo wrote:
Yes, as far as chess programs are concerned. One typically wants the number of threads used for searching to equal the number of physical cores.
Why?
HT actually works. Of course 4 threads on 2 real cores × HT ... will be faster than 2 threads on 2 real cores without HT.
There has been considerable disagreement about this. I'll leave further discussion for experts.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: Processor Cores

Post by syzygy »

jsgroby wrote:
syzygy wrote:A logical core is not a physical processor core.

If your OS is not broken, then you have two physical cores. With an i7 this seems only possible if it is a relatively old (2010) mobile "Arrandale" cpu. However these do not go faster than 2.66 Ghz (maybe turboboost can make them reach 3.0 Ghz, I am not sure).
Processor Intel Core i5 or Core i7 (3230M, 3540M) ("Ivy Bridge")
Processor Speed 2.6 GHz (Core i5) or 3.0 GHz (Core i7)
Oops, I looked at a table that only listed the Nehalem i7 processors... I should have realised it was incomplete.

So your laptop has the IvyBridge i7-3540M mobile processor which indeed has 2 physical cores (2x2 logical cores) and a base frequency of 3.0 Ghz.

http://ark.intel.com/products/71255
User avatar
jsgroby
Posts: 83
Joined: Mon Mar 24, 2014 12:26 am
Location: Glen Carbon, IL USA

Re: Processor Cores

Post by jsgroby »

syzygy wrote:
jsgroby wrote:
syzygy wrote:A logical core is not a physical processor core.

If your OS is not broken, then you have two physical cores. With an i7 this seems only possible if it is a relatively old (2010) mobile "Arrandale" cpu. However these do not go faster than 2.66 Ghz (maybe turboboost can make them reach 3.0 Ghz, I am not sure).
Processor Intel Core i5 or Core i7 (3230M, 3540M) ("Ivy Bridge")
Processor Speed 2.6 GHz (Core i5) or 3.0 GHz (Core i7)
Oops, I looked at a table that only listed the Nehalem i7 processors... I should have realised it was incomplete.

So your laptop has the IvyBridge i7-3540M mobile processor which indeed has 2 physical cores (2x2 logical cores) and a base frequency of 3.0 Ghz.

http://ark.intel.com/products/71255
Thanks. I have bookmarked that site for future reference. I was worried there that I had some corruption in my Operating System.

Jeff