<?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 Multiple processes would be in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087922#M7227</link>
    <description>&lt;P&gt;Multiple processes would be more efficient, and a lot easier.&amp;nbsp; No need to introduce OpenMP if these are completely independent tasks.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Apr 2016 17:23:31 GMT</pubDate>
    <dc:creator>Gregg_S_Intel</dc:creator>
    <dc:date>2016-04-15T17:23:31Z</dc:date>
    <item>
      <title>run parallel(each thread running with a different set of input parameters)</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087914#M7219</link>
      <description>&lt;P&gt;Hi, I am a novice in openmp, I want to use openmp to run my code in different threads, while each thread being executed with different input parameters, so do I need to figure out all the parameters in my original code and decide which of them should be set as private?(the code has more than 6000 lines so I'm not sure if this will work). Or do you have any other ideas about this problem? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 17:53:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087914#M7219</guid>
      <dc:creator>Ming_G_</dc:creator>
      <dc:date>2016-04-13T17:53:55Z</dc:date>
    </item>
    <item>
      <title>Sure you could do that, but</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087915#M7220</link>
      <description>&lt;P&gt;Sure you could do that, but as you say it could be difficult to manage the variables for each thread. Another suggestion would be to look at the existing (serial) code, that I'm sure has multiple "for loops" that could be parallelized using &lt;STRONG&gt;#pragma omp for &lt;/STRONG&gt;constructs. Hit the most&amp;nbsp;CPU intensive loops first.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 18:08:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087915#M7220</guid>
      <dc:creator>MikeP_Intel</dc:creator>
      <dc:date>2016-04-13T18:08:25Z</dc:date>
    </item>
    <item>
      <title>Quote:Mike P. (Intel) wrote:</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087916#M7221</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Mike P. (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Sure you could do that, but as you say it could be difficult to manage the variables for each thread. Another suggestion would be to look at the existing (serial) code, that I'm sure has multiple "for loops" that could be parallelized using &lt;STRONG&gt;#pragma omp for &lt;/STRONG&gt;constructs. Hit the most&amp;nbsp;CPU intensive loops first.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thanks Mike, I have tried to modify my original code in a more parallelized manner, but still with some troubles. Like in some do loops there are callings for subroutines, so do I need to manage the parameters in the subroutines as well ? Because the code cannot run converge last time I didn't do that. &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 18:21:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087916#M7221</guid>
      <dc:creator>Ming_G_</dc:creator>
      <dc:date>2016-04-13T18:21:45Z</dc:date>
    </item>
    <item>
      <title>What the motivation for using</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087917#M7222</link>
      <description>&lt;P&gt;What the motivation for using OpenMP?&amp;nbsp; How about multiple&amp;nbsp;processes running at the same time?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 03:25:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087917#M7222</guid>
      <dc:creator>Gregg_S_Intel</dc:creator>
      <dc:date>2016-04-15T03:25:01Z</dc:date>
    </item>
    <item>
      <title>Pseudo C++ code</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087918#M7223</link>
      <description>&lt;P&gt;Pseudo C++&amp;nbsp;code&lt;/P&gt;

&lt;P&gt;OpenInputscript(fileName);&lt;BR /&gt;
	int nInputParameters = ReadNumberOfDifferentInputParameters();&lt;BR /&gt;
	#pragma omp parallel for schedule(static,1)&lt;BR /&gt;
	for(int i=0; i&amp;lt;nInputParameters; ++i)&lt;BR /&gt;
	{&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; CString inputParameters; // local string&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; ReadInputParameters(inputParameters, i); // read the i'th list of input parameters&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; DoWork(inputParameters);&lt;BR /&gt;
	}&lt;BR /&gt;
	// work done&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 14:47:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087918#M7223</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-04-15T14:47:28Z</dc:date>
    </item>
    <item>
      <title>Quote:Gregg Skinner (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087919#M7224</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Gregg Skinner (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;What the motivation for using OpenMP?&amp;nbsp; How about multiple&amp;nbsp;processes running at the same time?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I need to run my code in a server each time with 20 different set of input parameters, I guess by writing openmp I can save time doing the iterative compiling and linking work. By the way, if I run the 20 input parameters with openmp, will it be more efficient in using processors than running multiple processes at the same time? Thanks~&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 15:12:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087919#M7224</guid>
      <dc:creator>Ming_G_</dc:creator>
      <dc:date>2016-04-15T15:12:17Z</dc:date>
    </item>
    <item>
      <title>Quote:jimdempseyatthecove</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087920#M7225</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;jimdempseyatthecove wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Pseudo C++&amp;nbsp;code&lt;/P&gt;

&lt;P&gt;OpenInputscript(fileName);&lt;BR /&gt;
	int nInputParameters = ReadNumberOfDifferentInputParameters();&lt;BR /&gt;
	#pragma omp parallel for schedule(static,1)&lt;BR /&gt;
	for(int i=0; i&amp;lt;nInputParameters; ++i)&lt;BR /&gt;
	{&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; CString inputParameters; // local string&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; ReadInputParameters(inputParameters, i); // read the i'th list of input parameters&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; DoWork(inputParameters);&lt;BR /&gt;
	}&lt;BR /&gt;
	// work done&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thanks Jim! It indeed inspired me about what to do next though I use fortran for my code. My another question is, except from the different set of input parameters that need to be read from txt, I have also defined some parameters in the code, while some of them can be shared, &amp;nbsp;most of others will change according to the input parameters, so do I need to set all of them as private? &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 15:24:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087920#M7225</guid>
      <dc:creator>Ming_G_</dc:creator>
      <dc:date>2016-04-15T15:24:51Z</dc:date>
    </item>
    <item>
      <title>You either use private, or</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087921#M7226</link>
      <description>&lt;P&gt;You either use private, or you encapsulate them inside the scope of the parallel region. In Fortran this could be&lt;/P&gt;

&lt;P&gt;!$OMP PARALLEL DO SCHEDULE(DYNAMIC,1)&lt;BR /&gt;
	DO I=1,nInputParamerters&lt;BR /&gt;
	&amp;nbsp; CALL ReadInputParametersAndDoWork(I)&lt;BR /&gt;
	END DO&lt;BR /&gt;
	...&lt;BR /&gt;
	SUBROUTINE ReadInputParametersAndDoWork(I)&lt;BR /&gt;
	&amp;nbsp; implicit none&lt;BR /&gt;
	&amp;nbsp; integer :: I&lt;BR /&gt;
	&amp;nbsp; character(len=500) :: InputParameters&lt;BR /&gt;
	&amp;nbsp; real :: PrivateArray(nnn)&lt;BR /&gt;
	&amp;nbsp; call ReadInputParameters(InputParameters, I)&lt;BR /&gt;
	&amp;nbsp; call DoWork(inputParameters, PrivateArray)&lt;BR /&gt;
	end do&lt;/P&gt;

&lt;P&gt;You can control the private/shared property by scoping (local variables or modual variables). The above assumes the shared variables are in a module (or common). Whereas the private data was instantiated within the context of a procedure called inside a parallel region. You would want to restrict the use of the PRIVATE clause to where it is only necessary. Placing a large number of variables in a PRIVATE clause is messy, and prone to error.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 16:15:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087921#M7226</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-04-15T16:15:33Z</dc:date>
    </item>
    <item>
      <title>Multiple processes would be</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087922#M7227</link>
      <description>&lt;P&gt;Multiple processes would be more efficient, and a lot easier.&amp;nbsp; No need to introduce OpenMP if these are completely independent tasks.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 17:23:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087922#M7227</guid>
      <dc:creator>Gregg_S_Intel</dc:creator>
      <dc:date>2016-04-15T17:23:31Z</dc:date>
    </item>
    <item>
      <title>Gregg,</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087923#M7228</link>
      <description>&lt;P&gt;Gregg,&lt;/P&gt;

&lt;P&gt;Not necessarily so. You would still need to have a loop to create the processes. Create Process takes longer than to Create Thread, plus if the number of input parameters exceed the number of logical processors on your system, your Create Process loop would oversubscribe the system. If you try to correct for this by adding inter-process communication, you've added overhead and latencies not present in the OpenMP design.&lt;/P&gt;

&lt;P&gt;Also, if you pre-parse the list of parameter sets, and pre-build a pick list for each process (to avoid oversubscription), you then loose the ability to load balance should the per-process subsets take different amount of run time.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sun, 17 Apr 2016 13:39:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087923#M7228</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-04-17T13:39:47Z</dc:date>
    </item>
    <item>
      <title>For embarrassingly parallel,</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087924#M7229</link>
      <description>&lt;P&gt;For embarrassingly parallel, which this appears to be, OpenMP would typically be syntactic overkill.&amp;nbsp; Difference between Create Process and Create Thread seems trivial&amp;nbsp;when it only happens once.&amp;nbsp; Avoiding oversubscription seems equally easy with or without OpenMP.&lt;/P&gt;

&lt;P&gt;I bring it up because sometimes folks forget the most efficient parallel execution&amp;nbsp;is multiple serial jobs running simultaneously.&lt;/P&gt;

&lt;P&gt;For load balancing embarrassingly parallel work, a batch scheduler would be an improvement over OpenMP chunking.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2016 19:59:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087924#M7229</guid>
      <dc:creator>Gregg_S_Intel</dc:creator>
      <dc:date>2016-04-18T19:59:00Z</dc:date>
    </item>
    <item>
      <title>Funny that you mention it.  A</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087925#M7230</link>
      <description>&lt;P&gt;Funny that you mention it. &amp;nbsp;A major electric grid application was upgraded recently from multiple independent single thread tasks to boost threaded. &amp;nbsp;Among adverse effects was that it would lose numa locality when swapped out and back in.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 12:57:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/run-parallel-each-thread-running-with-a-different-set-of-input/m-p/1087925#M7230</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2016-04-19T12:57:11Z</dc:date>
    </item>
  </channel>
</rss>

