Technical question about the Core 2 Duo and Mac OS X

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: Technical question about the Core 2 Duo and Mac OS X

Post by bob »

diep wrote:
Tord Romstad wrote:
hgm wrote:This estimate is for the same (32-bit) binary. For 64-bit you get an extra acceleration, which of course strongly depends on how much 64-bit arithmetic you do compared to 32-bit stuff. For the 64-bit stuff itself it could be more than a factor 2.
Thanks, that sounds a lot better! Apparently my program gains about 30% when moving from 32-bit to 64-bit, so based on your numbers I can expect a total speedup of around 1.08 x 1.2 x 1.3 = 1.6848 when going from the 2 GHz Core Duo to the 2.16 GHz Core 2 Duo. Not bad.

Tord
OS/X 64 bits has the gcc 4.0.1 inside it's notorious crappy beginners x-code compiler for os/x 10.4.9, which is the latest version currently.

That is a joke of a compiler for good chips like K8 and Core2.

There goes 30% performance...

GCC is especially bad for 64 bits code optimizations. Don't compare yourself to crafty; crafty is open source, they all managed to optimize a tad for crafty. If you're using a bit different datastructure, then 64 bits goes very bad.

In my case, some sample programs in 64 bits were 50% faster with visual c++ net2005 with pgo than latest gcc with pgo. That was tested at opteron. At core2 it's even worse.

GCC is very ugly bad there, especially if you prefer generic code rather than program out very tiny thing.

Especially try to avoid the 128 bits defines that GCC offers, a nice idea it is, but it is so so ugly bad in optimizing them.

At core2 laptops pgo from visual c++ net2005 gives diep 20+% speedup, versus 11.3% for AMD-k8. GCC again is at the wrong side there of the medal.

Vincent

p.s. about OS/X:

OS/X needs better debuggers, a better source code editor, such as multiedit is a great one for windoze, and they need to trash all their stupid mouses and keyboards, especially that 1-button mouse is a joke now that 99% of planet is used to rightbutton click a lot with mouse, besides that their 1 button mouses are causing a bunchlot of RSI problems more than normal mouses do, and resizing windows is a disaster as you need each time move your mouse to the right bottom corner instead that on every edge of the window you can resize. In GENERAL users always have their mouse a bit left in windows anyway, so resizing in the right bottom corner doesn't make sense anyway.

Also gcc 4.0.1 is just too much of a joke for such nice processors, and it is beyond any help of improvement.

And for all that you pay 30% more than PC equivalents.

Only take that macbookpro i'd say if you get it for free.
Most of that is bogus. If you want, I can post some intel C++ numbers compared to gcc numbers using my suse 10.2 system (64 bit). Intel's compiler is better, but it isn't 30% better. I can also post some MSVC numbers as well, at least on my core-2 laptop.

Also nobody optimizes just for my data structures. They have changed too much since the SPEC benchmark was published. I don't even use rotated bitboards any longer, so that argument is simply invalid.
wgarvin
Posts: 838
Joined: Thu Jul 05, 2007 5:03 pm
Location: British Columbia, Canada

Re: Technical question about the Core 2 Duo and Mac OS X

Post by wgarvin »

I haven't tried it lately, but I think a more realistic assessment of the code produced by Intel's compiler might be, 5% faster than MSVC (and 5-10% larger code size).
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Technical question about the Core 2 Duo and Mac OS X

Post by bob »

wgarvin wrote:I haven't tried it lately, but I think a more realistic assessment of the code produced by Intel's compiler might be, 5% faster than MSVC (and 5-10% larger code size).
I've never found ICC to be faster than MSVC. It has always been "fairly close". Gcc has generally lagged behind MSVC by 30% or so depending on the versions compared, but I've not seen it worse than that for anything I have done, and usually it is not that bad...
ed

Re: Technical question about the Core 2 Duo and Mac OS X

Post by ed »

hgm wrote:I have a Core 2 Duo now, (2.4GHz E6600), and I could run a benchmark for you if you want me to.
I am planning to buy this one after reading the many encomiastic reviews, I have some questions though.

1) Does the standard cooler suffice or do you recommend another one?

2) If I make the choice for the Q6600 (quad) can you run 4 separate programs in each core?

3) Which compiler and OS should one use to create a deep version?

4) Where did you buy it, the store I usually get my stuff advertices here:

http://www.comflex.nl/shop/productimages/STUNT1_2.jpg

Ed
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Gerd Isenberg »

Hi Ed,

good choice! I am still a newbie in this field as well - i will give it a try to answer your questions.

1) No exact idea about the cooler. For computer chess, where almost all cores are running 100%, it might not be wrong to use some oversized devices.

2) The (multi processor) OS assigns all threads of all running processes to processors (cores). If you have four chess programs running, one working thread each, (IO-threads are not cpu intensive) each program will likely get one core for almost 100%. But it is not guaranteed that it always the same core after context switching (by the OS process/thread-scheduler), with the drawback of more memory cache misses - unless you explicitly set thread- or process affinity. http://msdn2.microsoft.com/en-us/library/ms684251.aspx

3) A matter of taste and money. You may use 64-bit Linux, Mac-OS or W64 as OS. For Linux (MacOS) there is GCC as well as the (free!) Intel C compiler. For W64 you may try the free express edition of the ms visual studio compiler. Otherwise you need to spend some bucks for the professional edition (profile guided optimization) or the (not free) intel compiler. See Agner Fog's excellent paper on os and compiler calling conventions:
http://www.agner.org/optimize/
http://www.agner.org/optimize/calling_conventions.pdf

