Skip to content

Commit

Permalink
Remove "Max Threads per Split Point" UCI option
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mcostalba committed Mar 15, 2014
1 parent 6e4b4c4 commit a1a7bc8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion polyglot.ini
Expand Up @@ -30,7 +30,6 @@ Space = 100
Aggressiveness = 100
Cowardice = 100
Min Split Depth = 0
Max Threads per Split Point = 5
Threads = 1
Idle Threads Sleep = true
Hash = 128
Expand Down
13 changes: 6 additions & 7 deletions src/thread.cpp
Expand Up @@ -88,7 +88,7 @@ Thread::Thread() /* : splitPoints() */ { // Value-initialization bug in MSVC
maxPly = splitPointsSize = 0;
activeSplitPoint = NULL;
activePosition = NULL;
idx = Threads.size();
idx = Threads.size(); // Starts from 0
}


Expand Down Expand Up @@ -213,9 +213,8 @@ void ThreadPool::exit() {

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);

Expand Down Expand Up @@ -297,12 +296,12 @@ void Thread::split(Position& pos, const Stack* ss, Value alpha, Value beta, Valu
activeSplitPoint = &sp;
activePosition = NULL;

size_t slavesCnt = 1; // This thread is always included
int slavesCnt = 1; // This thread is always included
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()
Expand Down
1 change: 0 additions & 1 deletion src/thread.h
Expand Up @@ -166,7 +166,6 @@ struct ThreadPool : public std::vector<Thread*> {

bool sleepWhileIdle;
Depth minimumSplitDepth;
size_t maxThreadsPerSplitPoint;
Mutex mutex;
ConditionVariable sleepCondition;
TimerThread* timer;
Expand Down
1 change: 0 additions & 1 deletion src/ucioption.cpp
Expand Up @@ -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["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);
Expand Down

0 comments on commit a1a7bc8

Please sign in to comment.