Skip to content

Commit

Permalink
Make sure analysis is printed at least once.
Browse files Browse the repository at this point in the history
Fixes issue leela-zero#2001.

Pull request leela-zero#2114.
  • Loading branch information
dbosst authored and gcp committed Apr 2, 2019
1 parent 71ea88e commit 7b05537
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/UCTSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,10 @@ int UCTSearch::think(int color, passflag_t passflag) {
keeprunning &= have_alternate_moves(elapsed_centis, time_for_move);
} while (keeprunning);

if (last_output == 0) {
output_analysis(m_rootstate, *m_root);
}

// stop the search
m_run = false;
tg.wait_all();
Expand Down Expand Up @@ -820,6 +824,10 @@ void UCTSearch::ponder() {
keeprunning &= !stop_thinking(0, 1);
} while (!Utils::input_pending() && keeprunning);

if (last_output == 0) {
output_analysis(m_rootstate, *m_root);
}

// stop the search
m_run = false;
tg.wait_all();
Expand Down

0 comments on commit 7b05537

Please sign in to comment.