mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Send correct searched nodes statistic
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
9394db765f
commit
df73af30dd
1 changed files with 14 additions and 3 deletions
|
@ -267,6 +267,7 @@ namespace {
|
|||
|
||||
// Node counters, used only by thread[0] but try to keep in different cache
|
||||
// lines (64 bytes each) from the heavy multi-thread read accessed variables.
|
||||
bool SendSearchedNodes;
|
||||
int NodesSincePoll;
|
||||
int NodesBetweenPolls = 30000;
|
||||
|
||||
|
@ -401,7 +402,7 @@ bool think(Position& pos, bool infinite, bool ponder, int time[], int increment[
|
|||
int movesToGo, int maxDepth, int maxNodes, int maxTime, Move searchMoves[]) {
|
||||
|
||||
// Initialize global search variables
|
||||
StopOnPonderhit = AbortSearch = Quit = AspirationFailLow = false;
|
||||
StopOnPonderhit = AbortSearch = Quit = AspirationFailLow = SendSearchedNodes = false;
|
||||
NodesSincePoll = 0;
|
||||
SearchStartTime = get_system_time();
|
||||
ExactMaxTime = maxTime;
|
||||
|
@ -721,6 +722,16 @@ namespace {
|
|||
// Save the current node count before the move is searched
|
||||
nodes = pos.nodes_searched();
|
||||
|
||||
// If it's time to send nodes info, do it here where we have the
|
||||
// correct accumulated node counts searched by each thread.
|
||||
if (SendSearchedNodes)
|
||||
{
|
||||
SendSearchedNodes = false;
|
||||
cout << "info nodes " << nodes
|
||||
<< " nps " << nps(pos)
|
||||
<< " time " << current_search_time() << endl;
|
||||
}
|
||||
|
||||
// Pick the next root move, and print the move and the move number to
|
||||
// the standard output.
|
||||
move = ss->currentMove = rml[i].pv[0];
|
||||
|
@ -2007,8 +2018,8 @@ split_point_start: // At split points actual search starts from here
|
|||
if (dbg_show_hit_rate)
|
||||
dbg_print_hit_rate();
|
||||
|
||||
cout << "info nodes " << pos.nodes_searched() << " nps " << nps(pos)
|
||||
<< " time " << t << endl;
|
||||
// Send info on searched nodes as soon as we return to root
|
||||
SendSearchedNodes = true;
|
||||
}
|
||||
|
||||
// Should we stop the search?
|
||||
|
|
Loading…
Add table
Reference in a new issue