2011-04-24 02:20:03 -06:00
|
|
|
/*
|
|
|
|
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
|
2021-01-08 09:04:23 -07:00
|
|
|
Copyright (C) 2004-2021 The Stockfish developers (see AUTHORS file)
|
2011-04-24 02:20:03 -06:00
|
|
|
|
|
|
|
Stockfish is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Stockfish is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-01-16 13:20:13 -07:00
|
|
|
#include <cassert>
|
2011-04-24 02:20:03 -06:00
|
|
|
|
2019-03-31 04:02:19 -06:00
|
|
|
#include <algorithm> // For std::count
|
2012-01-14 05:49:25 -07:00
|
|
|
#include "movegen.h"
|
2011-11-05 04:19:21 -06:00
|
|
|
#include "search.h"
|
2011-04-24 02:20:03 -06:00
|
|
|
#include "thread.h"
|
2017-12-26 02:40:42 -07:00
|
|
|
#include "uci.h"
|
2016-06-03 23:53:29 -06:00
|
|
|
#include "syzygy/tbprobe.h"
|
2018-06-02 09:02:23 -06:00
|
|
|
#include "tt.h"
|
2011-04-24 02:20:03 -06:00
|
|
|
|
2021-02-26 02:02:13 -07:00
|
|
|
namespace Stockfish {
|
|
|
|
|
2012-06-24 02:30:40 -06:00
|
|
|
ThreadPool Threads; // Global object
|
2011-04-24 02:20:03 -06:00
|
|
|
|
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
/// Thread constructor launches the thread and waits until it goes to sleep
|
2019-03-31 03:47:36 -06:00
|
|
|
/// in idle_loop(). Note that 'searching' and 'exit' should be already set.
|
2013-07-30 22:59:24 -06:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
Thread::Thread(size_t n) : idx(n), stdThread(&Thread::idle_loop, this) {
|
2015-11-20 23:48:50 -07:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
wait_for_search_finished();
|
2013-07-30 22:59:24 -06:00
|
|
|
}
|
2011-04-24 02:20:03 -06:00
|
|
|
|
2012-04-06 11:36:46 -06:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
/// Thread destructor wakes up the thread in idle_loop() and waits
|
|
|
|
/// for its termination. Thread should be already waiting.
|
2013-07-31 01:33:26 -06:00
|
|
|
|
2015-11-05 00:40:23 -07:00
|
|
|
Thread::~Thread() {
|
2013-07-31 01:33:26 -06:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
assert(!searching);
|
|
|
|
|
2015-11-20 23:48:50 -07:00
|
|
|
exit = true;
|
2017-08-13 00:58:31 -06:00
|
|
|
start_searching();
|
|
|
|
stdThread.join();
|
2015-11-05 00:40:23 -07:00
|
|
|
}
|
2013-07-31 01:33:26 -06:00
|
|
|
|
2020-06-24 14:19:58 -06:00
|
|
|
|
2017-08-31 01:34:32 -06:00
|
|
|
/// Thread::clear() reset histories, usually before a new game
|
|
|
|
|
|
|
|
void Thread::clear() {
|
|
|
|
|
|
|
|
counterMoves.fill(MOVE_NONE);
|
|
|
|
mainHistory.fill(0);
|
Improve move order near the root
Current move histories are known to work well near the leaves, whilst at
higher depths they aren't very helpful. To address this problem this
patch introduces a table dedicated for what's happening at plies 0-3.
It's structured like mainHistory with ply index instead of color.
It get cleared with each new search and is filled during iterative
deepening at higher depths when recording successful quiet moves near
the root or traversing nodes which were in the principal variation
(ttPv).
Medium TC (20+0.2):
https://tests.stockfishchess.org/tests/view/5e4d358790a0a02810d096dc
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 100910 W: 16682 L: 16376 D: 67852
Ptnml(0-2): 1177, 10983, 25883, 11181, 1231
LTC:
https://tests.stockfishchess.org/tests/view/5e4e2cb790a0a02810d09714
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 80444 W: 10495 L: 10095 D: 59854
Ptnml(0-2): 551, 7479, 23803, 7797, 592
closes https://github.com/official-stockfish/Stockfish/pull/2557
Bench: 4705960
2020-02-21 06:01:59 -07:00
|
|
|
lowPlyHistory.fill(0);
|
2017-11-03 05:37:11 -06:00
|
|
|
captureHistory.fill(0);
|
2017-08-31 01:34:32 -06:00
|
|
|
|
2019-10-08 08:44:01 -06:00
|
|
|
for (bool inCheck : { false, true })
|
2020-02-05 07:18:24 -07:00
|
|
|
for (StatsType c : { NoCaptures, Captures })
|
|
|
|
{
|
|
|
|
for (auto& to : continuationHistory[inCheck][c])
|
|
|
|
for (auto& h : to)
|
|
|
|
h->fill(0);
|
|
|
|
continuationHistory[inCheck][c][NO_PIECE][0]->fill(Search::CounterMovePruneThreshold - 1);
|
|
|
|
}
|
2017-08-31 01:34:32 -06:00
|
|
|
}
|
|
|
|
|
2020-06-24 14:19:58 -06:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
/// Thread::start_searching() wakes up the thread that will start the search
|
2015-11-20 23:48:50 -07:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
void Thread::start_searching() {
|
2013-07-31 01:33:26 -06:00
|
|
|
|
2019-09-15 23:51:25 -06:00
|
|
|
std::lock_guard<std::mutex> lk(mutex);
|
2017-08-13 00:58:31 -06:00
|
|
|
searching = true;
|
|
|
|
cv.notify_one(); // Wake up the thread in idle_loop()
|
2013-07-31 01:33:26 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
/// Thread::wait_for_search_finished() blocks on the condition variable
|
|
|
|
/// until the thread has finished searching.
|
2012-03-24 14:36:33 -06:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
void Thread::wait_for_search_finished() {
|
2012-03-24 13:10:13 -06:00
|
|
|
|
2019-09-15 23:51:25 -06:00
|
|
|
std::unique_lock<std::mutex> lk(mutex);
|
2017-08-13 00:58:31 -06:00
|
|
|
cv.wait(lk, [&]{ return !searching; });
|
2012-03-24 13:10:13 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
/// Thread::idle_loop() is where the thread is parked, blocked on the
|
|
|
|
/// condition variable, when it has no work to do.
|
2012-02-03 08:07:13 -07:00
|
|
|
|
Lazy SMP
Start all threads searching on root position and
use only the shared TT table as synching scheme.
It seems this scheme scales better than YBWC for
high number of threads.
Verified for nor regression at STC 3 threads
LLR: -2.95 (-2.94,2.94) [-3.00,1.00]
Total: 40232 W: 6908 L: 7130 D: 26194
Verified for nor regression at LTC 3 threads
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 28186 W: 3908 L: 3798 D: 20480
Verified for nor regression at STC 7 threads
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 3607 W: 674 L: 526 D: 2407
Verified for nor regression at LTC 7 threads
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 4235 W: 671 L: 528 D: 3036
Tested with fixed games at LTC with 20 threads
ELO: 44.75 +-7.6 (95%) LOS: 100.0%
Total: 2069 W: 407 L: 142 D: 1520
Tested with fixed games at XLTC (120secs) with 20 threads
ELO: 28.01 +-6.7 (95%) LOS: 100.0%
Total: 2275 W: 349 L: 166 D: 1760
Original patch of mbootsector, with additional work
from Ivan Ivec (log formula), Joerg Oster (id loop
simplification) and Marco Costalba (assorted formatting
and rework).
Bench: 8116244
2015-10-06 00:15:17 -06:00
|
|
|
void Thread::idle_loop() {
|
2012-02-03 08:07:13 -07:00
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
// If OS already scheduled us on a different group than 0 then don't overwrite
|
|
|
|
// the choice, eventually we are one of many one-threaded processes running on
|
|
|
|
// some Windows NUMA hardware, for instance in fishtest. To make it simple,
|
|
|
|
// just check if running threads are below a threshold, in this case all this
|
|
|
|
// NUMA machinery is not needed.
|
2018-09-04 05:36:42 -06:00
|
|
|
if (Options["Threads"] > 8)
|
2017-12-26 02:40:42 -07:00
|
|
|
WinProcGroup::bindThisThread(idx);
|
2016-11-21 23:41:46 -07:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
while (true)
|
2012-02-03 08:07:13 -07:00
|
|
|
{
|
2019-09-15 23:51:25 -06:00
|
|
|
std::unique_lock<std::mutex> lk(mutex);
|
2015-11-05 00:40:23 -07:00
|
|
|
searching = false;
|
2017-08-13 00:58:31 -06:00
|
|
|
cv.notify_one(); // Wake up anyone waiting for search finished
|
|
|
|
cv.wait(lk, [&]{ return searching; });
|
2013-01-16 01:26:10 -07:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
if (exit)
|
|
|
|
return;
|
2012-02-03 08:07:13 -07:00
|
|
|
|
2015-01-18 00:00:50 -07:00
|
|
|
lk.unlock();
|
2012-02-03 08:07:13 -07:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
search();
|
2012-02-03 08:07:13 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
/// ThreadPool::set() creates/destroys threads to match the requested number.
|
2018-12-11 05:47:56 -07:00
|
|
|
/// Created and launched threads will immediately go to sleep in idle_loop.
|
2017-12-26 02:40:42 -07:00
|
|
|
/// Upon resizing, threads are recreated to allow for binding if necessary.
|
2012-02-03 08:07:13 -07:00
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
void ThreadPool::set(size_t requested) {
|
2012-03-26 00:58:10 -06:00
|
|
|
|
2021-03-19 12:43:25 -06:00
|
|
|
if (size() > 0) // destroy any existing thread(s)
|
|
|
|
{
|
2017-12-26 02:40:42 -07:00
|
|
|
main()->wait_for_search_finished();
|
2012-03-26 00:58:10 -06:00
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
while (size() > 0)
|
|
|
|
delete back(), pop_back();
|
|
|
|
}
|
2012-03-26 00:58:10 -06:00
|
|
|
|
2021-03-19 12:43:25 -06:00
|
|
|
if (requested > 0) // create new thread(s)
|
|
|
|
{
|
2017-12-26 02:40:42 -07:00
|
|
|
push_back(new MainThread(0));
|
2012-03-26 00:58:10 -06:00
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
while (size() < requested)
|
|
|
|
push_back(new Thread(size()));
|
|
|
|
clear();
|
2018-06-02 09:02:23 -06:00
|
|
|
|
2018-12-08 15:03:42 -07:00
|
|
|
// Reallocate the hash with the new threadpool size
|
2020-05-23 05:26:13 -06:00
|
|
|
TT.resize(size_t(Options["Hash"]));
|
2019-09-25 13:24:05 -06:00
|
|
|
|
|
|
|
// Init thread number dependent search params.
|
|
|
|
Search::init();
|
2018-12-08 15:03:42 -07:00
|
|
|
}
|
2012-03-26 00:58:10 -06:00
|
|
|
}
|
|
|
|
|
2020-06-24 14:19:58 -06:00
|
|
|
|
|
|
|
/// ThreadPool::clear() sets threadPool data to initial values
|
2012-03-26 00:58:10 -06:00
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
void ThreadPool::clear() {
|
2011-04-24 02:20:03 -06:00
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
for (Thread* th : *this)
|
|
|
|
th->clear();
|
2012-03-25 05:01:56 -06:00
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
main()->callsCnt = 0;
|
2020-04-12 12:30:08 -06:00
|
|
|
main()->bestPreviousScore = VALUE_INFINITE;
|
2018-02-12 14:57:42 -07:00
|
|
|
main()->previousTimeReduction = 1.0;
|
2012-03-24 12:29:12 -06:00
|
|
|
}
|
2011-08-08 16:07:09 -06:00
|
|
|
|
2020-06-24 14:19:58 -06:00
|
|
|
|
2017-08-13 00:58:31 -06:00
|
|
|
/// ThreadPool::start_thinking() wakes up main thread waiting in idle_loop() and
|
|
|
|
/// returns immediately. Main thread will wake up other threads and start the search.
|
2014-02-09 09:31:45 -07:00
|
|
|
|
2016-06-03 23:53:29 -06:00
|
|
|
void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
|
2017-08-10 13:32:50 -06:00
|
|
|
const Search::LimitsType& limits, bool ponderMode) {
|
2015-11-20 23:48:50 -07:00
|
|
|
|
|
|
|
main()->wait_for_search_finished();
|
2012-03-26 00:58:10 -06:00
|
|
|
|
Simplify pondering time management (#1899)
stopOnPonderhit is used to stop search quickly on a ponderhit. It is set by mainThread as part of its time management. However, master employs it as a signal between mainThread and the UCI thread. This is not necessary, it is sufficient for the UCI thread to signal that pondering finished, and mainThread should do its usual time-keeping job, and in this case stop immediately.
This patch implements this, removing stopOnPonderHit as an atomic variable from the ThreadPool,
and moving it as a normal variable to mainThread, reducing its scope. In MainThread::check_time() the search is stopped immediately if ponder switches to false, and the variable stopOnPonderHit is set.
Furthermore, ponder has been moved to mainThread, as the variable is only used to exchange signals between the UCI thread and mainThread.
The version has been tested locally (as fishtest doesn't support ponder):
Score of ponderSimp vs master: 2616 - 2528 - 8630 [0.503] 13774
Elo difference: 2.22 +/- 3.54
which indicates no regression.
No functional change.
2019-01-20 11:14:24 -07:00
|
|
|
main()->stopOnPonderhit = stop = false;
|
Smarter time management near stop limit
This patch makes Stockfish search same depth again if > 60% of optimum time is
already used, instead of trying the next iteration. The idea is that the next
iteration will generally take about the same amount of time as has already been
used in total. When we are likely to begin the last iteration, as judged by total
time taken so far > 0.6 * optimum time, searching the last depth again instead of
increasing the depth still helps the other threads in lazy SMP and prepares better
move ordering for the next moves.
STC :
LLR: 2.95 (-2.94,2.94) {-1.00,3.00}
Total: 13436 W: 2695 L: 2558 D: 8183
Ptnml(0-2): 222, 1538, 3087, 1611, 253
https://tests.stockfishchess.org/tests/view/5e1618a761fe5f83a67dd964
LTC :
LLR: 2.94 (-2.94,2.94) {0.00,2.00}
Total: 32160 W: 4261 L: 4047 D: 23852
Ptnml(0-2): 211, 2988, 9448, 3135, 247
https://tests.stockfishchess.org/tests/view/5e162ca061fe5f83a67dd96d
The code was revised as suggested by @vondele for multithreading:
STC (8 threads):
LLR: 2.95 (-2.94,2.94) {0.00,2.00}
Total: 16640 W: 2049 L: 1885 D: 12706
Ptnml(0-2): 119, 1369, 5158, 1557, 108
https://tests.stockfishchess.org/tests/view/5e19826a2cc590e03c3c2f52
LTC (8 threads):
LLR: 2.95 (-2.94,2.94) {-1.00,3.00}
Total: 16536 W: 2758 L: 2629 D: 11149
Ptnml(0-2): 182, 1758, 4296, 1802, 224
https://tests.stockfishchess.org/tests/view/5e18b91a27dab692fcf9a140
Thanks to those discussing Stockfish lazy SMP on fishcooking which made me
try this, and to @vondele for suggestions and doing related tests.
See full discussion in the pull request thread:
https://github.com/official-stockfish/Stockfish/pull/2482
Bench: 4586187
2020-01-11 15:10:22 -07:00
|
|
|
increaseDepth = true;
|
Simplify pondering time management (#1899)
stopOnPonderhit is used to stop search quickly on a ponderhit. It is set by mainThread as part of its time management. However, master employs it as a signal between mainThread and the UCI thread. This is not necessary, it is sufficient for the UCI thread to signal that pondering finished, and mainThread should do its usual time-keeping job, and in this case stop immediately.
This patch implements this, removing stopOnPonderHit as an atomic variable from the ThreadPool,
and moving it as a normal variable to mainThread, reducing its scope. In MainThread::check_time() the search is stopped immediately if ponder switches to false, and the variable stopOnPonderHit is set.
Furthermore, ponder has been moved to mainThread, as the variable is only used to exchange signals between the UCI thread and mainThread.
The version has been tested locally (as fishtest doesn't support ponder):
Score of ponderSimp vs master: 2616 - 2528 - 8630 [0.503] 13774
Elo difference: 2.22 +/- 3.54
which indicates no regression.
No functional change.
2019-01-20 11:14:24 -07:00
|
|
|
main()->ponder = ponderMode;
|
2016-04-11 08:45:36 -06:00
|
|
|
Search::Limits = limits;
|
|
|
|
Search::RootMoves rootMoves;
|
2012-01-14 05:49:25 -07:00
|
|
|
|
2015-01-31 10:39:51 -07:00
|
|
|
for (const auto& m : MoveList<LEGAL>(pos))
|
2014-02-09 09:31:45 -07:00
|
|
|
if ( limits.searchmoves.empty()
|
2015-01-31 10:39:51 -07:00
|
|
|
|| std::count(limits.searchmoves.begin(), limits.searchmoves.end(), m))
|
2017-08-13 00:58:31 -06:00
|
|
|
rootMoves.emplace_back(m);
|
2016-04-11 08:45:36 -06:00
|
|
|
|
2016-09-23 23:30:37 -06:00
|
|
|
if (!rootMoves.empty())
|
2018-04-18 10:38:38 -06:00
|
|
|
Tablebases::rank_root_moves(pos, rootMoves);
|
2016-06-03 23:53:29 -06:00
|
|
|
|
2016-04-11 08:45:36 -06:00
|
|
|
// After ownership transfer 'states' becomes empty, so if we stop the search
|
|
|
|
// and call 'go' again without setting a new position states.get() == NULL.
|
|
|
|
assert(states.get() || setupStates.get());
|
|
|
|
|
|
|
|
if (states.get())
|
|
|
|
setupStates = std::move(states); // Ownership transfer, states is now empty
|
|
|
|
|
2017-08-14 10:12:16 -06:00
|
|
|
// We use Position::set() to set root position across threads. But there are
|
|
|
|
// some StateInfo fields (previous, pliesFromNull, capturedPiece) that cannot
|
2020-08-09 10:11:38 -06:00
|
|
|
// be deduced from a fen string, so set() clears them and they are set from
|
|
|
|
// setupStates->back() later. The rootState is per thread, earlier states are shared
|
|
|
|
// since they are read-only.
|
2017-12-26 02:40:42 -07:00
|
|
|
for (Thread* th : *this)
|
2016-04-11 08:45:36 -06:00
|
|
|
{
|
2020-05-31 23:31:14 -06:00
|
|
|
th->nodes = th->tbHits = th->nmpMinPly = th->bestMoveChanges = 0;
|
2019-09-28 14:27:23 -06:00
|
|
|
th->rootDepth = th->completedDepth = 0;
|
2016-04-11 08:45:36 -06:00
|
|
|
th->rootMoves = rootMoves;
|
2020-08-09 10:11:38 -06:00
|
|
|
th->rootPos.set(pos.fen(), pos.is_chess960(), &th->rootState, th);
|
|
|
|
th->rootState = setupStates->back();
|
2016-04-11 08:45:36 -06:00
|
|
|
}
|
2011-11-05 00:53:19 -06:00
|
|
|
|
2015-11-20 23:48:50 -07:00
|
|
|
main()->start_searching();
|
2011-12-29 01:55:09 -07:00
|
|
|
}
|
2020-05-31 23:31:14 -06:00
|
|
|
|
|
|
|
Thread* ThreadPool::get_best_thread() const {
|
|
|
|
|
|
|
|
Thread* bestThread = front();
|
|
|
|
std::map<Move, int64_t> votes;
|
|
|
|
Value minScore = VALUE_NONE;
|
|
|
|
|
|
|
|
// Find minimum score of all threads
|
|
|
|
for (Thread* th: *this)
|
|
|
|
minScore = std::min(minScore, th->rootMoves[0].score);
|
|
|
|
|
|
|
|
// Vote according to score and depth, and select the best thread
|
|
|
|
for (Thread* th : *this)
|
|
|
|
{
|
|
|
|
votes[th->rootMoves[0].pv[0]] +=
|
|
|
|
(th->rootMoves[0].score - minScore + 14) * int(th->completedDepth);
|
|
|
|
|
2020-09-09 02:49:31 -06:00
|
|
|
if (abs(bestThread->rootMoves[0].score) >= VALUE_TB_WIN_IN_MAX_PLY)
|
|
|
|
{
|
|
|
|
// Make sure we pick the shortest mate / TB conversion or stave off mate the longest
|
|
|
|
if (th->rootMoves[0].score > bestThread->rootMoves[0].score)
|
|
|
|
bestThread = th;
|
|
|
|
}
|
|
|
|
else if ( th->rootMoves[0].score >= VALUE_TB_WIN_IN_MAX_PLY
|
|
|
|
|| ( th->rootMoves[0].score > VALUE_TB_LOSS_IN_MAX_PLY
|
|
|
|
&& votes[th->rootMoves[0].pv[0]] > votes[bestThread->rootMoves[0].pv[0]]))
|
|
|
|
bestThread = th;
|
2020-05-31 23:31:14 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
return bestThread;
|
|
|
|
}
|
|
|
|
|
2020-06-24 14:19:58 -06:00
|
|
|
|
|
|
|
/// Start non-main threads
|
2020-05-31 23:31:14 -06:00
|
|
|
|
|
|
|
void ThreadPool::start_searching() {
|
|
|
|
|
|
|
|
for (Thread* th : *this)
|
|
|
|
if (th != front())
|
|
|
|
th->start_searching();
|
|
|
|
}
|
|
|
|
|
2020-06-24 14:19:58 -06:00
|
|
|
|
|
|
|
/// Wait for non-main threads
|
2020-05-31 23:31:14 -06:00
|
|
|
|
|
|
|
void ThreadPool::wait_for_search_finished() const {
|
|
|
|
|
|
|
|
for (Thread* th : *this)
|
|
|
|
if (th != front())
|
|
|
|
th->wait_for_search_finished();
|
|
|
|
}
|
2021-02-26 02:02:13 -07:00
|
|
|
|
|
|
|
} // namespace Stockfish
|