mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 02:57:11 +08:00
Measure nodes after search finished.
Only affects nmpsec in the multithreaded case. No functional change.
This commit is contained in:
@@ -259,11 +259,6 @@ void MainThread::search() {
|
|||||||
Thread::search(); // Let's start searching!
|
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
|
// 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,
|
// 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
|
// the UCI protocol states that we shouldn't print the best move before the
|
||||||
@@ -283,6 +278,11 @@ void MainThread::search() {
|
|||||||
if (th != this)
|
if (th != this)
|
||||||
th->wait_for_search_finished();
|
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
|
// Check if there are threads with a better score than main thread
|
||||||
Thread* bestThread = this;
|
Thread* bestThread = this;
|
||||||
if ( !this->easyMovePlayed
|
if ( !this->easyMovePlayed
|
||||||
|
|||||||
Reference in New Issue
Block a user