- // If we are pondering or in infinite search, we shouldn't print the
- // best move before we are told to do so.
- if (!AbortSearch && (PonderSearch || InfiniteSearch))
- wait_for_stop_or_ponderhit();
- else
- // Print final search statistics
- cout << "info nodes " << pos.nodes_searched()
- << " nps " << nps(pos)
- << " time " << current_search_time() << endl;
-
- // Print the best move and the ponder move to the standard output
- cout << "bestmove " << rml[0].pv[0];
-
- if (rml[0].pv[1] != MOVE_NONE)
- cout << " ponder " << rml[0].pv[1];
-
- cout << endl;
-
- if (UseLogFile)
- {
- if (dbg_show_mean)
- dbg_print_mean(LogFile);
-
- if (dbg_show_hit_rate)
- dbg_print_hit_rate(LogFile);
-
- LogFile << "\nNodes: " << pos.nodes_searched()
- << "\nNodes/second: " << nps(pos)
- << "\nBest move: " << move_to_san(pos, rml[0].pv[0]);
-
- StateInfo st;
- pos.do_move(rml[0].pv[0], st);
- LogFile << "\nPonder move: "
- << move_to_san(pos, rml[0].pv[1]) // Works also with MOVE_NONE
- << endl;
- }
- return rml[0].pv_score;