If the hash table prefers depth, I don't think you have to do much of anything at all, just save the hash to disk every hour and reload the hash table on startup. If it does not, a tiny second auxiliary hash table which never overwrites a deeper entry will do the job. Essentially you just want to save the first N levels of the tree, where N may just be 3 or 4 or whatever you consider easily manageable.
There are more complicated schemes but this can be implemented in 10 minutes. There is also a very simple way to arbitrarily partition the work to any resolution you desire. Pick a starting point close to the root, such as after the 4th move and assign a job lot number based on the least significant bits of the position signature. If you want 64 "job lots" use 6 bits. Each process starts it's calculation at the 4th ply but is given a job lot number and it skips everything else except the entries with the specified job lot number. The only wrinkle is that you have to combine all the results at the end to get perft numbers. That is another 5 minute job, you are just combining several hash tables into one. You just want to make sure your hash table is large enough to accommodate all the entries of interest (and you don't overwrite deeper entries.)
To get the final numbers once you have the checkpoint file you just start the calculation from scratch and it's quickly re-generated. If you store 4 levels perft(N) will take about the same amount of time as perft(N-4)
Don
sje wrote:Having a dump/restore on the transposition table would certainly help, but as this is a one-time calculation I didn't implement the option. Also, the partial sums for positions near the root are kept in a shared access tree and that would have to be saved as well. But this tree is loaded with pointers and so there's another complication for externalization.Don wrote:What if the power goes off in the middle of the calculation?
Is your perft designed to be able to checkpoint from time to time to store intermediate results? Or I suppose if you save and restore the hash table you will get most of it back in short time?
If I ever try perft(13), I'll reconsider the dump/restore option.
What I need is an extension cord. A long one that can reach up north to Quebec where the electricity is cheaper and more reliable.