Also print some more info.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
std::istringstream csVal(commandLine);
std::istringstream csStr(commandLine);
std::istringstream csVal(commandLine);
std::istringstream csStr(commandLine);
- std::string ttSize, threads, fileName;
- int val, secsPerPos;
+ std::string ttSize, threads, fileName, timeOrDepth;
+ int val, secsPerPos, maxDepth = 0;
csStr >> ttSize;
csVal >> val;
csStr >> ttSize;
csVal >> val;
csVal >> secsPerPos;
csVal >> fileName;
csVal >> secsPerPos;
csVal >> fileName;
+ csVal >> timeOrDepth;
+
+ if (timeOrDepth == "time")
+ secsPerPos *= 1000;
+ else
+ {
+ maxDepth = secsPerPos;
+ secsPerPos = 0;
+ }
std::vector<std::string> positions;
std::vector<std::string> positions;
for (int i = 0; i < 16; i++)
positions.push_back(std::string(BenchmarkPositions[i]));
for (int i = 0; i < 16; i++)
positions.push_back(std::string(BenchmarkPositions[i]));
+ int startTime = get_system_time();
std::vector<std::string>::iterator it;
std::vector<std::string>::iterator it;
- for (it = positions.begin(); it != positions.end(); ++it)\r
+ int cnt = 1;
+ for (it = positions.begin(); it != positions.end(); ++it, ++cnt)
- Move moves[1] = {MOVE_NONE};\r
- int dummy[2] = {0, 0};\r
+ Move moves[1] = {MOVE_NONE};
+ int dummy[2] = {0, 0};
- think(pos, true, false, 0, dummy, dummy, 0, 0, 0, secsPerPos * 1000, moves);\r
+ std::cout << "\nProcessing position " << cnt << '/' << positions.size() << std::endl << std::endl;
+ think(pos, true, false, 0, dummy, dummy, 0, maxDepth, 0, secsPerPos, moves);
+ std::cout << "\n\nBenchmarking finished. Processing time (ms) " << get_system_time() - startTime
+ << std::endl << "Press any key to exit\n";
+ std::cin >> fileName;
// Process command line arguments
if (argc >= 2 && string(argv[1]) == "bench")
{
// Process command line arguments
if (argc >= 2 && string(argv[1]) == "bench")
{
- if (argc < 4 || argc > 6)
+ if (argc < 4 || argc > 7)
{
std::cout << "Usage: glaurung bench <hash size> <threads> "
{
std::cout << "Usage: glaurung bench <hash size> <threads> "
- << "[time = 60s] [fen positions file = default]"
+ << "[time = 60s] [fen positions file = default] "
+ << "[time or depth limited = time]"
<< std::endl;
exit(0);
}
string time = argc > 4 ? argv[4] : "60";
string fen = argc > 5 ? argv[5] : "default";
<< std::endl;
exit(0);
}
string time = argc > 4 ? argv[4] : "60";
string fen = argc > 5 ? argv[5] : "default";
- benchmark(string(argv[2]) + " " + string(argv[3]) + " " + time + " " + fen);
+ string dt = argc > 6 ? argv[6] : "time";
+ benchmark(string(argv[2]) + " " + string(argv[3]) + " " + time + " " + fen + " " + dt);
if (!movesToGo) // Sudden death time control
{
if (!movesToGo) // Sudden death time control
{
{
MaxSearchTime = myTime / 30 + myIncrement;
AbsoluteMaxSearchTime = Max(myTime / 4, myIncrement - 100);
{
MaxSearchTime = myTime / 30 + myIncrement;
AbsoluteMaxSearchTime = Max(myTime / 4, myIncrement - 100);