From: Joost VandeVondele Date: Fri, 29 Sep 2017 14:39:12 +0000 (+0200) Subject: Measure nodes after search finished. X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=c33af32dada1be9f6aed851e8cf87599203e2eb2 Measure nodes after search finished. Only affects nmpsec in the multithreaded case. No functional change. --- diff --git a/src/search.cpp b/src/search.cpp index 07c18012..182d2d7f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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