Check for an available slave early on
authorMarco Costalba <mcostalba@gmail.com>
Sun, 8 Jun 2014 19:56:31 +0000 (04:56 +0900)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 8 Jun 2014 19:56:31 +0000 (04:56 +0900)
Don't take the split lock if we don't have
available slaves (about 30-40% of times).

This new condition allows to retire the now
redundant one on number of threads.

No functional change.

src/search.cpp

index 5cdc01698f2425462fdb7ff8929fb29d55c7dcbd..e24d264d551bd617cc293a34ca0c570ef28d9fe6 100644 (file)
@@ -980,8 +980,8 @@ moves_loop: // When in check and at SpNode search starts from here
 
       // Step 19. Check for splitting the search
       if (   !SpNode
-          &&  Threads.size() >= 2
           &&  depth >= Threads.minimumSplitDepth
+          &&  Threads.available_slave(thisThread)
           &&  (   !thisThread->activeSplitPoint
                || !thisThread->activeSplitPoint->allSlavesSearching)
           &&  thisThread->splitPointsSize < MAX_SPLITPOINTS_PER_THREAD)