]> git.sesse.net Git - stockfish/commitdiff
Retire Search Log
authorlucasart <lucas.braesch@gmail.com>
Sun, 24 Aug 2014 15:28:51 +0000 (16:28 +0100)
committerJoona Kiiski <joona.kiiski@gmail.com>
Sun, 24 Aug 2014 15:28:51 +0000 (16:28 +0100)
No functional change

Bench: 7461881

src/notation.cpp
src/notation.h
src/search.cpp
src/ucioption.cpp

index 3686016b3eb6c92da2550f19df4f6c746a8d9aa3..a2d898adf3e21289a17e477ca45111afab2171fe 100644 (file)
@@ -18,9 +18,7 @@
 */
 
 #include <cassert>
 */
 
 #include <cassert>
-#include <iomanip>
 #include <sstream>
 #include <sstream>
-#include <stack>
 
 #include "movegen.h"
 #include "notation.h"
 
 #include "movegen.h"
 #include "notation.h"
@@ -95,68 +93,3 @@ Move move_from_uci(const Position& pos, string& str) {
 
   return MOVE_NONE;
 }
 
   return MOVE_NONE;
 }
-
-
-/// pretty_pv() formats human-readable search information, typically to be
-/// appended to the search log file. It uses the two helpers below to pretty
-/// format the time and score respectively.
-
-static string format(int64_t msecs) {
-
-  const int MSecMinute = 1000 * 60;
-  const int MSecHour   = 1000 * 60 * 60;
-
-  int64_t hours   =   msecs / MSecHour;
-  int64_t minutes =  (msecs % MSecHour) / MSecMinute;
-  int64_t seconds = ((msecs % MSecHour) % MSecMinute) / 1000;
-
-  stringstream ss;
-
-  if (hours)
-      ss << hours << ':';
-
-  ss << setfill('0') << setw(2) << minutes << ':' << setw(2) << seconds;
-
-  return ss.str();
-}
-
-static string format(Value v) {
-
-  stringstream ss;
-
-  if (v >= VALUE_MATE_IN_MAX_PLY)
-      ss << "#" << (VALUE_MATE - v + 1) / 2;
-
-  else if (v <= VALUE_MATED_IN_MAX_PLY)
-      ss << "-#" << (VALUE_MATE + v) / 2;
-
-  else
-      ss << setprecision(2) << fixed << showpos << double(v) / PawnValueEg;
-
-  return ss.str();
-}
-
-string pretty_pv(const Position& pos, int depth, Value value, int64_t msecs, Move pv[]) {
-
-  const uint64_t K = 1000;
-  const uint64_t M = 1000000;
-
-  stringstream ss;
-  ss << setw(2) << depth << setw(8) << format(value) << setw(8) << format(msecs);
-
-  if (pos.nodes_searched() < M)
-      ss << setw(8) << pos.nodes_searched() / 1 << "  ";
-
-  else if (pos.nodes_searched() < K * M)
-      ss << setw(7) << pos.nodes_searched() / K << "K  ";
-
-  else
-      ss << setw(7) << pos.nodes_searched() / M << "M  ";
-
-  string str = ss.str();
-
-  for (Move *m = pv; *m != MOVE_NONE; m++)
-      str += move_to_uci(*m, pos.is_chess960()) + ' ';
-
-  return str;
-}
index a77b0f0963dcf0e8f00ab010b376296adbf96aef..251a0caf8ac109df5ff03c1349443e38cfae7d9e 100644 (file)
@@ -29,7 +29,6 @@ class Position;
 std::string score_to_uci(Value v, Value alpha = -VALUE_INFINITE, Value beta = VALUE_INFINITE);
 Move move_from_uci(const Position& pos, std::string& str);
 const std::string move_to_uci(Move m, bool chess960);
 std::string score_to_uci(Value v, Value alpha = -VALUE_INFINITE, Value beta = VALUE_INFINITE);
 Move move_from_uci(const Position& pos, std::string& str);
 const std::string move_to_uci(Move m, bool chess960);
