1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Measure nodes after search finished.

Only affects nmpsec in the multithreaded case.

No functional change.
This commit is contained in:
Joost VandeVondele 2017-09-29 16:39:12 +02:00
parent 0e949ac2c9
commit c33af32dad

View file

@ -259,11 +259,6 @@ void MainThread::search() {
Thread::search(); // Let's start searching!
}
// When playing in 'nodes as time' mode, subtract the searched nodes from
// the available ones before exiting.
if (Limits.npmsec)
Time.availableNodes += Limits.inc[us] - Threads.nodes_searched();
// When we reach the maximum depth, we can arrive here without a raise of
// Threads.stop. However, if we are pondering or in an infinite search,
// the UCI protocol states that we shouldn't print the best move before the
@ -283,6 +278,11 @@ void MainThread::search() {
if (th != this)
th->wait_for_search_finished();
// When playing in 'nodes as time' mode, subtract the searched nodes from
// the available ones before exiting.
if (Limits.npmsec)
Time.availableNodes += Limits.inc[us] - Threads.nodes_searched();
// Check if there are threads with a better score than main thread
Thread* bestThread = this;
if ( !this->easyMovePlayed