]> git.sesse.net Git - stockfish/commitdiff
Measure nodes after search finished.
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Fri, 29 Sep 2017 14:39:12 +0000 (16:39 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Fri, 29 Sep 2017 14:39:12 +0000 (16:39 +0200)
Only affects nmpsec in the multithreaded case.

No functional change.

src/search.cpp

index 07c18012739e5b681f662ed08121650d01a9502f..182d2d7f60493bc0069ec1bdc05ead0153609885 100644 (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