-std::string pretty_pv(const Position& pos, int depth, Value score, int64_t msecs, Move pv[]);
 
 inline char to_char(File f, bool tolower = true) {
   return char(f - FILE_A + (tolower ? 'a' : 'A'));
 
 inline char to_char(File f, bool tolower = true) {
   return char(f - FILE_A + (tolower ? 'a' : 'A'));
index c7eb5f9a70f19d200f3cc291ea9fdd0fa852577b..7ce54521d043bdc5abd8da660684868b5123f208 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <algorithm>
 #include <cassert>
 
 #include <algorithm>
 #include <cassert>
-#include <cfloat>
 #include <cmath>
 #include <cstring>
 #include <iostream>
 #include <cmath>
 #include <cstring>
 #include <iostream>
@@ -202,18 +201,6 @@ void Search::think() {
       goto finalize;
   }
 
       goto finalize;
   }
 
-  if (Options["Write Search Log"])
-  {
-      Log log(Options["Search Log Filename"]);
-      log << "\nSearching: "  << RootPos.fen()
-          << "\ninfinite: "   << Limits.infinite
-          << " ponder: "      << Limits.ponder
-          << " time: "        << Limits.time[RootPos.side_to_move()]
-          << " increment: "   << Limits.inc[RootPos.side_to_move()]
-          << " moves to go: " << Limits.movestogo
-          << "\n" << std::endl;
-  }
-
   // Reset the threads, still sleeping: will wake up at split time
   for (size_t i = 0; i < Threads.size(); ++i)
       Threads[i]->maxPly = 0;
   // Reset the threads, still sleeping: will wake up at split time
   for (size_t i = 0; i < Threads.size(); ++i)
       Threads[i]->maxPly = 0;
@@ -225,18 +212,6 @@ void Search::think() {
 
   Threads.timer->run = false; // Stop the timer
 
 
   Threads.timer->run = false; // Stop the timer
 
-  if (Options["Write Search Log"])
-  {
-      Time::point elapsed = Time::now() - SearchTime + 1;
-
-      Log log(Options["Search Log Filename"]);
-      log << "Nodes: "          << RootPos.nodes_searched()
-          << "\nNodes/second: " << RootPos.nodes_searched() * 1000 / elapsed
-          << "\nBest move: "    << move_to_uci(RootMoves[0].pv[0], RootPos.is_chess960())
-          << "\nPonder move: "  << move_to_uci(RootMoves[0].pv[1], RootPos.is_chess960())
-          << std::endl;
-  }
-
 finalize:
 
   // When search is stopped this info is not printed
 finalize:
 
   // When search is stopped this info is not printed
@@ -378,17 +353,6 @@ namespace {
         if (skill.candidates_size() && skill.time_to_pick(depth))
             skill.pick_move();
 
         if (skill.candidates_size() && skill.time_to_pick(depth))
             skill.pick_move();
 
-        if (Options["Write Search Log"])
-        {
-            RootMove& rm = RootMoves[0];
-            if (skill.best != MOVE_NONE)
-                rm = *std::find(RootMoves.begin(), RootMoves.end(), skill.best);
-
-            Log log(Options["Search Log Filename"]);
-            log << pretty_pv(pos, depth, rm.score, Time::now() - SearchTime, &rm.pv[0])
-                << std::endl;
-        }
-
         // Have we found a "mate in x"?
         if (   Limits.mate
             && bestValue >= VALUE_MATE_IN_MAX_PLY
         // Have we found a "mate in x"?
         if (   Limits.mate
             && bestValue >= VALUE_MATE_IN_MAX_PLY
index 89b983f83fc13b2d8bf8696c8bdcaa32cb2b76c1..3329a468fe8b5d626fcc0d8ac85d59e4a08015a1 100644 (file)
@@ -55,8 +55,6 @@ bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const
 void init(OptionsMap& o) {
 
   o["Write Debug Log"]          << Option(false, on_logger);
 void init(OptionsMap& o) {
 
   o["Write Debug Log"]          << Option(false, on_logger);
-  o["Write Search Log"]         << Option(false);
-  o["Search Log Filename"]      << Option("SearchLog.txt");
   o["Contempt Factor"]          << Option(0, -100,  100);
   o["Min Split Depth"]          << Option(0, 0, 12, on_threads);
   o["Threads"]                  << Option(1, 1, MAX_THREADS, on_threads);
   o["Contempt Factor"]          << Option(0, -100,  100);
   o["Min Split Depth"]          << Option(0, 0, 12, on_threads);
   o["Threads"]                  << Option(1, 1, MAX_THREADS, on_threads);