<?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 /debug:full /Od  but I ran it in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157140#M141912</link>
    <description>&lt;P&gt;/debug:full /Od&amp;nbsp; but I ran it in the debugger in Visual studio. The debugger picks up the exception. You should report this bug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2019 17:08:21 GMT</pubDate>
    <dc:creator>andrew_4619</dc:creator>
    <dc:date>2019-12-13T17:08:21Z</dc:date>
    <item>
      <title>implied loop for write</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157127#M141899</link>
      <description>&lt;P&gt;I have a code to write a large array.&amp;nbsp;&lt;/P&gt;&lt;P&gt;WRITE(EIN,'(1X,i8,2ES20.10)') (i,coord(i,:),i=1,nnode)&lt;/P&gt;&lt;P&gt;it stops at i=63800. Do you know why? Thanks a lot for your help in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 16:27:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157127#M141899</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-12T16:27:43Z</dc:date>
    </item>
    <item>
      <title>Because nnode is 63800 maybe?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157128#M141900</link>
      <description>&lt;P&gt;Because nnode is 63800 maybe?&lt;/P&gt;&lt;P&gt;Another point that it appears you&amp;nbsp;have Coord(N,2) which means that in memory you have all the "X" values and then all&amp;nbsp;the "Y" values which means that&amp;nbsp; the code is most likely very inefficient as you will be jumping around in memory. In Fortran&amp;nbsp; Coord(2,N) is better then the x and y for point N are next to each other,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 16:36:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157128#M141900</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2019-12-12T16:36:00Z</dc:date>
    </item>
    <item>
      <title>No. nnode is much larger than</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157129#M141901</link>
      <description>&lt;P&gt;No. nnode is much larger than 63800. Comparing to time used in other part of the code, this efficiency is not my concern. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 17:38:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157129#M141901</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-12T17:38:58Z</dc:date>
    </item>
    <item>
      <title>what do you mean by 'stops'.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157130#M141902</link>
      <description>&lt;P&gt;what do you mean by 'stops'. end of writing or program crash?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 18:18:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157130#M141902</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2019-12-12T18:18:51Z</dc:date>
    </item>
    <item>
      <title>Just silently stops and exit.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157131#M141903</link>
      <description>&lt;P&gt;Just silently stops and exit. Program does not crash. Its effect is the same as if I am doing the following&lt;/P&gt;&lt;P&gt;do i=1,63800&lt;/P&gt;&lt;P&gt;WRITE(EIN,'(1X,i8,2ES20.10)') i,coord(i,:)&lt;/P&gt;&lt;P&gt;enddo&lt;/P&gt;&lt;P&gt;stop&lt;/P&gt;&lt;P&gt;I used both ifort&amp;nbsp;Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 12.1.5.344 Build 20120612&lt;/P&gt;&lt;P&gt;and&amp;nbsp;Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.5.281 Build 20190815.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 20:24:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157131#M141903</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-12T20:24:29Z</dc:date>
    </item>
    <item>
      <title>does it terminate if you have</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157132#M141904</link>
      <description>&lt;P&gt;does it terminate if you have an explicit do loop like in #5?&amp;nbsp; Or could you try:&lt;/P&gt;&lt;P&gt;WRITE(EIN,'(1X,i8,2ES20.10)',err=1234) (i,coord(i,:),i=1,nnode)&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then have some diagnostic messages after an error jump? It may be that windows&amp;nbsp;or the fortran run time is running out of some resource.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 21:52:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157132#M141904</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2019-12-12T21:52:08Z</dc:date>
    </item>
    <item>
      <title>If I use explicit do loops,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157133#M141905</link>
      <description>&lt;P&gt;If I use explicit do loops, it works perfect. If you use what you suggest, it does not branch out, it still silently stops, no any diagnostic&amp;nbsp;info&lt;/P&gt;&lt;P&gt;WRITE(EIN,'(1X,i8,2ES20.10)',err=1234,iostat=in_stat) (i,coord(i,:),i=1,nnode)&lt;BR /&gt;1234 write(*,*)"after error", in_stat&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 22:12:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157133#M141905</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-12T22:12:37Z</dc:date>
    </item>
    <item>
      <title>If I use explicit do loops,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157134#M141906</link>
      <description>&lt;P&gt;If I use explicit do loops, it works perfect. If you use what you suggest, it does not branch out, it still silently stops, no any diagnostic&amp;nbsp;info&lt;/P&gt;&lt;P&gt;WRITE(EIN,'(1X,i8,2ES20.10)',err=1234,iostat=in_stat) (i,coord(i,:),i=1,nnode)&lt;BR /&gt;1234 write(*,*)"after error", in_stat&lt;/P&gt;&lt;P&gt;And if I forgot to tell, if I compile the code using gfortran, it works perfect. It is the ifort compiler I have problem with. I don't know whether there are some default value or some flags I should use to avoid this mistake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 22:16:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157134#M141906</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-12T22:16:28Z</dc:date>
    </item>
    <item>
      <title>You should not need any flags</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157135#M141907</link>
      <description>&lt;P&gt;You should not need any flags or settings. Please construct a small test case that demonstrates the problem.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 00:45:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157135#M141907</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-12-13T00:45:47Z</dc:date>
    </item>
    <item>
      <title>I wrote a simple code main</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157136#M141908</link>
      <description>&lt;P&gt;I wrote a simple code main.f90, compiled used ifort -O3 main.f90&lt;/P&gt;&lt;P&gt;The input file is test.txt. The results can be found at fort.50. It seems that the number stops randomly on my computer. Sometimes at 64074, sometimes at 64066. Never runs successfully on my dell latitude laptop.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 01:52:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157136#M141908</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-13T01:52:15Z</dc:date>
    </item>
    <item>
      <title>To make it simple, I change</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157137#M141909</link>
      <description>&lt;P&gt;To make it simple, I change the code to generate the test.txt file. Then to read from it and write into a different file. This code works as expected if compiled using gfortran, but not ifort. I don't know why and how to fix it if I have to use&amp;nbsp;ifort for compiling.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 15:42:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157137#M141909</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-13T15:42:25Z</dc:date>
    </item>
    <item>
      <title>PROGRAM main</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157138#M141910</link>
      <description>&lt;PRE class="brush:fortran; class-name:dark;"&gt;PROGRAM main
