- Position pos(*it);
- std::cout << "\nProcessing position " << cnt << '/' << positions.size() << std::endl << std::endl;
- think(pos, true, false, 0, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves);
- totalNodes += nodes_searched();
+ Position pos(*it, 0);
+ cerr << "\nBench position: " << cnt << '/' << positions.size() << endl << endl;
+ if (limitType == "perft")
+ {
+ int64_t perftCnt = perft(pos, maxDepth * OnePly);
+ cerr << "\nPerft " << maxDepth << " result (nodes searched): " << perftCnt << endl << endl;
+ totalNodes += perftCnt;
+ } else {
+ if (!think(pos, false, false, 0, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves))
+ break;
+ totalNodes += nodes_searched();
+ }