mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-24 05:37:13 +00:00
Merge commit '60351b9df901ff5278f208a9cf3a40059ff54832' into cluster
This is the last commit before there are more conflicts.
This commit is contained in:
+10
-3
@@ -47,8 +47,8 @@ namespace NN = Eval::NNUE;
|
||||
constexpr auto StartFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
|
||||
constexpr int MaxHashMB = Is64Bit ? 33554432 : 2048;
|
||||
|
||||
Engine::Engine(std::string path) :
|
||||
binaryDirectory(CommandLine::get_binary_directory(path)),
|
||||
Engine::Engine(std::optional<std::string> path) :
|
||||
binaryDirectory(path ? CommandLine::get_binary_directory(*path) : ""),
|
||||
numaContext(NumaConfig::from_system()),
|
||||
states(new std::deque<StateInfo>(1)),
|
||||
threads(),
|
||||
@@ -91,7 +91,9 @@ Engine::Engine(std::string path) :
|
||||
options["nodestime"] << Option(0, 0, 10000);
|
||||
options["UCI_Chess960"] << Option(false);
|
||||
options["UCI_LimitStrength"] << Option(false);
|
||||
options["UCI_Elo"] << Option(1320, 1320, 3190);
|
||||
options["UCI_Elo"] << Option(Stockfish::Search::Skill::LowestElo,
|
||||
Stockfish::Search::Skill::LowestElo,
|
||||
Stockfish::Search::Skill::HighestElo);
|
||||
options["UCI_ShowWDL"] << Option(false);
|
||||
options["SyzygyPath"] << Option("", [](const Option& o) {
|
||||
Tablebases::init(o);
|
||||
@@ -202,6 +204,7 @@ void Engine::set_numa_config_from_option(const std::string& o) {
|
||||
|
||||
// Force reallocation of threads in case affinities need to change.
|
||||
resize_threads();
|
||||
threads.ensure_network_replicated();
|
||||
}
|
||||
|
||||
void Engine::resize_threads() {
|
||||
@@ -210,6 +213,7 @@ void Engine::resize_threads() {
|
||||
|
||||
// Reallocate the hash with the new threadpool size
|
||||
set_tt_size(options["Hash"]);
|
||||
threads.ensure_network_replicated();
|
||||
}
|
||||
|
||||
void Engine::set_tt_size(size_t mb) {
|
||||
@@ -235,18 +239,21 @@ void Engine::load_networks() {
|
||||
networks_.small.load(binaryDirectory, options["EvalFileSmall"]);
|
||||
});
|
||||
threads.clear();
|
||||
threads.ensure_network_replicated();
|
||||
}
|
||||
|
||||
void Engine::load_big_network(const std::string& file) {
|
||||
networks.modify_and_replicate(
|
||||
[this, &file](NN::Networks& networks_) { networks_.big.load(binaryDirectory, file); });
|
||||
threads.clear();
|
||||
threads.ensure_network_replicated();
|
||||
}
|
||||
|
||||
void Engine::load_small_network(const std::string& file) {
|
||||
networks.modify_and_replicate(
|
||||
[this, &file](NN::Networks& networks_) { networks_.small.load(binaryDirectory, file); });
|
||||
threads.clear();
|
||||
threads.ensure_network_replicated();
|
||||
}
|
||||
|
||||
void Engine::save_network(const std::pair<std::optional<std::string>, std::string> files[2]) {
|
||||
|
||||
Reference in New Issue
Block a user