<?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 &amp;gt;&amp;gt;...At least you can somehow in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007809#M6468</link>
    <description>&amp;gt;&amp;gt;...At least you can somehow compensate for the "slowness" of virtual memory...

Actually, I "fight" with that by increasing a Working Set Size ( WSS ) for my set of Windows applications and spent lots of time trying to understand what is the best value for the WSS. It is a really tricky thing. It looks like an application needs as bigger as possible "window" to the Virtual Memory and that is wrong. My evaluations show that some middle-like values for the WSS are better.</description>
    <pubDate>Mon, 12 Oct 2015 22:02:00 GMT</pubDate>
    <dc:creator>SergeyKostrov</dc:creator>
    <dc:date>2015-10-12T22:02:00Z</dc:date>
    <item>
      <title>Stack size is not big enought</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007799#M6458</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;
	I have an issue regarding stacksize and ifort (Parallel Studio XE Composer). For my computations I divide an huge array into small pieces and every node submitted to the run does the computations for one part. Below a chunk of code:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;real         ::  p(200,200,400)
integer      ::  ib,ie,jb,je,kb,ke 
...
ib=1;ie=199
jb=2;je=198
kb=2;ke=398
call  SOLVE_POI_EQ(rank,p(ib:ie,jb:je,kb:ke),R)&lt;/PRE&gt;

&lt;P&gt;The problem here is that when I reduce the number of nodes, the code crashes with an `Segmentation Fault` when I call `SOLVE_POI_EQ`. I use linux and when I set the stack size to unlimited: `ulimit -s unlimited` it works.&lt;/P&gt;

&lt;P&gt;I'm now worried that I overwrite parts of my OS (can that happen?)!&lt;/P&gt;

&lt;P&gt;Is there a better way to address this issue?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 05:50:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007799#M6458</guid>
      <dc:creator>Christoph_I_</dc:creator>
      <dc:date>2015-09-01T05:50:01Z</dc:date>
    </item>
    <item>
      <title>You will never overwrite</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007800#M6459</link>
      <description>&lt;P&gt;You will never overwrite parts of the O/S. Your application runs in Virtual Memory.&lt;/P&gt;

&lt;P&gt;Fortran has an option to place large local objects in the heap. -heap-arrays [size] (Linux), /heap-arrays[:size] (Windows)&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 12:47:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007800#M6459</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2015-09-01T12:47:27Z</dc:date>
    </item>
    <item>
      <title>Thanks! That works fine. But</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007801#M6460</link>
      <description>&lt;P&gt;Thanks! That works fine. But how about the runtime, will the code be slowed down when I use the&amp;nbsp;-heap-arrays?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 13:01:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007801#M6460</guid>
      <dc:creator>Christoph_I_</dc:creator>
      <dc:date>2015-09-01T13:01:59Z</dc:date>
    </item>
    <item>
      <title>This is simply a generic</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007802#M6461</link>
      <description>This is simply a generic comment related to some issues with a size of stack...

I recently tried to set a size of the stack for a 64-bit application compiled with Intel C++ compiler ( Windows version ) greater then 1 GB and Intel C++ compiler Not allowed to set it. So, as you can see the size of a stack can Not be unlimited.</description>
      <pubDate>Thu, 03 Sep 2015 21:35:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007802#M6461</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2015-09-03T21:35:19Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...will the code be slowed</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007803#M6462</link>
      <description>&amp;gt;&amp;gt;...will the code be slowed down when I use the -heap-arrays?

No, it will not.

