- Log log(Options["Search Log Filename"]);
- log << "\nSearching: " << RootPos.fen()
- << "\ninfinite: " << Limits.infinite
- << " ponder: " << Limits.ponder
- << " time: " << Limits.time[RootColor]
- << " increment: " << Limits.inc[RootColor]
- << " moves to go: " << Limits.movestogo
- << std::endl;
- }
-
- // Reset the threads, still sleeping: will be wake up at split time
- for (size_t i = 0; i < Threads.size(); ++i)
- Threads[i]->maxPly = 0;
-
- Threads.sleepWhileIdle = Options["Idle Threads Sleep"];
-
- // Set best timer interval to avoid lagging under time pressure. Timer is
- // used to check for remaining available thinking time.
- Threads.timer->msec =
- Limits.use_time_management() ? std::min(100, std::max(TimeMgr.available_time() / 16, TimerResolution)) :
- Limits.nodes ? 2 * TimerResolution
- : 100;
-
- Threads.timer->notify_one(); // Wake up the recurring timer
-
- id_loop(RootPos); // Let's start searching !
-
- Threads.timer->msec = 0; // Stop the timer
- Threads.sleepWhileIdle = true; // Send idle threads to sleep