<p>In <a href="https://github.com/mlpack/mlpack/pull/700#discussion_r69978282">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; @@ -811,9 +841,18 @@ void LSHSearch&lt;SortPolicy&gt;::Search(const arma::mat&amp; querySet,
&gt;  
&gt;    Timer::Start(&quot;computing_neighbors&quot;);
&gt;  
&gt; -  // Go through every query point sequentially.
&gt; -  for (size_t i = 0; i &lt; querySet.n_cols; i++)
&gt; +  // Parallelization to process more than one query at a time.
&gt; +  // use as many threads possible but not more than allowed number
&gt; +  size_t numThreadsUsed = maxThreads;
&gt; +  #pragma omp parallel for \
&gt; +    num_threads ( numThreadsUsed )\
&gt; +    shared(avgIndicesReturned, resultingNeighbors, distances) \
&gt; +    schedule(dynamic)
</pre>
<p>Two questions---</p>

<ul>
<li>Is the dynamic schedule the right one to use here?  My understanding was that the dynamic schedule had more overhead.  In this case it seems like the default static schedule would be just fine.</li>
<li>I think the <code>num_threads()</code> call here will effectively set the number of threads used to the value of the environment variable <code>OMP_NUM_THREADS</code>, but that would be the same as the default anyway if you hadn't set <code>num_threads()</code>.  So it makes me think that the <code>maxThreads</code> member is unnecessary (and the other supporting functionality).</li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/700/files/c4c8ff950be8a06e06084764f188095c650b7a60#r69978282">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFOQHtpasd_G49SDSyqiRfbtlA7b_ks5qTV5tgaJpZM4I5KSz">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFIgX7esow_5IidQWkVrvSjyxGzIWks5qTV5tgaJpZM4I5KSz.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/700/files/c4c8ff950be8a06e06084764f188095c650b7a60#r69978282"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>