- csStr >> ttSize;
- csVal >> val;
- if (val < 4 || val > 1024)
- {
- std::cerr << "The hash table size must be between 4 and 1024" << std::endl;
- exit(EXIT_FAILURE);
- }
- csStr >> threads;
- csVal >> val;
- if (val < 1 || val > THREAD_MAX)
- {
- std::cerr << "The number of threads must be between 1 and " << THREAD_MAX
- << std::endl;
- exit(EXIT_FAILURE);
- }
- set_option_value("Hash", ttSize);
- set_option_value("Threads", threads);
- set_option_value("OwnBook", "false");
- set_option_value("Use Search Log", "true");
- set_option_value("Search Log Filename", "bench.txt");
-
- csVal >> secsPerPos;
- csVal >> fileName;
-
- std::vector<std::string> positions;
-
- if (fileName != "default")
+ ttSize = argc > 2 ? argv[2] : "128";
+ threads = argc > 3 ? argv[3] : "1";
+ valStr = argc > 4 ? argv[4] : "12";
+ posFile = argc > 5 ? argv[5] : "default";
+ valType = argc > 6 ? argv[6] : "depth";
+
+ Options["Hash"].set_value(ttSize);
+ Options["Threads"].set_value(threads);
+ Options["OwnBook"].set_value("false");
+ Options["Use Search Log"].set_value("true");
+ Options["Search Log Filename"].set_value("bench.txt");
+
+ secsPerPos = maxDepth = maxNodes = 0;
+ val = atoi(valStr.c_str());
+
+ if (valType == "depth" || valType == "perft")
+ maxDepth = val;
+ else if (valType == "time")
+ secsPerPos = val * 1000;
+ else
+ maxNodes = val;
+
+ if (posFile != "default")