Parallel iterative search function

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Parallel iterative search function

Post by bob »

Fabio Gobbato wrote:Thank you, I'll try it
It is painful, but the benefits are there for improved performance. But you sure do give up the clean negamax recursive code. That's why I have not yet done this. I still think there is more to be had from the recursive approaches, although DTS will always have an advantage. I am not just sure how big this advantage will always be. Current Crafty certainly narrows the gap a bit, anyway.
User avatar
Fabio Gobbato
Posts: 217
Joined: Fri Apr 11, 2014 10:45 am
Full name: Fabio Gobbato

Re: Parallel iterative search function

Post by Fabio Gobbato »

I think that I will keep a similar code to the recursive search, but with the stack that I can access directly and then step by step I will try some optimizations adapting the code to the iterative algorithm.
I try it, if it's too painful I have always the recursive version.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Parallel iterative search function

Post by bob »

Fabio Gobbato wrote:I think that I will keep a similar code to the recursive search, but with the stack that I can access directly and then step by step I will try some optimizations adapting the code to the iterative algorithm.
I try it, if it's too painful I have always the recursive version.
It won't work with a recursive search. DTS depends on the idea that thread 1 can split with 2, 3, ..., N at some node, and whichever thread is last to finish will complete that node and back up to the previous ply. A recursive search has a call stack that would break here.
User avatar
Fabio Gobbato
Posts: 217
Joined: Fri Apr 11, 2014 10:45 am
Full name: Fabio Gobbato

Re: Parallel iterative search function

Post by Fabio Gobbato »

It's difficult for me to imagine an iterative search, I have always used the recursive one.
I know the starting point but I don't have in mind the resulting form of the search.
I have had a look to the Scorpio source. Are there other sources that implemets DTS?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Parallel iterative search function

Post by bob »

Fabio Gobbato wrote:It's difficult for me to imagine an iterative search, I have always used the recursive one.
I know the starting point but I don't have in mind the resulting form of the search.
I have had a look to the Scorpio source. Are there other sources that implemets DTS?
If you can read FORTRAN, the source for Cray Blitz (a fairly old version of DTS and such as the program is the 1989 version I believe). But it has an iterated search and does DTS so it will get you started in the right direction.
User avatar
Fabio Gobbato
Posts: 217
Joined: Fri Apr 11, 2014 10:45 am
Full name: Fabio Gobbato

Re: Parallel iterative search function

Post by Fabio Gobbato »

It could help. It's very kind of you.
User avatar
Fabio Gobbato
Posts: 217
Joined: Fri Apr 11, 2014 10:45 am
Full name: Fabio Gobbato

Re: Parallel iterative search function

Post by Fabio Gobbato »

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Parallel iterative search function

Post by bob »

I am afraid to say yes or no.

It is certainly available on my web page.

www.cis.uab.edu/hyatt/crafty/crayblitz

Note that this program certainly works, but the parallel part does not. It depended on something called "task common" in Cray's fortran language, which is a local common block that is duplicated for each thread...

It compiled and ran (without threads) the last time I tried it on the gnu f77 compiler.