Multithreaded movepath enumeration (perft)
Posted: Fri Feb 27, 2009 3:06 pm
For program testing and benchmarking purposes, I wrote a simpleminded multithreaded movepath enumerator. It works by launching a separate counting thread for each move in the root position and then summing the results.
All threads start at the same time, but they finish at different times because of the differences in move counts for each initial move. Each thread has its own transposition table, so there's no data sharing that would improve the overall speed.
Here's the trace for the five hour run of perft(10) = 69,352,859,712,417 on a 2.66 GHz quad core Mac Pro:
All threads start at the same time, but they finish at different times because of the differences in move counts for each initial move. Each thread has its own transposition table, so there's no data sharing that would improve the overall speed.
Here's the trace for the five hour run of perft(10) = 69,352,859,712,417 on a 2.66 GHz quad core Mac Pro:
Code: Select all
Starting: Na3
Starting: Nc3
Starting: Nf3
Starting: Nh3
Starting: a3
Starting: a4
Starting: b3
Starting: b4
Starting: c3
Starting: c4
Starting: d3
Starting: d4
Starting: e3
Starting: e4
Starting: f3
Starting: f4
Starting: g3
Starting: g4
Starting: h3
Starting: h4
Finishing: f3 1945020011164
Finishing: a3 2149477156227
Finishing: h3 2142832044687
Finishing: f4 2418056589775
Finishing: Na3 2440848135252
Finishing: Nh3 2470483499345
Finishing: g4 2624128147144
Finishing: b3 2774842822463
Finishing: b4 2772533545113
Finishing: g3 2853630724145
Finishing: a4 2905552970419
Finishing: Nf3 3090773583680
Finishing: h4 2948003834105
Finishing: Nc3 3096505857746
Finishing: c3 3072577495123
Finishing: c4 3437747391692
Finishing: d3 5071006040569
Finishing: d4 6459463242656
Finishing: e3 7299373354878
Finishing: e4 7380003266234
count: 69352859712417
Done
real 302m27.128s
user 1101m13.876s
sys 2m33.075s