Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to do my perft faster without 2 exe files and without doing movei

Author: Uri Blass

Date: 07:41:28 12/25/02

Go up one level in this thread


On December 25, 2002 at 10:12:02, Dieter Buerssner wrote:

>On December 25, 2002 at 09:53:09, Uri Blass wrote:
>
>>I can add that I found a simple way to do it.
>>I added to my defines
>>#define game 1
>>and I added
>>#if game==1
>>#endif
>>to my code.
>>
>>now the default option is not the fastest in calculating poerft and if I want to
>>calculate perft fast not for debugging my program I need only to change one
>>line(changing #define game 1 to #define game 0.
>>
>>The problem is that a user that does not know the source code and want to
>>calculate perft fast cannot do it.
>>
>>I guess that adding the #define does not do the program slower but I do not know
>>enough about computers to know so please tell me if it does.
>
>Your guess is correct.
>
>There are other ways, but not so convenient. Without seeing, how, where and how
>often you access those scores, it is difficult to come up with a concrete good
>suggestion.

I use scores for order of moves only in gen_push and in gen_promote and in
another file the laphabeta and the move generator are in different files.

>
>One idea would be, using some preprocessor tricks. Put the body of the
>movegenerator into a file movegen.h
>
>So, when it looks now like:
>
>type movegen(/*paramterlist*/)
>{
>   /* do all sort of things here */
>   /* And perhaps at several places */
>   move_listp->score = some calculation;
>  /* */
>}

I have no type in my program
my move generator has mainly 3 functions
void gen()
void makemove(move_bytes m)
void undomove()

Do you write tyope when you do not know if to write void or int
or anaother varaible that the function may return?
>
>Put the following into movegen.h:
>
>{
>   /* do all sort of things here */
>   /* And perhaps at several places */
>   ASSIGN_MOVE_SCORE;
>  /* */
>}

so you say first step to copy the releavent part to .h file and second part to
delete the calculation and add ASSIGN_MOVE_SCORE that may be nothing when I
calculate perft?
>
>
>Now, for your normal movegenerator, say in movegen.c write the following
>
>#define ASSIGN_MOVE_SCORE    move_listp->score = some calculation
>type movegen(/*paramterlist*/)
>#include "movegen.h"

so you say that I delete everything except calculation in the .c file?
>
>/* And somewhere later */
>#undef ASSIGN_MOVE_SCORE
>#define ASSIGN_MOVE_SCORE /* Ignore compiler warning "empty statement" */
>
>type movegen_for_perft(/*paramterlist*/)
>#include "movegen.h"

Do you say to have twice include "movegen.h" in the same file?

Uri



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.