4) no idea - i almost buy my hardware stuff (Shuttle boxes) over the internet.

I prefer to wait a few months for the AMD K10 though - since my new program relies heavily on fast SSE2/3 instructions ;-)

Cheers,
Gerd
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Technical question about the Core 2 Duo and Mac OS X

Post by hgm »

ed wrote:
hgm wrote:I have a Core 2 Duo now, (2.4GHz E6600), and I could run a benchmark for you if you want me to.
I am planning to buy this one after reading the many encomiastic reviews, I have some questions though.

1) Does the standard cooler suffice or do you recommend another one?

2) If I make the choice for the Q6600 (quad) can you run 4 separate programs in each core?

3) Which compiler and OS should one use to create a deep version?

4) Where did you buy it, the store I usually get my stuff advertices here:

http://www.comflex.nl/shop/productimages/STUNT1_2.jpg

Ed
I am afraid I don't have too many answers for you.

I just bought a standard machine, and never opened the encasing. As it was a cheap macine, it is a safe bet that it also contains a cheap cooler, but I never noticed any problems. I am using both cores 100% almost all the time (playing two engine-engine matches simultaneously). But I don't overclock either.

I don't know about quads. I also have no SMP engines.

I bought it at Mycom (www.mycom.nl) for €749, but it seems no longer in their catalogue. They now have a machine with Q6600 in stead for €799, which I suspect is the same machine with an upgraded CPU

I never bothered to try any other platform than gcc under cygwin. In my experience the speed difference between different compiles (e.g. after minor changes) with the same compiler is already a lot larger than the systematic difference between compilers. And even that is completely swamped by the factors 2 to 3 you gain or lose by proper (i.e. cache-friendly) memory allocation. As most compilers don't seem to pay any attention to that, any performance difference is sheer luck more than anything else.
frankp
Posts: 228
Joined: Sun Mar 12, 2006 3:11 pm

Re: Technical question about the Core 2 Duo and Mac OS X

Post by frankp »

ed wrote:
hgm wrote:I have a Core 2 Duo now, (2.4GHz E6600), and I could run a benchmark for you if you want me to.
I am planning to buy this one after reading the many encomiastic reviews, I have some questions though.

1) Does the standard cooler suffice or do you recommend another one?

2) If I make the choice for the Q6600 (quad) can you run 4 separate programs in each core?

3) Which compiler and OS should one use to create a deep version?

4) Where did you buy it, the store I usually get my stuff advertices here:

http://www.comflex.nl/shop/productimages/STUNT1_2.jpg

Ed
1) Bought my machine (AMDx2 3.GHz) a few months ago so missed out on the cheap quad. I buy parts and assemble them myself. But get a retail cpu with supplied cooler and 3 year guarantee. Just run mersene -t, one instance for each core. If it is still showing no errors after a day or so conclude it is ok, otherwise return. Never had a problem with the stock coolers.
3) Linux of course. Then I can use your program again. Long time since the MMIV (?)
User avatar
Eelco de Groot
Posts: 4561
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Eelco de Groot »

Timothy's new mean machine is also looking good, if you don't want to do any overclocking. It is a dual so four programs at the same time would probably not run as fast as on a quad, but scaling for two threads I suppose might turn out better on this new E6850 compared to a non overclocked Q6600 with four threads. The faster FSB bus probably has very little effect for a chessprogram or most other programs than videogaming, the only other difference beside a higher clockfrequency is the G0 stepping for the E models.

Overclocking to 3 GHz I think is also possible on Q6600 but certainly when running any chessprogramtesting you would probably want extra cooling of the processor. Usually they have watercooling in place.

Fritzmarks on E6850:
Image

According to the Fritzmark page a Q6600 with watercooling can go to 3.6 GHz.

http://www.jens.tauchclub-krems.at/dive ... marks.html

Eelco
ed

Re: Technical question about the Core 2 Duo and Mac OS X

Post by ed »

Eelco de Groot wrote:Fritzmarks on E6850:
Image
According to the Fritzmark page a Q6600 with watercooling can go to 3.6 GHz
That's a nice answer Eelco, thx.

Tempting that Q6600 8-)

Ed
ed

Re: Technical question about the Core 2 Duo and Mac OS X

Post by ed »

Hi Gerd,

Thx for the info & links. Where can I find the instruction set *with* cycle timing? It would be fun to make use of the extra registers of nowadays 64 bit processors.
Gerd Isenberg wrote:3) A matter of taste and money. You may use 64-bit Linux, Mac-OS or W64 as OS. For Linux (MacOS) there is GCC as well as the (free!) Intel C compiler. For W64 you may try the free express edition of the ms visual studio compiler.
I am trying the free MSVC-2005 right now. As a first try and sniff experiment I have got the compile of Gideon Professional (1993!) now without errors but the debug version plays 1.e4 with a score of -0.89 and the release version crashes :wink: so something more needs to be done than fixing compiler (compatibility) errors alone.

I still must decide whether to translate my latest version back from ASM to C++ or convert my 32-bit ASM spaghetti code to 64-bit code to make advantage of the extra registers but somehow I have the feeling leaving the whole optimization to the compiler turns out better (faster).
Gerd Isenberg wrote:I prefer to wait a few months for the AMD K10 though - since my new program relies heavily on fast SSE2/3 instructions ;-)
hehehe

Ed