Author: Stuart Cracraft
Date: 08:32:53 08/15/04
Go up one level in this thread
On August 15, 2004 at 11:00:53, Uri Blass wrote:
>On August 15, 2004 at 10:27:04, Stuart Cracraft wrote:
>
>>On August 15, 2004 at 08:44:53, Uri Blass wrote:
>>
>>>I tried movei with 3 options of printing the pv
>>>
>>>1)printing the pv only when I have a new pv of more than one move or at the end
>>>of the iteraion(no priniting fail low fail high at the time that they happen)
>>>
>>>2)printing pv of one move also when I get fail high but not in case of fail high
>>>of the root move.
>>>
>>>3)printing pv of a single ply also when I get fail high or fail low at the root.
>>>
>>>Note that I used visual C++6 and I did not use profile based optimization.
>>>
>>>I tried the opening position more than one time on my A1000 in console mode(I
>>>tried it more than one time to exclude the possibility of random changes that
>>>are not dependent on the program.
>>>
>>>Here are my result of analysis of the opening position:
>>>
>>>You can see that there is a slow down of more than 3% from printing the pv more
>>>often if I compare case 1 with case 3 and changes from running the program at
>>>different times do not seem to be significant.
>>>
>>>
>>>I know that 3% is not much but I do not like to see the program becomes slower
>>>only because of adding some output when the function that calculates the output
>>>are called rarely.
>>>
>>>My question is if this problem usually disappear with profile based
>>>optimizations(printf is not used often).
>>>
>>>
>>>Here is the relevant data(Movei did not change it's mind after having a pv for
>>>e4 at depth 11 so the part of the analysis after the pv with e2e4 is the same in
>>>both 3 cases and I only show that part with times for comparison)
>>>
>>>times are given in centiseconds in the 3th field so in the first case in the
>>>first try to run the program the times are 44.37,46.74 100.34 137.34 seconds
>>>
>>>Case 1:
>>>try 1
>>>11 25 4437 7473000 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>11 25 4674 7856781 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>
>>>12 16 10034 17434134 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>12 16 13734 23713358 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>
>>>try 2
>>>11 25 4443 7473000 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>11 25 4680 7856781 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>12 16 10041 17434134 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>12 16 13740 23713358 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>
>>>try 3(was done only later after all the tries of other cases)
>>>
>>>11 25 4438 7473000 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>11 25 4675 7856781 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>12 16 10034 17434134 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>12 16 13731 23713358 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>
>>>Case 2:
>>>
>>>try 1
>>>
>>>11 25 4493 7473000 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>11 25 4733 7856781 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>12 16 10160 17434134 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>12 16 13905 23713358 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>
>>>try 2
>>>
>>>11 25 4491 7473000 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>11 25 4731 7856781 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>12 16 10184 17434134 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>12 16 13929 23713358 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>
>>>Case 3:
>>>
>>>try 1
>>>11 25 4581 7473000 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>11 25 4827 7856781 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>12 16 10379 17434134 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>12 16 14215 23713358 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>
>>>try 2
>>>
>>>11 25 4580 7473000 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>11 25 4825 7856781 e2e4 d7d5 e4d5 d8d5 b1c3 d5e6 g1e2 b8a6 d2d3 c8d7 c1e3 g8f6
>>>12 16 10377 17434134 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>12 16 14212 23713358 e2e4 e7e5 b1c3 b8c6 g1f3 g8f6 d2d4 e5d4 f3d4 f8c5 d4c6 b7c
>>>6
>>>
>>>Uri
>>
>>Why do you bother with that method? I walk the pv from the
>>hash table and get very few missed pv's on any iteration
>>for any search and have no slowdown.
>>
>>Passing parameters on stacks or managing diagonal arrays
>>are a waste of precious time and space.
>
>I use triangular array but I do not see what it has to do with it and I did not
>talk about calculating the pv but about priniting the pv.
>I am talking about printing the pv in the screen.
>
>I see no reason that printing the pv more often to give more information should
>do the program slower by some percents.
>
>I like to see every fail high and every fail low of the program in root move at
>the time that it happens but I do not like seeing the program becomes slower.
>
>The default version of movei show fail high and fail low only when they happen
>not in a different move so I cannot see if the first move fail high or fail low.
>
>It used what I called case 2 in my post.
>
>I do not like it and wanted to change it to show me also cases when first root
>move fail high or fail low outside of the aspiration window and it made the
>program slower(see results of case 3).
>
>I later tried to see what happened when I show no fail high or fail low in the
>pv before I solve them and the program again became slightly faster and the
>difference in time is too big to be explained by the time that the program needs
>to do the command printf("...")
>
>Note that I always print pv when I find it and in the end of every iteration and
>I did not try to get rid of it.
>
>Here is an example for printing pv's in the slow way in a different position.
>
>
>1 -91 1 149 e7c7
>2 -121 1 165 e7c7(fail low without getting a final score)
>2 -179 1 229 e7c7 c5e3
>2 -178 1 467 c1e1(fail high without getting a final score)
>2 -149 2 501 c1e1 (fail high again without getting a final score)
>2 -111 2 542 c1e1 a6b6(finding the pv)
>2 -111 2 621 c1e1 a6b6(end of iteration)
>
>
>printing take time but in the cases that I posted it is clear that the
>difference in time cannot be explained by the difference in time of printf and I
>posted only the last lines of the output that are the same in all 3 positions
>because the program never failed high or failed low after finidng the best move
>at iteration 11.
>
>Uri
Okay I hope you do not fflush stdout frequently and I hope that you do
not have unbufferred output set on stdout. Both are expensive.
I did some tests a long time ago outside of chess and was amazed
at the slowdown of a program due to occasional output.
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.