<?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: CoArray bug. in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243581#M153737</link>
    <description>&lt;P&gt;Yes, my error, I just found this too.&lt;/P&gt;
&lt;P&gt;With IMPLICIT NONE, the compiler should have issued a different error message.&lt;/P&gt;
&lt;P&gt;Thanks for taking (wasting) your time on this.&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2021 20:39:26 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2021-01-05T20:39:26Z</dc:date>
    <item>
      <title>CoArray bug.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243554#M153730</link>
      <description>&lt;P&gt;The following program exhibits a compiler bug in CoArrays&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;!  BugCAF.f90 
module foo
    integer, parameter :: NS=500, NA=1024
    complex(8), allocatable :: InputA(:,:,:)[:]     ! (NS,NS,NA)    only Image 1 will allocate
    integer,    allocatable :: OutputM(:)[:]        ! (NA)          only Image 1 will allocate
    complex(8), allocatable :: OutputZ(:,:,:)[:]    ! (NS,NS,NA)    only Image 1 will allocate
    integer,    allocatable :: OutputISUPPZ(:,:)[:] ! (NS,NA)       only Image 1 will allocate
    
    contains
    
subroutine AllocateData()
	    allocate(InputA(NS,NS,NA)[*])
        allocate(OutputM(NA)[*])
        allocate(OutputZ(NS,NS,NA)[*])
        allocate(OutputISUPPZ(NS,NA)[*])
end subroutine AllocateData

subroutine DeallocateData()
	    deallocate(InputA)
        deallocate(OutputM)
        deallocate(OutputZ)
        deallocate(OutputISUPPZ)
end subroutine DeallocateData

    end module foo

subroutine showBug()
    use foo
    implicit none
  
    real(8), allocatable :: work(:)
    complex(8), allocatable :: tempA(:,:)

    integer, allocatable :: localISUPPZ(:)
    complex(8), allocatable :: localZ(:,:)
    integer :: I,M
    
    allocate(work(NS),tempA(NS,NS)) ! local storage
    allocate(localISUPPZ(NS),localZ(NS,NS))
    
    do I = THIS_IMAGE(), NA, NUM_IMAGES()
        tempA(:,:) = InputA(:,:,I)[1]   ! load from image 1
        localISUPPZ(:) = OutputISUBZ(:,I)[1] ! ***** this works to read an integer coarray
!        call HEEVR(tempA,work,Z=localZ,ISUPPZ=localISUPPZ,IL=1,IU=10,M=M)
        OutputZ(:,:,I)[1] = localZ(:,:)
        OutputM(I)[1] = M
        OutputISUBZ(:,I)[1] = localISUPPZ(:) ! ***** error #6911: The syntax of this substring is invalid. [OUTPUTISUBZ]
    end do
    
    deallocate(work,tempA) ! local storage
    deallocate(localISUPPZ,localZ)
end subroutine showBug
    
program BugCAF
    use foo
    implicit none
    call AllocateData()
    call ShowBug()
    call DeallocateData()
end program BugCAF

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;When reading an integer array coarray no problem&lt;BR /&gt;When writing to an integer array coarray problem&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 19:27:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243554#M153730</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2021-01-05T19:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: CoArray bug.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243558#M153731</link>
      <description>&lt;P&gt;Note, if I change the type of OutputISUPPZ from integer to real, the compiler has no complaints.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 19:32:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243558#M153731</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2021-01-05T19:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: CoArray bug.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243573#M153733</link>
      <description>&lt;P&gt;Jim,&lt;/P&gt;
&lt;P&gt;It looks like you've have typographical errors: 'OUTPUTISUPPZ' vs 'OUTPUTISUBZ'.&lt;/P&gt;
&lt;P&gt;The compiler is remiss in giving you misleading error messages.&lt;/P&gt;
&lt;P&gt;If you've support, perhaps you can file a request at OSC for better description of the error in the messages?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 20:21:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243573#M153733</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2021-01-05T20:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: CoArray bug.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243577#M153734</link>
      <description>&lt;P&gt;Separately it's unclear what you're trying in this code.&amp;nbsp; The reproducer, while not illustrative of any algorithm or a scheme, also appears non-conforming e.g., reading an object before it's defined.&lt;/P&gt;
