X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbenchmark.cpp;h=33e266898e415f5515fe9d965d13959726ade919;hp=5c4c4e362368b121e0fb32d44e36fb0e1b1bc559;hb=8315620522dd268755f32be792802abb62f7366f;hpb=3e2591d83c285597a7400c79b61ab9dc38875163 diff --git a/src/benchmark.cpp b/src/benchmark.cpp index 5c4c4e36..33e26689 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -91,8 +91,8 @@ const vector Defaults = { void benchmark(const Position& current, istream& is) { string token; - Search::LimitsType limits; vector fens; + Search::LimitsType limits; // Assign default values to missing arguments string ttSize = (is >> token) ? token : "16"; @@ -103,10 +103,10 @@ void benchmark(const Position& current, istream& is) { Options["Hash"] = ttSize; Options["Threads"] = threads; - Search::reset(); + Search::clear(); if (limitType == "time") - limits.movetime = stoi(limit); // movetime is in ms + limits.movetime = stoi(limit); // movetime is in millisecs else if (limitType == "nodes") limits.nodes = stoi(limit); @@ -151,14 +151,15 @@ void benchmark(const Position& current, istream& is) { cerr << "\nPosition: " << i + 1 << '/' << fens.size() << endl; if (limitType == "perft") - nodes += Search::perft(pos, limits.depth * ONE_PLY); + nodes += Search::perft(pos, limits.depth * ONE_PLY); else { Search::StateStackPtr st; + limits.startTime = now(); Threads.start_thinking(pos, limits, st); - Threads.main()->join(); - nodes += Search::RootPos.nodes_searched(); + Threads.main()->wait_for_search_finished(); + nodes += Threads.nodes_searched(); } }