]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
[Cluster] Improve message passing part.
[stockfish] / src / thread.cpp
index e69120842c58f0be117c0b16e2c7800b14f54d26..932376a305c6bfb2db86b238492050cd5255d73f 100644 (file)
@@ -136,10 +136,13 @@ void ThreadPool::set(size_t requested) {
       while (size() < requested)
           push_back(new Thread(size()));
       clear();
-  }
 
-  // Reallocate the hash with the new threadpool size
-  TT.resize(Options["Hash"]);
+      // Reallocate the hash with the new threadpool size
+      TT.resize(Options["Hash"]);
+
+      // Adjust cluster buffers
+      Cluster::ttRecvBuff_resize(requested);
+  }
 }
 
 /// ThreadPool::clear() sets threadPool data to initial values.
@@ -163,6 +166,7 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
   main()->wait_for_search_finished();
 
   stopOnPonderhit = stop = false;
+
   ponder = ponderMode;
   Search::Limits = limits;
   Search::RootMoves rootMoves;
@@ -199,5 +203,7 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
 
   setupStates->back() = tmp;
 
+  Cluster::signals_init();
+
   main()->start_searching();
 }