&lt;P&gt;Anyways, you may want to look further into the &lt;STRONG&gt;fork-join&lt;/STRONG&gt; model with standard Fortran coarrays and consider how to set up data, then 'sync' followed by parallel operations consuming data, and 'sync' before clean up.&amp;nbsp; Did you intend something like this?&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;    ..
    if ( this_image() == 1 ) call AllocateData()
    sync all ! or a sync variant thereof?
    call ShowBug()
    sync all ! or a sync variant thereof?
    if ( this_image() == 1 ) call DeallocateData()
    ..
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 20:28:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243577#M153734</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2021-01-05T20:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: CoArray bug.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243581#M153737</link>
      <description>&lt;P&gt;Yes, my error, I just found this too.&lt;/P&gt;
&lt;P&gt;With IMPLICIT NONE, the compiler should have issued a different error message.&lt;/P&gt;
&lt;P&gt;Thanks for taking (wasting) your time on this.&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 20:39:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243581#M153737</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2021-01-05T20:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: CoArray bug.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243585#M153740</link>
      <description>&lt;P&gt;The omission of THIS_IMAGE occurred as a process of making a reproducer. The actual code is like this:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;subroutine DeallocateTestData()
    implicit none
    
!dir$ if defined(UseCoarray)
    if(THIS_IMAGE() == 1) then
	    deallocate(InputA)
        deallocate(OutputM)
        deallocate(OutputZ)
        deallocate(OutputISUPPZ)
    endif
!dir$ elseif defined(UseMPI)
    if(rank == 0) then
	    deallocate(InputA)
        deallocate(OutputM)
        deallocate(OutputZ)
        deallocate(OutputISUPPZ)
    endif
!dir$ else
	deallocate(InputA)
    deallocate(OutputM)
    deallocate(OutputZ)
    deallocate(OutputISUPPZ)
!dir$ endif
end subroutine DeallocateTestData
...
    
!dir$ if defined(UseCoarray)
    if(THIS_IMAGE() == 1) then
	    allocate(InputA(NS,NS,NA)[*])
        allocate(OutputM(NA)[*])
        allocate(OutputZ(NS,NS,NA)[*])
        allocate(OutputISUPPZ(NS,NA)[*])
!dir$ elseif defined(UseMPI)
    if(rank == 0) then
	    allocate(InputA(NS,NS,NA))
        allocate(OutputM(NA))
        allocate(OutputZ(NS,NS,NA))
        allocate(OutputISUPPZ(NS,NA))
!dir$ else
	allocate(InputA(NS,NS,NA))
    allocate(OutputM(NA))
    allocate(OutputZ(NS,NS,NA))
    allocate(OutputISUPPZ(NS,NA))
!dir$ endif
  ... populate test data by...
      main thread or
      coarray image 1 or
      mpi image 0
   ...
!dir$ if defined(UseCoarray)
    endif
    SYNC ALL
!dir$ elseif defined(UseMPI)
    endif
    SYNC ALL
!dir$ endif
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is from a benchmark program that I am writing to explore&lt;/P&gt;
&lt;P&gt;sequential + MKL sequential&lt;BR /&gt;sequential + MKL threaded&lt;BR /&gt;OpenMP + MKL sequential&lt;BR /&gt;OpenMP + MKL threaded&lt;BR /&gt;CAF + MKL sequential&lt;BR /&gt;CAF + MKL threaded&lt;BR /&gt;MPI + MKL sequential&lt;BR /&gt;MPI + MKL threaded&lt;BR /&gt;CAF + OpenMP + MKL sequential&lt;BR /&gt;CAF + OpenMP + MKL threaded&lt;BR /&gt;MPI + OpenMP + MKL sequential&lt;BR /&gt;MPI + OpenMP + MKL threaded&lt;/P&gt;
&lt;P&gt;I've got it working prior to CAF and MPI.&lt;/P&gt;
&lt;P&gt;I will post it on the forum when it is done.&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 20:50:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/CoArray-bug/m-p/1243585#M153740</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2021-01-05T20:50:31Z</dc:date>
    </item>
  </channel>
</rss>

