Hi,
I've been trying to implement parallel search(multithread), unfortunately, I cannot imagine how to do it together with handling hashtable and PV lines. Are there any simple source codes or recommended reading papers on this?
Any help is appreciated.
Teerapong
Parallel search, Where to start?
Moderators: hgm, Rebel, chrisw
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Parallel search, Where to start?
For the main transposition table, I add a vector of 256 spinlocks each of which guard a piece of the main table. This allows safe and efficient multithreaded sharing in a portable fashion and independently of the structure of a transposition table element.
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Parallel search, Where to start?
A PV is grown from the bottom up and is set whenever a ply zero (root) move is established as the best root move so far. If more than one thread is operating at ply zero, then the new-best-root-move routine needs a mutex to guard the compare and replace operation which assigns a new PV.
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Parallel search, Where to start?
There's a paper on the Cray Blitz DTS algorithm on the cis.uab.edu web page under faculty/ my home page link... It might be a bit more complex than what you want to read to get started, however...Chang wrote:Hi,
I've been trying to implement parallel search(multithread), unfortunately, I cannot imagine how to do it together with handling hashtable and PV lines. Are there any simple source codes or recommended reading papers on this?
Any help is appreciated.
Teerapong
-
- Posts: 1221
- Joined: Wed Mar 08, 2006 8:28 pm
- Location: Florida, USA
Re: Parallel search, Where to start?
Take a look at Viper Chess by Tord:
http://www.glaurungchess.com/viper/
It's less than 5k lines and includes parallel code.
Hope this helps,
Steve
http://www.glaurungchess.com/viper/
It's less than 5k lines and includes parallel code.
Hope this helps,
Steve
-
- Posts: 98
- Joined: Sat Jul 31, 2010 8:48 pm
- Full name: Ubaldo Andrea Farina
Re: Parallel search, Where to start?
Parallel Alpha-Beta Search on Shared Memory Multiprocessors by Valavan Manohararajah
For the hash table, you could take a look at Dr. Hyatt's xoring method for lockless hashing: http://www.cis.uab.edu/hyatt/hashing.html
For the hash table, you could take a look at Dr. Hyatt's xoring method for lockless hashing: http://www.cis.uab.edu/hyatt/hashing.html
-
- Posts: 482
- Joined: Thu Oct 16, 2008 4:23 am
- Location: Milky Way
Re: Parallel search, Where to start?
Hi,Chang wrote:Hi,
I've been trying to implement parallel search(multithread), unfortunately, I cannot imagine how to do it together with handling hashtable and PV lines. Are there any simple source codes or recommended reading papers on this?
Any help is appreciated.
Teerapong
This is a very helpful thread covering the topic:
http://www.talkchess.com/forum/viewtopi ... ce911e37dc
The basics on chessprogramming wiki:
http://chessprogramming.wikispaces.com/Parallel+Search
I have implemented a sort of Younger Brothers Wait approach in my open source engine. It took only a few lines of code to get it done. Although it was VERY time-consuming rewriting and testing the code to do it right.
http://sourceforge.net/projects/redqueenchess/
PS: I would suggest you not going for SMP if you still haven't a stable and working chess engine.
Ben-Hur Carlos Langoni Junior
http://sourceforge.net/projects/redqueenchess/
http://sourceforge.net/projects/redqueenchess/