Answers.Body: <p>As the excerpt below says, </p>
  
  <blockquote>
    <p>A thread pool dedicated to a given NUMA node is enabled only when the
    number of threads to be created on that NUMA node is explicitly
    mentioned in that corresponding position</p>
  </blockquote>
  
  <p><code>"+,-,+"</code>  --> no numerals stated, hence a single pool.</p>
  
  <p><code>"8,+,+,+"</code> --> numeral for node 0, hence that's one pool. The other nodes have no numerals, hence any threads spawned there are managed within a consolidated (2nd) pool.</p>
  
  <p>No experience with NUMA, just parsing the quoted doc.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-19T12:48:02.753Z
Answers.LastActivityDate: 2017-10-19T12:48:02.753Z
Answers.UserDisplayName: Gyan
Body: <p>I have the following scenario: Using libx265 and a dual-socket system (thus 2 NUMA nodes) I want to encode videos using ffmpeg and libx265. libx265 can be configured to use thread-pools which are isolated to one NUMA node, using its <code>--pools</code>-parameter (<a href="http://x265.readthedocs.io/en/default/cli.html#cmdoption-pools" rel="nofollow noreferrer">docs</a>).</p>
  <p>There a few examples in the docs which I do not fully comprehend. The examples there are for a 4-node system. Quoting from the doc:</p>
  <blockquote>
  <p><code>'+'</code>  is a special value indicating all cores detected on the node</p>
  <p><code>'*'</code>  is a special value indicating all cores detected on the node and all remaining nodes</p>
  <p><code>'-'</code>  is a special value indicating no cores on the node, same as '0'</p>
  <p>A thread pool dedicated to a given NUMA node is enabled only when the number of threads to be created on that NUMA node is explicitly mentioned in that corresponding position with the –pools option. Else, all threads are spawned from a single pool. The total number of threads will be determined by the number of threads assigned to the enabled NUMA nodes for that pool. The worker threads are be given affinity to all the enabled NUMA nodes for that pool and may migrate between them, unless explicitly specified as described above.</p>
  </blockquote>
  <p>I am not sure how the thread-count and the pool-count can be explicitly specified and would be happy if someone could explain these examples, taken from the docs:</p>
  <ul>
  <li><code>&quot;+,-,+&quot;   - allocate one pool, using only cores on nodes 0 and 2</code>
  <ul>
  <li><strong>Q</strong>: Why is this not allocating 2 pools on nodes 0 &amp; 2?</li>
  </ul>
  </li>
  <li><code>&quot;8,8,8,8&quot; - allocate four pools with up to 8 threads in each pool</code>
  <ul>
  <li><strong>Q</strong>: Why is this now allocating 4 pools, <strong>while the next example</strong></li>
  </ul>
  </li>
  <li><code>&quot;8,+,+,+&quot; - allocate two pools, the first with 8 threads on node 0, and the second with all cores on node 1,2,3</code>
  <ul>
  <li><strong>Q</strong>: .. is only allocating 2 pools?</li>
  </ul>
  </li>
  </ul>
  <p>In my case, I will have access to 2 nodes x 12 &quot;cores&quot; and was thinking of 1-3 ffmpeg encoding-processes per node (which would yield pool sizes of 12, 6 or 4 &quot;cores&quot;).</p>
  
Tags: <ffmpeg><encoding><h265>
Title: libx265 NUMA pool configuration misleading
UserDisplayName: user654123
ThreadText: # libx265 NUMA pool configuration misleading
  
  (Asked by: username_0 on 2017-10-19)
  
  I have the following scenario: Using libx265 and a dual-socket system (thus 2 NUMA nodes) I want to encode videos using ffmpeg and libx265. libx265 can be configured to use thread-pools which are isolated to one NUMA node, using its `--pools`-parameter ([docs](http://x265.readthedocs.io/en/default/cli.html#cmdoption-pools)).
  
  There a few examples in the docs which I do not fully comprehend. The examples there are for a 4-node system. Quoting from the doc:
  
  > `'+'` is a special value indicating all cores detected on the node
  >
  > `'*'` is a special value indicating all cores detected on the node and all remaining nodes
  >
  > `'-'` is a special value indicating no cores on the node, same as '0'
  >
  > A thread pool dedicated to a given NUMA node is enabled only when the number of threads to be created on that NUMA node is explicitly mentioned in that corresponding position with the –pools option. Else, all threads are spawned from a single pool. The total number of threads will be determined by the number of threads assigned to the enabled NUMA nodes for that pool. The worker threads are be given affinity to all the enabled NUMA nodes for that pool and may migrate between them, unless explicitly specified as described above.
  
  I am not sure how the thread-count and the pool-count can be explicitly specified and would be happy if someone could explain these examples, taken from the docs:
  
  * `"+,-,+" - allocate one pool, using only cores on nodes 0 and 2`
    + **Q**: Why is this not allocating 2 pools on nodes 0 & 2?
  * `"8,8,8,8" - allocate four pools with up to 8 threads in each pool`
    + **Q**: Why is this now allocating 4 pools, **while the next example**
  * `"8,+,+,+" - allocate two pools, the first with 8 threads on node 0, and the second with all cores on node 1,2,3`
    + **Q**: .. is only allocating 2 pools?
  
  In my case, I will have access to 2 nodes x 12 "cores" and was thinking of 1-3 ffmpeg encoding-processes per node (which would yield pool sizes of 12, 6 or 4 "cores").
  
  **Tags:** ffmpeg, encoding, h265
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-10-19. Score: 1 | Accepted answer
  
  As the excerpt below says,
  
  > A thread pool dedicated to a given NUMA node is enabled only when the
  > number of threads to be created on that NUMA node is explicitly
  > mentioned in that corresponding position
  
  `"+,-,+"` --> no numerals stated, hence a single pool.
  
  `"8,+,+,+"` --> numeral for node 0, hence that's one pool. The other nodes have no numerals, hence any threads spawned there are managed within a consolidated (2nd) pool.
  
  No experience with NUMA, just parsing the quoted doc.
  
  
  ---
  
  