diff --git a/src/main.cpp b/src/main.cpp index f94a322c..40081e8d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -43,7 +43,6 @@ int main(int argc, char* argv[]) { Position::init(); Bitbases::init(); Endgames::init(); - Search::init(); Threads.set(Options["Threads"]); Search::clear(); // After threads are up diff --git a/src/search.cpp b/src/search.cpp index d34e1823..55df6172 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -191,7 +191,7 @@ namespace { void Search::init() { for (int i = 1; i < MAX_MOVES; ++i) - Reductions[i] = int(23.4 * std::log(i)); + Reductions[i] = int((23.4 + std::log(Threads.size()) / 2) * std::log(i)); } diff --git a/src/thread.cpp b/src/thread.cpp index f7445f98..90ec274d 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -148,6 +148,9 @@ void ThreadPool::set(size_t requested) { // Reallocate the hash with the new threadpool size TT.resize(Options["Hash"]); + + // Init thread number dependent search params. + Search::init(); } }