Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Beowulf hot spots shown pictorially

Author: Dann Corbit

Date: 14:08:43 06/21/02

Go up one level in this thread


On June 21, 2002 at 15:45:11, Dieter Buerssner wrote:

>On June 21, 2002 at 15:23:40, Robert Hyatt wrote:
>
>>why not replace that long long module with
>>
>>address = (int) (hash_signature) % table_size
>
>I suggested something similar. I am too lazy to check exactly, but it seems that
>the cast to (signed) int will introduce a bug. Preferably would be a cast to
>unsigned, or even better to size_t (In my suggestion I used unsigned long, which
>will work on compilers with 16bit int and an adress space > 16bit, but those are
>outdated. I still have one and use it now and then ...)
>
>BTW. adress might be a bit misleading, because adress IMHO seems to imply a
>pointer, while it actually is a index/offset/whatever you want to call it.

I tried this:

Changed type of NHash:
unsigned        NHash;

Changed hash index calculation to this:
unsigned       *pHash = (unsigned *) &Hashkey;
unsigned        aHash = pHash[0]^pHash[1];
hashentry = aHash % NHash;

It's a heck of a lot faster and does not seem to introduce any problems.




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.