<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:Is there a way to load balance tasks across multiple CPUs in a system? in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1414955#M2517</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for posting in Intel Communities.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you elaborate more on your issue like which program or application you are running that you are facing this issue and also how are you launching 24 tasks?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you please provide us with the below details to investigate more on your issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;1. Sample Reproducer code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;2. Steps to follow in order to reproduce your issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Priyanshu.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 15 Sep 2022 12:02:40 GMT</pubDate>
    <dc:creator>PriyanshuK_Intel</dc:creator>
    <dc:date>2022-09-15T12:02:40Z</dc:date>
    <item>
      <title>Is there a way to load balance tasks across multiple CPUs in a system?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1414688#M2509</link>
      <description>&lt;P&gt;Is there a way to control how tasks are load-balanced across multiple CPUs in a system. I'm using a dual-CPU AWS node with 24-cores and hyperthreaded. When I split work among 24 tasks (on Windows) I see that all 24 are running on CPU 0 and none are on CPU 1. Is there a way to change this to load balance across the two CPUs, to run 12 on CPU 0 and 12 on CPU 1?&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;-Victor&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 13:04:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1414688#M2509</guid>
      <dc:creator>VictorD</dc:creator>
      <dc:date>2022-09-14T13:04:18Z</dc:date>
    </item>
    <item>
      <title>Re:Is there a way to load balance tasks across multiple CPUs in a system?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1414955#M2517</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for posting in Intel Communities.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you elaborate more on your issue like which program or application you are running that you are facing this issue and also how are you launching 24 tasks?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you please provide us with the below details to investigate more on your issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;1. Sample Reproducer code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;2. Steps to follow in order to reproduce your issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Priyanshu.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Sep 2022 12:02:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1414955#M2517</guid>
      <dc:creator>PriyanshuK_Intel</dc:creator>
      <dc:date>2022-09-15T12:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Is there a way to load balance tasks across multiple CPUs in a system?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1415220#M2527</link>
      <description>&lt;P&gt;The following is a Parallel Summation function, using TBB, which breaks the array recursively in half, until it gets to array size that is smaller than parallelThreshold, executing Serial summation then.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// left (l) boundary is inclusive and right (r) boundary is exclusive&lt;BR /&gt;inline unsigned long long SumParallel(unsigned long long in_array[], size_t l, size_t r, size_t parallelThreshold = 16 * 1024)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if (l &amp;gt;= r) // zero elements to sum&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if ((r - l) &amp;lt;= parallelThreshold)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; unsigned long long sum_left = 0;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (size_t current = l; current &amp;lt; r; current++)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sum_left += in_array[current];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return sum_left;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; unsigned long long sum_left = 0, sum_right = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; size_t m = r / 2 + l / 2 + (r % 2 + l % 2) / 2; // average without overflow&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; tbb::parallel_invoke(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&amp;amp;] { sum_left = SumParallel(in_array, l, m, parallelThreshold); },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&amp;amp;] { sum_right = SumParallel(in_array, m, r, parallelThreshold); }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; );&lt;BR /&gt;&amp;nbsp; &amp;nbsp; sum_left += sum_right;&amp;nbsp;&amp;nbsp;// Combine left and right results&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; return sum_left;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When this code is run on a 96-core AWS c5.24xlarge node by calling it in the following way, it runs on all 96 cores on both CPUs:&lt;/P&gt;
&lt;P&gt;unsigned long long sum = ParallelAlgorithms::SumParallel(u64Array, 0, u64array_size);&lt;/P&gt;
&lt;P&gt;When this code is run on the same machine in the following way, it runs on 32 cores of CPU 0 only with CPU 1 not running any work at all:&lt;/P&gt;
&lt;P&gt;unsigned long long sum = ParallelAlgorithms::SumParallel(u64Array, 0, ulongs.size(), u64array_size / 24);&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;u64array_size is 1 Billion elements, with each element being unsigned long long (64-bit unsigned).&lt;/P&gt;
&lt;P&gt;I found a way in TBB to use only one thread per core (to effectively not use hyperthreading).&lt;/P&gt;
&lt;P&gt;I would love to be able to load balance the 32 threads (not 24 as I thought earlier) across the two CPUs on this machine (CPU 0 and CPU 1), as a first order of performance optimization. Ideally, I would love for the first recursive split to be among the CPUs - i.e., left half of the array goes to CPU 0 and right half of the array goes to CPU 1, with the rest of the recursion sub-trees staying on their respective CPUs.&lt;/P&gt;
&lt;P&gt;Thanks and Regards,&lt;/P&gt;
&lt;P&gt;-Victor&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:05:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1415220#M2527</guid>
      <dc:creator>VictorD</dc:creator>
      <dc:date>2022-09-16T13:05:56Z</dc:date>
    </item>
    <item>
      <title>Re:Is there a way to load balance tasks across multiple CPUs in a system?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1416841#M2551</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You can refer to the concept of &lt;STRONG&gt;Thread-to-Core Affinity&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;It is used when we want to influence the OS so that it schedules the software threads onto particular core(s).&lt;/P&gt;&lt;P&gt;You can refer to the ProTBB Textbook, page no:358.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Priyanshu.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Sep 2022 08:51:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1416841#M2551</guid>
      <dc:creator>PriyanshuK_Intel</dc:creator>
      <dc:date>2022-09-23T08:51:48Z</dc:date>
    </item>
    <item>
      <title>Re:Is there a way to load balance tasks across multiple CPUs in a system?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1418964#M2566</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We haven't heard back from you. Could you please provide an update on your issue?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Priyanshu.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Oct 2022 04:59:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1418964#M2566</guid>
      <dc:creator>PriyanshuK_Intel</dc:creator>
      <dc:date>2022-10-03T04:59:52Z</dc:date>
    </item>
    <item>
      <title>Re:Is there a way to load balance tasks across multiple CPUs in a system?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1420968#M2584</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We have not heard back from you. This thread will no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;If you need further assistance, please post a new question.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Priyanshu.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Oct 2022 06:16:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Is-there-a-way-to-load-balance-tasks-across-multiple-CPUs-in-a/m-p/1420968#M2584</guid>
      <dc:creator>PriyanshuK_Intel</dc:creator>
      <dc:date>2022-10-11T06:16:18Z</dc:date>
    </item>
  </channel>
</rss>