However, if ALL your data sets do not fit a Physical Memory then Virtual Memory will be used and performance of computations will be affected.</description>
      <pubDate>Thu, 03 Sep 2015 21:38:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007803#M6462</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2015-09-03T21:38:36Z</dc:date>
    </item>
    <item>
      <title>At least you can somehow</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007804#M6463</link>
      <description>&lt;P&gt;At least you can somehow compensate for the "slowness" of virtual memory by using SSD drive for swap page.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 12:17:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007804#M6463</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2015-09-16T12:17:15Z</dc:date>
    </item>
    <item>
      <title>Should have written "swap</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007805#M6464</link>
      <description>&lt;P&gt;Should have written "swap space"&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 12:18:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007805#M6464</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2015-09-16T12:18:06Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;&gt;I'm now worried that I</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007806#M6465</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 20px;"&gt;&amp;gt;&amp;gt;&amp;gt;I'm now worried that I overwrite parts of my OS (can that happen?)!&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 20px;"&gt;As Jim said it will not happen.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 20px;"&gt;I think that in your case running program simply consumed all allocated stack space thus triggering segmentation fault when addresses range being referenced where mapped to reserved or uncommited memory.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 12:22:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007806#M6465</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2015-09-16T12:22:05Z</dc:date>
    </item>
    <item>
      <title>Perfect so no reacent to</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007807#M6466</link>
      <description>&lt;P&gt;Perfect so no reacent to worry about killing my os or slowing the code down. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2015 05:15:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007807#M6466</guid>
      <dc:creator>Christoph_I_</dc:creator>
      <dc:date>2015-09-17T05:15:26Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;&gt;Perfect so no reacent to</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007808#M6467</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 20px;"&gt;&amp;gt;&amp;gt;&amp;gt;Perfect so no reacent to worry about killing my os or slowing the code down. Thanks!&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 20px;"&gt;Unless you will start writing kernel code and overwrite somehow critical structures:)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2015 19:13:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007808#M6467</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2015-09-17T19:13:11Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...At least you can somehow</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007809#M6468</link>
      <description>&amp;gt;&amp;gt;...At least you can somehow compensate for the "slowness" of virtual memory...

Actually, I "fight" with that by increasing a Working Set Size ( WSS ) for my set of Windows applications and spent lots of time trying to understand what is the best value for the WSS. It is a really tricky thing. It looks like an application needs as bigger as possible "window" to the Virtual Memory and that is wrong. My evaluations show that some middle-like values for the WSS are better.</description>
      <pubDate>Mon, 12 Oct 2015 22:02:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007809#M6468</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2015-10-12T22:02:00Z</dc:date>
    </item>
    <item>
      <title>Hi Sergey,</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007810#M6469</link>
      <description>&lt;P&gt;Hi Sergey,&lt;/P&gt;

&lt;P&gt;Can you write what settings are you using for WSS?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 18:03:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007810#M6469</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2015-12-15T18:03:52Z</dc:date>
    </item>
    <item>
      <title>@Sergey</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007811#M6470</link>
      <description>&lt;P&gt;@Sergey&lt;/P&gt;

&lt;P&gt;Do you manipulate WSS programatically?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 18:19:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007811#M6470</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2015-12-15T18:19:38Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;Can you write what settings</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007812#M6471</link>
      <description>&amp;gt;&amp;gt;Can you write what settings are you using for WSS?

After many tests I decided to set the Working Set Size to 384MB and this is the value when I saw some performance improvements.</description>
      <pubDate>Sun, 31 Jan 2016 19:12:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007812#M6471</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2016-01-31T19:12:15Z</dc:date>
    </item>
    <item>
      <title>Yes, below is a very simple</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007813#M6472</link>
      <description>Yes, below is a very simple piece of codes that sets WSS:
...
dwMinPwsSize = 384 * 1024 * 1024;
dwMaxPwsSize = 384 * 1024 * 1024;
if( ::SetProcessWorkingSetSize( hProcess, dwMinPwsSize, dwMaxPwsSize ) == 0 )
{
	CrtPrintf( RTU("SetProcessWorkingSetSize - Failed\n") );
	break;
}
...
Take into account, that in order to set WSS for a process two Access Rights flags ( &lt;STRONG&gt;PROCESS_SET_QUOTA&lt;/STRONG&gt; and &lt;STRONG&gt;PROCESS_QUERY_INFORMATION&lt;/STRONG&gt; ) need to be set before a call to &lt;STRONG&gt;SetProcessWorkingSetSize&lt;/STRONG&gt;.</description>
      <pubDate>Sun, 31 Jan 2016 19:16:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007813#M6472</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2016-01-31T19:16:42Z</dc:date>
    </item>
    <item>
      <title>Here is some additional</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007814#M6473</link>
      <description>Here is some additional follow up:

&amp;gt;&amp;gt;...when I reduce the number of nodes, the code crashes with an `&lt;STRONG&gt;Segmentation Fault&lt;/STRONG&gt;`...

When something is wrong with the stack an error message always has the word &lt;STRONG&gt;Stack&lt;/STRONG&gt; in it. So, &lt;STRONG&gt;Segmentation Fault&lt;/STRONG&gt; message means for me:

