]> git.sesse.net Git - stockfish/commitdiff
Remove "Max Threads per Split Point" UCI option
authorMarco Costalba <mcostalba@gmail.com>
Sat, 15 Mar 2014 20:13:43 +0000 (21:13 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 15 Mar 2014 20:26:04 +0000 (21:26 +0100)
Experimental patch to verify if drop of nps
in endgames at very long TC is due to this.

Suggested by Ronald de Man.

bench: 7451319

polyglot.ini
src/thread.cpp
src/thread.h
src/ucioption.cpp

index b851a33abc8ca1206f6bf357adf3447746066a2c..4e825f3c4992577aa710cdc6d06f232367bd8f00 100644 (file)
@@ -30,7 +30,6 @@ Space = 100
 Aggressiveness = 100
 Cowardice = 100
 Min Split Depth = 0
 Aggressiveness = 100
 Cowardice = 100
 Min Split Depth = 0
-Max Threads per Split Point = 5
 Threads = 1
 Idle Threads Sleep = true
 Hash = 128
 Threads = 1
 Idle Threads Sleep = true
 Hash = 128
index 9e96be6eb7fa326d79b91761fe1aae73e232af8d..60c0ce71c683b0f917a8b2e28535eb8ff2548b2f 100644 (file)
@@ -88,7 +88,7 @@ Thread::Thread() /* : splitPoints() */ { // Value-initialization bug in MSVC
   maxPly = splitPointsSize = 0;
   activeSplitPoint = NULL;
   activePosition = NULL;
   maxPly = splitPointsSize = 0;
   activeSplitPoint = NULL;
   activePosition = NULL;
-  idx = Threads.size();
+  idx = Threads.size(); // Starts from 0
 }
 
 
 }
 
 
@@ -213,9 +213,8 @@ void ThreadPool::exit() {
 
 void ThreadPool::read_uci_options() {
 
 
 void ThreadPool::read_uci_options() {
 
-  maxThreadsPerSplitPoint = Options["Max Threads per Split Point"];
-  minimumSplitDepth       = Options["Min Split Depth"] * ONE_PLY;
-  size_t requested        = Options["Threads"];
+  minimumSplitDepth = Options["Min Split Depth"] * ONE_PLY;
+  size_t requested  = Options["Threads"];
 
   assert(requested > 0);
 
 
   assert(requested > 0);
 
@@ -297,12 +296,12 @@ void Thread::split(Position& pos, const Stack* ss, Value alpha, Value beta, Valu
   activeSplitPoint = &sp;
   activePosition = NULL;
 
   activeSplitPoint = &sp;
   activePosition = NULL;
 
-  size_t slavesCnt = 1; // This thread is always included
+  int slavesCnt = 1; // This thread is always included
   Thread* slave;
 
   Thread* slave;
 
-  while (    (slave = Threads.available_slave(this)) != NULL
-         && ++slavesCnt <= Threads.maxThreadsPerSplitPoint && !Fake)
+  while (!Fake && (slave = Threads.available_slave(this)) != NULL)
   {
   {
+      ++slavesCnt;
       sp.slavesMask |= 1ULL << slave->idx;
       slave->activeSplitPoint = &sp;
       slave->searching = true; // Slave leaves idle_loop()
       sp.slavesMask |= 1ULL << slave->idx;
       slave->activeSplitPoint = &sp;
       slave->searching = true; // Slave leaves idle_loop()
index c9152b229243620bb00b451f85f91e4c7e9b85e6..ddeb49021e82977175261f53872fdaac647cf3dd 100644 (file)
@@ -166,7 +166,6 @@ struct ThreadPool : public std::vector<Thread*> {
 
   bool sleepWhileIdle;
   Depth minimumSplitDepth;
 
   bool sleepWhileIdle;
   Depth minimumSplitDepth;
-  size_t maxThreadsPerSplitPoint;
   Mutex mutex;
   ConditionVariable sleepCondition;
   TimerThread* timer;
   Mutex mutex;
   ConditionVariable sleepCondition;
   TimerThread* timer;
index 68a57bd5778fbe24f1205be5ee0e3f3e04c8513f..eefacb22bc447293ae168923461614c16a68b7aa 100644 (file)
@@ -70,7 +70,6 @@ void init(OptionsMap& o) {
   o["Aggressiveness"]              = Option(100, 0, 200, on_eval);
   o["Cowardice"]                   = Option(100, 0, 200, on_eval);
   o["Min Split Depth"]             = Option(0, 0, 12, on_threads);
   o["Aggressiveness"]              = Option(100, 0, 200, on_eval);
   o["Cowardice"]                   = Option(100, 0, 200, on_eval);
   o["Min Split Depth"]             = Option(0, 0, 12, on_threads);
-  o["Max Threads per Split Point"] = Option(5, 4,  8, on_threads);
   o["Threads"]                     = Option(1, 1, MAX_THREADS, on_threads);
   o["Idle Threads Sleep"]          = Option(true);
   o["Hash"]                        = Option(32, 1, 16384, on_hash_size);
   o["Threads"]                     = Option(1, 1, MAX_THREADS, on_threads);
   o["Idle Threads Sleep"]          = Option(true);
   o["Hash"]                        = Option(32, 1, 16384, on_hash_size);