Setting Hash value Issue

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

whittenizer
Posts: 85
Joined: Sun May 29, 2011 11:56 pm
Location: San Diego

Setting Hash value Issue

Post by whittenizer »

Hi again,

My silverlight project is really coming along thanks to all of you. I understand about the movetime and depth alot better now. Anyways, I read somewhere that one should try to set the hash value as high as possible, typically half of the total amount of memory onboard. I happen to have 6GB ram so I decided to set it at 2048, not quite half.

Now, I'm running a WCF service and calls are going back and forth. What happens I send a command to the WCF service from my app. Calculations are made on the server, and then a move is sent back. Obviously this can take some time depending on the movetime, etc. If I dont get a response back from the WCF service within the timeout settings I've have in place, I get the error I'm seeing now. The thing is I only have the movetime set at 20000. My timeout for the WCF servoce are set at 1 minute, so 60000. I don't think I should get the timeout but the high hash setting is messing something up. If I set the hash down to 1024, it doesn't timeout. This whole scenerio doesnt happen in a GUI like arena or even running the engine as a console app. It's obviously something I'm doing. At a high level, does setting higher hash levels increase the calculating time then? Please understand I'm not too familiar with C++. I could try to dig in and try to see how the hash is used.

Then again, I may need to look at my WCF service as well. Just trying to get ideas here.

Thanks,

David
smatovic
Posts: 2645
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Setting Hash value Issue

Post by smatovic »

so I decided to set it at 2048, not quite half.
There are a couple of limitations with memory allocation above 2 GB, try to set it a bit lower, 2000 MB for example.

--
Srdja
whittenizer
Posts: 85
Joined: Sun May 29, 2011 11:56 pm
Location: San Diego

Re: Setting Hash value Issue

Post by whittenizer »

Interesting. I did mention that I set it to 1024 with no issues so I guess that should do it. I'll try to get as close to 2000 to see how it behaves.

It's funny though I can run it at 2048 as a console app, and via Arena, but via my app, it times out. It has to be something with my WCF service, just don't know what it might be.

Anyways, I'll try to stay between 1024 and 2000.

Thanks much for the reply.

David
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Setting Hash value Issue

Post by sje »

1) Use whatever system monitor is resent on your machine to detect when paging is occurring during the operation of your chess program. If the program is causing any page faults because it's using too much memory, cut its memory allocation.

2) Once you see what percentage of available memory can be used without paging, divide this number in half and set that as the program's nominal upper bound allocation. Why one half? Because you want to be able to run two programs at once without them stepping on each other in a page war.

3) Instead of hard coding a fixed memory length request, have our program first detect how much physical RAM is present and then use only the appropriate percentage. Choose the percentage conservatively so the scheme works well on target hosts with different amounts of physical RAM.
whittenizer
Posts: 85
Joined: Sun May 29, 2011 11:56 pm
Location: San Diego

Re: Setting Hash value Issue

Post by whittenizer »

Very good explaination. I'll do just this then.

Thanks much,

David