Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: G5 crafty - problem solved

Author: Frank E. Oldham

Date: 13:22:42 07/16/04

Go up one level in this thread


On July 16, 2004 at 04:13:06, Andreas Guettinger wrote:

>On July 15, 2004 at 19:22:00, Frank E. Oldham wrote:
>
>>On July 15, 2004 at 17:29:31, Andreas Guettinger wrote:
>>
>>>Bevor I send Prof. Hyatt the files of the modified crafty19.15, could somebody
>>>(maybe Frank) please test if this package compiles out of the box on a dual G5
>>>by typing 'make darwin64' using 1 or 2 CPUs.
>>>
>>>http://home.datacomm.ch/aguettinger/files/crafty-19.15ppc.tar.gz
>>>
>>>And could he post the results for bench.
>>>
>>>Many thanks in advance.
>>>Andy
>>>
>>>
>>>PS: I choose -fast for G5 optimizations, because it looks nicer in a makefile
>>>than
>>>-mcpu=G5  -mtune=G5 -mpowerpc64 -ffast-math    \
>>>-fstrict-aliasing -fsched-interblock    \
>>>-falign-loops=16 -falign-jumps=16 -falign-labels=16 -falign-functions=16
>>>-malign-natural  \
>>>-fomit-frame-pointer -fasm-blocks'
>>
>>Hi Andreas,
>>mixed news I'mm afraid --
>>Here's the compilation & test results:
>>
>>~/Desktop/crafty-19.15 $ make darwinG5
>>make target=DARWIN \
>>        CC=gcc CXX=g++ \
>>        CFLAGS=' -Wall -pipe -O3 -fast' \
>>        CXFLAGS= \
>>        LDFLAGS=' -lpthread' \
>>        LIBS='-lstdc++' \
>>        opt=' -DFUTILITY -DSMP -DMUTEX -DPOSIX -DCPUS=2 -DINLINE_PPC -DPPC64
>>-DFAST' \
>>        crafty-make
>>gcc -Wall -pipe -O3 -fast -DFUTILITY -DSMP -DMUTEX -DPOSIX -DCPUS=2 -DINLINE_PPC
>>-DPPC64 -DFAST -DDARWIN -c crafty.c
>>In file included from crafty.c:40:
>>option.c: In function `Option':
>>option.c:3067: warning: dereferencing type-punned pointer will break
>>strict-aliasing rules
>>option.c:3569: warning: dereferencing type-punned pointer will break
>>strict-aliasing rules
>>
>>g++ -c  -DFUTILITY -DSMP -DMUTEX -DPOSIX -DCPUS=2 -DINLINE_PPC -DPPC64 -DFAST
>>-DDARWIN egtb.cpp
>>egtb.cpp:4496: warning: `TB_CRC_CHECK' initialized and declared `extern'
>>gcc -lpthread -o crafty crafty.o egtb.o -lm  -lstdc++
>>
>>~/Desktop/crafty-19.15 $ ./crafty
>>unable to open book file [./book.bin].
>>book is disabled
>>unable to open book file [./books.bin].
>>
>>Crafty v19.15 (1 cpus)
>>
>>White(1): bench
>>Running benchmark. . .
>>.ERROR, not installing bogus move at ply=2
>>not installing from=47  to=38  piece=1
>>.^C
>>~/Desktop/crafty-19.15 $ ./crafty
>>unable to open book file [./book.bin].
>>book is disabled
>>unable to open book file [./books.bin].
>>
>>Crafty v19.15 (1 cpus)
>>
>>White(1): perft 5
>>total moves=4865609  time=0.63
>>White(1): perft 6
>>^C
>>
>>~/Desktop/crafty-19.15 $ ./crafty
>>unable to open book file [./book.bin].
>>book is disabled
>>unable to open book file [./books.bin].
>>
>>Crafty v19.15 (1 cpus)
>>
>>White(1): mt=2
>>max threads set to 2
>>White(1): bench
>>Running benchmark. . .
>>.ERROR, not installing bogus move at ply=2
>>not installing from=54  to=53  piece=6
>>^C
>>
>>Compilation was clean, but seemed to spend a long time being optimized....
>>bench is having some board initialization probs...
>>Perft 5 is correct, but Perft 6 didn't complete
>>
>>Frank
>
>
>Thanks for testing. Difficult to say what went wrong. Could you try other
>compiler optimizations (the ones you used before). Also try leaving away
>-DINLINE_PPC, then the original functions are used for FirstOne() LastOne(),
>which would mean something is wrong in the inlineppc.h.
>
>Thanks
>Andy

Congrats Andy -- you've solved the "gcc won't inline" problem !
I recalled last night that I'd seen similar bad init complaints from crafty when
I had previously tried -fast as an option -- so I removed it, going back to my
"ugly" explicit option list ... and the problem disappeared -- moreover, bench
speed looks good too!  You should make a separate "crafty bench" post to give
the results to the group.  :-)
I'm expecting the 2.5GHz to break 3.1Mnps on crafty bench -- when the local
Apple store gets one in I'll try to bench crafty there.

~/Desktop/crafty-19.15 $ make darwinG5
make target=DARWIN \
        CC=gcc CXX=g++ \
        CFLAGS=' -O3 -Wall -g -Winline \
                -mcpu=G5  -mtune=G5 -mpowerpc64 -ffast-math \
                -D_REENTRANT -DEPD \
                -fstrict-aliasing -fsched-interblock \
                -falign-loops=16 -falign-jumps=16 -falign-labels=16
-falign-functions=16 -malign-natural  \
                -fomit-frame-pointer -fasm-blocks' \
        CXFLAGS= \
        LDFLAGS=' -lpthread' \
        LIBS='-lstdc++' \
        opt=' -DFUTILITY -DSMP -DMUTEX -DPOSIX -DCPUS=2 -DINLINE_PPC -DPPC64
-DFAST' \
        crafty-make
gcc -O3 -Wall -g -Winline               -mcpu=G5  -mtune=G5 -mpowerpc64
-ffast-math            -D_REENTRANT -DEPD              -fstrict-aliasing
-fsched-interblock           -falign-loops=16 -falign-jumps=16 -falign-labels=16
-falign-functions=16 -malign-natural               -fomit-frame-pointer
-fasm-blocks -DFUTILITY -DSMP -DMUTEX -DPOSIX -DCPUS=2 -DINLINE_PPC -DPPC64
-DFAST -DDARWIN -c crafty.c
In file included from crafty.c:40:
option.c: In function `Option':
option.c:3067: warning: dereferencing type-punned pointer will break
strict-aliasing rules
option.c:3569: warning: dereferencing type-punned pointer will break
strict-aliasing rules
gcc -lpthread -o crafty crafty.o egtb.o -lm  -lstdc++

~/Desktop/crafty-19.15 $ ./crafty
EPD Kit revision date: 1996.04.21
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].

Crafty v19.15 (1 cpus)

White(1): bench
Running benchmark. . .
......
Total nodes: 72361168
Raw nodes per second: 1269494
Total elapsed time: 57
SMP time-to-ply measurement: 11.228070
White(1): q

~/Desktop/crafty-19.15 $ ./crafty
EPD Kit revision date: 1996.04.21
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].

Crafty v19.15 (1 cpus)

White(1): mt=2
max threads set to 2
White(1): bench
Running benchmark. . .
......
Total nodes: 93223607
Raw nodes per second: 2519556
Total elapsed time: 37
SMP time-to-ply measurement: 17.297297
White(1): q

Frank



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.