X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=blobdiff_plain;f=epd.cpp;h=fab728a402889eaa985915a11472e62858ed4775;hp=18c51909f3a42c9ad83ae0a6eb9d09566b3094ec;hb=HEAD;hpb=64f72f31685ea1dff12b19b22cfaf7a53ccc079f diff --git a/epd.cpp b/epd.cpp index 18c5190..fab728a 100644 --- a/epd.cpp +++ b/epd.cpp @@ -55,6 +55,8 @@ static double LastTime; static uint64 LastNodeNb; static move_t LastPV[LineSize]; +static my_timer_t Timer[1]; + // prototypes static void epd_test_file (const char file_name[]); @@ -211,6 +213,8 @@ static void epd_test_file(const char file_name[]) { // search + my_timer_start(Timer); // also resets + // which ones of the next two alternatives is best? engine_send(Engine,"go movetime %.0f depth %d",MaxTime*1000.0,MaxDepth); //engine_send(Engine,"go infinite"); @@ -241,27 +245,23 @@ static void epd_test_file(const char file_name[]) { // parse engine output - while (engine_step()) { + while (!engine_eof(Engine) && engine_step()) { bool stop=false; - // stop search? + // stop search? +// printf("Uci->time=%.2f time=%.2f\n",Uci->time,my_timer_elapsed_real(Timer)); if (Uci->depth > MaxDepth){ my_log("POLYGLOT Maximum depth %d reached\n",MaxDepth); stop=true; - }else if(Uci->time >= MaxTime){ + }else if(my_timer_elapsed_real(Timer) >= MaxTime){ my_log("POLYGLOT Maximum search time %.2fs reached\n",MaxTime); stop=true; }else if(Uci->depth - FirstDepth >= DepthDelta){ - my_log("POLYGLOT DepthDelta (=%d) reached\n",DepthDelta); if(Uci->depth > MinDepth){ - my_log("POLYGLOT Minimum depth %d reached\n",MinDepth); if(Uci->time >= MinTime){ - my_log("POLYGLOT Minimum search time %.2fs reached\n",MinTime); if(is_solution(FirstMove,board,bm,am)){ - my_log("POLYGLOT Solution is correct\n"); + my_log("POLYGLOT Solution found\n",MaxTime); stop=true; - }else{ - my_log("POLYGLOT Solution is not correct\n"); } } } @@ -282,13 +282,13 @@ static void epd_test_file(const char file_name[]) { if (correct) { depth_tot += double(FirstDepth); time_tot += FirstTime; - node_tot += double(FirstNodeNb); + node_tot += double(sint64(FirstNodeNb)); } printf("%2d: %-15s %s %4d",tot,id,correct?"OK":"--",hit); if (!line_to_san(LastPV,Uci->board,pv_string,StringSize)) ASSERT(false); - printf(" [at: depth=%2d time=%6.2f nodes="S64_FORMAT"] score=%+6.2f pv=%s\n",FirstDepth,FirstTime,FirstNodeNb,double(LastScore)/100.0,pv_string); + printf(" score=%+6.2f pv [D=%2d, T=%7.2fs, N=%6dk] =%s\n",double(LastScore)/100.0,FirstDepth,FirstTime,(int)FirstNodeNb/1000,pv_string); } printf("\nscore=%d/%d",hit,tot);