- A memory block was Not allocated because it was too big ( Requested Size Of Memory &amp;gt; Available Size Of Memory ( Physical + Virtual ) )
- The application did Not verify that a pointer to that memory block had NULL value
- Processing continued and the application crashed with the error message '...&lt;STRONG&gt;Segmentation Fault&lt;/STRONG&gt;...'

A very simple way to prevent such errors is to set a Virtual Memory &lt;STRONG&gt;Maximum Size limit&lt;/STRONG&gt; to as higher as possible value. For example, on one of my computers the &lt;STRONG&gt;Maximum Size limit&lt;/STRONG&gt; is set to &lt;STRONG&gt;192GB&lt;/STRONG&gt; ( the system has &lt;STRONG&gt;32GB&lt;/STRONG&gt; of Physical memory ). It guarantees that for most cases I deal with the memory will be always allocated.

Of course, all pointers need to be verified before processing continues and an algorithm needs to handle all cases when pointers have NULL after some memory allocation was requested.</description>
      <pubDate>Sun, 31 Jan 2016 19:39:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007814#M6473</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2016-01-31T19:39:00Z</dc:date>
    </item>
    <item>
      <title>Many classic well-known</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007815#M6474</link>
      <description>Many classic well-known algorithms are &lt;STRONG&gt;Recursive&lt;/STRONG&gt; and they always use &lt;STRONG&gt;Stack&lt;/STRONG&gt; during processing. When it comes to &lt;STRONG&gt;Big Data&lt;/STRONG&gt; processing they fail and the only way to solve that problem is to make all memory requests to the &lt;STRONG&gt;Heap&lt;/STRONG&gt;. This is Not a simple task but it is Not too hard, or unsolvable, task.

I followed that concept and re-implemented &lt;STRONG&gt;Merge Sort&lt;/STRONG&gt; algorithm to sort very big data sets and I called my version as &lt;STRONG&gt;Merge Sort Adaptive&lt;/STRONG&gt; ( MSA ). During final phase of merging two already sorted sub-sets of data &lt;STRONG&gt;MSA&lt;/STRONG&gt; uses the &lt;STRONG&gt;Heap&lt;/STRONG&gt; instead of the &lt;STRONG&gt;Stack&lt;/STRONG&gt; as soon as some limit is reach ( for example, 512MB, or higher ).

Another example is &lt;STRONG&gt;Strassen Matrix Multiplication&lt;/STRONG&gt; algorithm. It is also recursive and in case of very large matrices ( greater than 32K x 32K ) the amount of memory allocated on the &lt;STRONG&gt;Stack&lt;/STRONG&gt; is &lt;STRONG&gt;huge&lt;/STRONG&gt;. In order to solve that problem and to make the algorithm more flexible I switched all memory requests to the &lt;STRONG&gt;Heap&lt;/STRONG&gt;.</description>
      <pubDate>Sun, 31 Jan 2016 20:05:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007815#M6474</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2016-01-31T20:05:54Z</dc:date>
    </item>
    <item>
      <title>Intel advice from not too</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007816#M6475</link>
      <description>&lt;P&gt;Intel advice from not too long ago recommended against using heap inside OpenMP parallel regions.&amp;nbsp; Then it seems there have been some efforts made to help out with this combination.&amp;nbsp; So I don't know the latest word.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jan 2016 22:43:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007816#M6475</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2016-01-31T22:43:42Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...Should have written</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007817#M6476</link>
      <description>&amp;gt;&amp;gt;...Should have written "swap space"

I don't think so.</description>
      <pubDate>Mon, 08 Feb 2016 01:49:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007817#M6476</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2016-02-08T01:49:14Z</dc:date>
    </item>
    <item>
      <title>Sergey,</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007818#M6477</link>
      <description>&lt;P&gt;Sergey,&lt;/P&gt;

&lt;P&gt;You can also have an allocation that succeeds (returns non-null pointer), and then have the error occur later when the allocation is use as a first time use, which then causes a page fault should the page file become exhausted. IOW allocation works - program fails due to lack of resources.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2016 13:46:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Stack-size-is-not-big-enought/m-p/1007818#M6477</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-02-08T13:46:33Z</dc:date>
    </item>
  </channel>
</rss>

