Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to program search timeout ?

Author: Bruce Moreland

Date: 19:56:56 02/04/98

Go up one level in this thread



On February 04, 1998 at 20:08:16, Stuart Cracraft wrote:

>In my program, timeout is handled in one basic place:
>after searching all moves at the current ply, a check is performed:
>
>if (SearchDepth == 0 && NodeCnt % TIMECHECK == 0)
>{
>   GetElapsed ();
>   if ( (et >= targettime && !(rootscore - lastrootscore <= -25)) ||
>        et >= maxtime)
>    SET (flags, TIMEOUT);
>}
>
>I do not use signal() to interrupt the search, available on Unix and
>PC's.
>My tests showed the mere inclusion of this reduced my move
>generator speed (and possibly other program speed) by double-digit
>factors due to continual wakeups. Besides, not knowing where you
>are in the search messes things up.

The modulo operation is really nasty unless TIMECHECK is a power of two.

Also, using an "int" or an "unsigned" NodeCnt can make a difference.

In fact, modulo sucks in general because you have to trust the compiler
to do strength reduction or whatever it is it has to do in order to get
rid of the division instruction that it would normally do.

A better idea would be to say:



bruce



This page took 0.01 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.