IMPLICIT NONE  
integer              :: i, nnode
REAL(8), ALLOCATABLE :: coord(:,:)

nnode = 65853
ALLOCATE( coord( nnode, 2 ) )
coord = 99.99e3

WRITE(50,'(1X,i8,2ES20.10)') ( i, coord(i,:) , i = 1, nnode )
write(*,*)"Finished successfully"
END&lt;/PRE&gt;

&lt;P&gt;I reduced your code and ran it under debug with&amp;nbsp;Intel(R) Visual Fortran Compiler 19.0.4.245 [IA-32]&lt;/P&gt;
&lt;P&gt;It crashes with "Exception thrown at 0x771996CF (ntdll.dll) in readtest.exe: 0xC0000005: Access violation writing location 0x00C00FFC."&lt;/P&gt;
&lt;P&gt;there is some variation&amp;nbsp; &amp;nbsp;from run to run but approx&amp;nbsp;32229 record are written. I note you had approx 64000 records&amp;nbsp; but mine was a 32 bit build&amp;nbsp;and I am guessing yours was 64 bit....&lt;/P&gt;
&lt;P&gt;This seems to me like a compiler bug to me file a bug report..&lt;/P&gt;

&lt;PRE class="brush:fortran; class-name:dark;"&gt;PROGRAM main
IMPLICIT NONE  
integer              :: i, nnode
REAL(8), ALLOCATABLE :: coord(:,:)

nnode = 65853
ALLOCATE( coord( 2, nnode ) )
coord = 99.99e3

