From c33af32dada1be9f6aed851e8cf87599203e2eb2 Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Fri, 29 Sep 2017 16:39:12 +0200 Subject: [PATCH] Measure nodes after search finished. Only affects nmpsec in the multithreaded case. No functional change. --- src/search.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.39.2