Fix search result aggregation

This reverts my earlier change that only the root node gets to output best move after fixing problem with MPI_Allreduce by our custom operator(BestMoveOp). This function is not commutable and we must ensure that its output is consistent among all nodes.
This commit is contained in:
noobpwnftw
2018-07-13 16:51:26 +08:00
committed by Stéphane Nicolet
parent 8a95d269eb
commit 2405b38165
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -295,7 +295,7 @@ void MainThread::search() {
previousScore = static_cast<Value>(mi.score);
if (Cluster::is_root()) {
if (mi.rank == Cluster::rank()) {
// Send again PV info if we have a new best thread
if (bestThread != this)
sync_cout << UCI::pv(bestThread->rootPos, bestThread->completedDepth, -VALUE_INFINITE, VALUE_INFINITE) << sync_endl;
@@ -373,7 +373,7 @@ void Thread::search() {
// Distribute search depths across the helper threads
if (idx + Cluster::rank() > 0)
{
int i = (idx + Cluster::rank() - 1) % 20;
int i = (idx + Cluster::rank() * (int)Options["Threads"] - 1) % 20;
if (((rootDepth / ONE_PLY + SkipPhase[i]) / SkipSize[i]) % 2)
continue; // Retry with an incremented rootDepth
}