Robert Purves
Joined: 15 Feb 2010 Posts: 155 Location: New Zealand
|
Post subject: First steps with SMP Posted: Wed Nov 30, 2011 3:02 am |
|
|
I have just implemented the first step of multi-threading my engine. It can search on the main thread and a parallel one simultaneously, each returning the same score and PV without crashing. Node count at any depth is exactly doubled by the extra thread. (All this is of course with the shared TT off).
Now I want to implement some form of YBW. Knowing little of the theory, I head for CPW and quickly find some fascinating pseudocode for the Jamboree algorithm:
http://chessprogramming.wikispaces.com/Jamboree
I understand the pseudocode in part, but am puzzled by the return values in two places (these are inside the parallel section):
| Code: |
s = -jamboree(c[i], -α - 1, -α);
if (s >= β) abort_and_return b;
...
s = -jamboree(c[i], -β, -α);
if (s >= β) abort_and_return b; |
I expected to see s returned, the same as in single-threaded search.
Is there a subtle issue with multithreading that makes b the correct return value, or is there a bug in the pseudocode?
Robert P. |
|