WRITE(50,'(1X,i8,2ES20.10)') ( i, coord(:,i) , i = 1, nnode )
write(*,*)"Finished successfully"
END&lt;/PRE&gt;

&lt;P&gt;I will further add that with cord being address in the more sensible order it&amp;nbsp;runs&amp;nbsp;OK to completion. I am guessing because the non-contiguous array slice causes extra work with temporaries being created and this is where is goes wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 16:13:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157138#M141910</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2019-12-13T16:13:00Z</dc:date>
    </item>
    <item>
      <title>Thanks a lot! It is not easy</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157139#M141911</link>
      <description>&lt;P&gt;Thanks a lot! It is not easy for us to change the order. What flags you used to trigger it to report crash information?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 16:31:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157139#M141911</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-13T16:31:06Z</dc:date>
    </item>
    <item>
      <title>/debug:full /Od  but I ran it</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157140#M141912</link>
      <description>&lt;P&gt;/debug:full /Od&amp;nbsp; but I ran it in the debugger in Visual studio. The debugger picks up the exception. You should report this bug.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 17:08:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157140#M141912</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2019-12-13T17:08:21Z</dc:date>
    </item>
    <item>
      <title>Thanks a lot Andrew. I will</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157141#M141913</link>
      <description>&lt;P&gt;Thanks a lot Andrew. I will wait for Dr. Fortran's suggestion before I decide what to do.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 17:20:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157141#M141913</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-13T17:20:50Z</dc:date>
    </item>
    <item>
      <title>This would get around the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157142#M141914</link>
      <description>&lt;P&gt;This would get around the problem&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;WRITE(50,'(1X,i8,2ES20.10)') ( i, coord(1,i),coord(2,i) , i = 1, nnode )&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 18:45:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157142#M141914</guid>
      <dc:creator>GVautier</dc:creator>
      <dc:date>2019-12-13T18:45:23Z</dc:date>
    </item>
    <item>
      <title>Gilles, I can also use</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157143#M141915</link>
      <description>&lt;P&gt;Gilles, I can also use explicit loops to get around this problem without switch the orders of the index. However, in the entire code, such changes will be too many. I hope there are some flags of the compiler during compilation can help me avoid this problem. I will be surprised that such a problem has not been identified and fixed already.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 19:07:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157143#M141915</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-13T19:07:11Z</dc:date>
    </item>
    <item>
      <title>Quote:Yu, Wenbin wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157144#M141916</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Yu, Wenbin wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope there are some flags of the compiler during compilation can help me avoid this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried the &lt;EM&gt;heap-arrays&lt;/EM&gt; option?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 19:31:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157144#M141916</guid>
      <dc:creator>Ferdinand_T_</dc:creator>
      <dc:date>2019-12-13T19:31:38Z</dc:date>
    </item>
    <item>
      <title>The program is running out of</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157145#M141917</link>
      <description>&lt;P&gt;The program is running out of stack, and the stack overflow is not detected (at least when I tried it). The simplest workaround is to set the project property Linker &amp;gt; System &amp;gt; Stack Reserve Size to 100000000 (100 million) . Don't go overboard with this setting as too large a value can prevent the program from running at all.&lt;/P&gt;&lt;P&gt;I think the issue is that&amp;nbsp;coord(i,:) creates a stack temp that is not removed on each iteration through the loop. As noted already, the section you are reading into is discontiguous, so a temp is needed. I'd consider it a bug that the stack is not unwound at each iteration.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 19:48:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157145#M141917</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2019-12-13T19:48:00Z</dc:date>
    </item>
    <item>
      <title>Dear Steve, thanks a lot for</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157146#M141918</link>
      <description>&lt;P&gt;Dear Steve, thanks a lot for your advice. How to increase the stack reserve size through command line?&amp;nbsp;I don't have the IDE.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 19:50:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/implied-loop-for-write/m-p/1157146#M141918</guid>
      <dc:creator>Yu__Wenbin</dc:creator>
      <dc:date>2019-12-13T19:50:57Z</dc:date>
    </item>
  </channel>
</rss>

