Per-thread TB hit counters

Use a per-thread counter to reduce contention
with many cores and endgame positions.

Measured around 1% speed-up on a 12 core and 8%
on 28 cores with 6-men, searching on:
 7R/1p3k2/2p2P2/3nR1P1/8/3b1P2/7K/r7 b - - 3 38

Also retire the unused set_nodes_searched() and fix
a couple of return types and naming conventions.

No functional change.
This commit is contained in:
syzygy
2016-10-20 21:16:09 +02:00
committed by Marco Costalba
parent 3686e719a1
commit ca67752645
4 changed files with 28 additions and 26 deletions

View File

@@ -62,6 +62,7 @@ public:
Endgames endgames;
size_t idx, PVIdx;
int maxPly, callsCnt;
uint64_t tbHits;
Position rootPos;
Search::RootMoves rootMoves;
@@ -98,7 +99,8 @@ struct ThreadPool : public std::vector<Thread*> {
MainThread* main() { return static_cast<MainThread*>(at(0)); }
void start_thinking(Position&, StateListPtr&, const Search::LimitsType&);
void read_uci_options();
int64_t nodes_searched();
uint64_t nodes_searched();
uint64_t tb_hits();
private:
StateListPtr setupStates;