No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
SearchLimits Limits;
// Log file
SearchLimits Limits;
// Log file
std::ofstream LogFile;
// Skill level adjustment
std::ofstream LogFile;
// Skill level adjustment
PawnEndgameExtension[0] = Options["Pawn Endgame Extension (non-PV nodes)"].value<Depth>();
UCIMultiPV = Options["MultiPV"].value<int>();
SkillLevel = Options["Skill level"].value<int>();
PawnEndgameExtension[0] = Options["Pawn Endgame Extension (non-PV nodes)"].value<Depth>();
UCIMultiPV = Options["MultiPV"].value<int>();
SkillLevel = Options["Skill level"].value<int>();
- UseLogFile = Options["Use Search Log"].value<bool>();
read_evaluation_uci_options(pos.side_to_move());
read_evaluation_uci_options(pos.side_to_move());
}
// Write to log file and keep it open to be accessed during the search
}
// Write to log file and keep it open to be accessed during the search
+ if (Options["Use Search Log"].value<bool>())
{
std::string name = Options["Search Log Filename"].value<std::string>();
LogFile.open(name.c_str(), std::ios::out | std::ios::app);
{
std::string name = Options["Search Log Filename"].value<std::string>();
LogFile.open(name.c_str(), std::ios::out | std::ios::app);
- LogFile << "\nSearching: " << pos.to_fen()
- << "\ninfinite: " << Limits.infinite
- << " ponder: " << Limits.ponder
- << " time: " << Limits.time
- << " increment: " << Limits.increment
- << " moves to go: " << Limits.movesToGo
- << endl;
+ if (LogFile.is_open())
+ LogFile << "\nSearching: " << pos.to_fen()
+ << "\ninfinite: " << Limits.infinite
+ << " ponder: " << Limits.ponder
+ << " time: " << Limits.time
+ << " increment: " << Limits.increment
+ << " moves to go: " << Limits.movesToGo
+ << endl;
}
// We're ready to start thinking. Call the iterative deepening loop function
}
// We're ready to start thinking. Call the iterative deepening loop function
cout << "info" << speed_to_uci(pos.nodes_searched()) << endl;
// Write final search statistics and close log file
cout << "info" << speed_to_uci(pos.nodes_searched()) << endl;
// Write final search statistics and close log file
{
int t = current_search_time();
{
int t = current_search_time();
for (int i = 0; i < Min(UCIMultiPV, (int)Rml.size()); i++)
cout << Rml[i].pv_info_to_uci(pos, depth, selDepth, alpha, beta, i) << endl;
for (int i = 0; i < Min(UCIMultiPV, (int)Rml.size()); i++)
cout << Rml[i].pv_info_to_uci(pos, depth, selDepth, alpha, beta, i) << endl;
LogFile << pretty_pv(pos, depth, value, current_search_time(), Rml[0].pv) << endl;
// Init easyMove after first iteration or drop if differs from the best move
LogFile << pretty_pv(pos, depth, value, current_search_time(), Rml[0].pv) << endl;
// Init easyMove after first iteration or drop if differs from the best move