<?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 Recursive I/O operation in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Recursive-I-O-operation/m-p/824107#M5006</link>
    <description>Hello!&lt;BR /&gt;I'm coding pretty big program on cluster, and in one of the subroutines (big_one) I have 2 external routines (their codes are in the end of my message) for computing max eigenvalue. When I'm using one of them, program works. When I'm using another one program exits with error:&lt;BR /&gt;&lt;PRE&gt;forrtl: severe (40): recursive I/O operation, unit -1, file unknown&lt;/PRE&gt;I don't understand logic of error's appearence. It connected somehow with operators sort of "write(*,*) .... ", but why there is recursive operation, I don't know. By throwing out such operators I can delay error, but eventually it happens around such operator. Maybe, deleting all of them will help, but I'd like to understand what's happening. I'll be grateful for any suggestions and advice.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1) routine, which works:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;END SUBROUTINE big_one&lt;BR /&gt; &lt;BR /&gt; real*8 function maxermeig(N,A) !ne uchityvaetsa symmetrichnost'&lt;BR /&gt; !computes maximal eigenvalue of (A+A*)/2 &lt;BR /&gt; implicit none &lt;BR /&gt;&lt;BR /&gt; integer, intent (in) :: N&lt;BR /&gt; real*8 RWORK(N), eig_max&lt;BR /&gt; complex*16, intent (in) :: A(N,N)&lt;BR /&gt; complex*16 VL(1,1), VR(1,1), W(N), WORK(3*N)&lt;BR /&gt; integer INFO, LDA, LDVL, LDVR, LWORK, i&lt;BR /&gt;&lt;BR /&gt; LDA=N&lt;BR /&gt; LDVL=1&lt;BR /&gt; LDVR=1&lt;BR /&gt; LWORK=3*N&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; call ZGEEV('N','N',N,(A+conjg(transpose(A)))/2.d0,LDA,W,vL,LDVL,VR,LDVR,WORK,LWORK,RWORK,INFO)&lt;BR /&gt; if (INFO.ne.0) then&lt;BR /&gt;  write(*,*) 'maxermeig warning, info=',INFO&lt;BR /&gt; endif&lt;BR /&gt;&lt;BR /&gt; eig_max=-4.D+100&lt;BR /&gt; do i=1,N&lt;BR /&gt; if (dble(w(i)).gt.eig_max) then&lt;BR /&gt; eig_max=dble(w(i))&lt;BR /&gt; endif&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; maxermeig=eig_max&lt;BR /&gt;&lt;BR /&gt; end function maxermeig&lt;BR /&gt;&lt;BR /&gt;2) routine, which crushes program:&lt;BR /&gt;&lt;BR /&gt;Unfortunately, cluster has gone down and I don't have its code right now. The thing is - matrix is symmetric, so I wanted to use this and find it's eigenvalue by proper routines. I used zhetrd to reduce matrix and dsterg to solve problem.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sat, 12 May 2012 14:34:53 GMT</pubDate>
    <dc:creator>Duke_K</dc:creator>
    <dc:date>2012-05-12T14:34:53Z</dc:date>
    <item>
      <title>Recursive I/O operation</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Recursive-I-O-operation/m-p/824107#M5006</link>
      <description>Hello!&lt;BR /&gt;I'm coding pretty big program on cluster, and in one of the subroutines (big_one) I have 2 external routines (their codes are in the end of my message) for computing max eigenvalue. When I'm using one of them, program works. When I'm using another one program exits with error:&lt;BR /&gt;&lt;PRE&gt;forrtl: severe (40): recursive I/O operation, unit -1, file unknown&lt;/PRE&gt;I don't understand logic of error's appearence. It connected somehow with operators sort of "write(*,*) .... ", but why there is recursive operation, I don't know. By throwing out such operators I can delay error, but eventually it happens around such operator. Maybe, deleting all of them will help, but I'd like to understand what's happening. I'll be grateful for any suggestions and advice.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1) routine, which works:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;END SUBROUTINE big_one&lt;BR /&gt; &lt;BR /&gt; real*8 function maxermeig(N,A) !ne uchityvaetsa symmetrichnost'&lt;BR /&gt; !computes maximal eigenvalue of (A+A*)/2 &lt;BR /&gt; implicit none &lt;BR /&gt;&lt;BR /&gt; integer, intent (in) :: N&lt;BR /&gt; real*8 RWORK(N), eig_max&lt;BR /&gt; complex*16, intent (in) :: A(N,N)&lt;BR /&gt; complex*16 VL(1,1), VR(1,1), W(N), WORK(3*N)&lt;BR /&gt; integer INFO, LDA, LDVL, LDVR, LWORK, i&lt;BR /&gt;&lt;BR /&gt; LDA=N&lt;BR /&gt; LDVL=1&lt;BR /&gt; LDVR=1&lt;BR /&gt; LWORK=3*N&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; call ZGEEV('N','N',N,(A+conjg(transpose(A)))/2.d0,LDA,W,vL,LDVL,VR,LDVR,WORK,LWORK,RWORK,INFO)&lt;BR /&gt; if (INFO.ne.0) then&lt;BR /&gt;  write(*,*) 'maxermeig warning, info=',INFO&lt;BR /&gt; endif&lt;BR /&gt;&lt;BR /&gt; eig_max=-4.D+100&lt;BR /&gt; do i=1,N&lt;BR /&gt; if (dble(w(i)).gt.eig_max) then&lt;BR /&gt; eig_max=dble(w(i))&lt;BR /&gt; endif&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; maxermeig=eig_max&lt;BR /&gt;&lt;BR /&gt; end function maxermeig&lt;BR /&gt;&lt;BR /&gt;2) routine, which crushes program:&lt;BR /&gt;&lt;BR /&gt;Unfortunately, cluster has gone down and I don't have its code right now. The thing is - matrix is symmetric, so I wanted to use this and find it's eigenvalue by proper routines. I used zhetrd to reduce matrix and dsterg to solve problem.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 12 May 2012 14:34:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Recursive-I-O-operation/m-p/824107#M5006</guid>
      <dc:creator>Duke_K</dc:creator>
      <dc:date>2012-05-12T14:34:53Z</dc:date>
    </item>
    <item>
      <title>Recursive I/O operation</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Recursive-I-O-operation/m-p/824108#M5007</link>
      <description>The error is probably in the part of the code that you did not show. If you have a WRITE statement in which the I/O list contains an expression with a reference to the function &lt;B&gt;maxermeig&lt;/B&gt;, and the variable INFO happens to have such a value as to attempt to do I/O in that function, then you will have a situation of recursive I/O, which will either give you a run-time error or mysterious crashes.&lt;BR /&gt;&lt;BR /&gt;The cure is simple. Instead of coding&lt;BR /&gt;&lt;BR /&gt; write(..,..) aa,bb,maxermeig(...),...&lt;BR /&gt;&lt;BR /&gt;do&lt;BR /&gt; &lt;BR /&gt; tmpvar = maxermeig(...)&lt;BR /&gt; write(...,...) aa,bb,tmpvar,...&lt;BR /&gt;</description>
      <pubDate>Sat, 12 May 2012 15:29:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Recursive-I-O-operation/m-p/824108#M5007</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2012-05-12T15:29:48Z</dc:date>
    </item>
    <item>
      <title>Recursive I/O operation</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Recursive-I-O-operation/m-p/824109#M5008</link>
      <description>Yes, when I googled about this problem, I found that advice, and now there are no such writings in my code, but it still crushes. Also I found post on some forum, where one man had this error occured when OMP_NUM_THREADS was greater than 1. I use OMP, usually with OMP_NUM_THREADS=2, and I've tried to set it to 1 - program still crushed with the same error.&lt;BR /&gt;But anyway thanks for reply, mecej4.</description>
      <pubDate>Sun, 13 May 2012 09:55:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Recursive-I-O-operation/m-p/824109#M5008</guid>
      <dc:creator>duke_k1</dc:creator>
      <dc:date>2012-05-13T09:55:52Z</dc:date>
    </item>
  </channel>
</rss>

