Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28988 Discussions

Coarray - Internal compiler error / Wrong results

Jan_W_2
Beginner
431 Views

Compiling this program with ifort version 15.0.1 gives me:

testarray.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
compilation aborted for testarray.f90 (code 1)

Here is the code:

module test
  implicit none

  contains
 
  function sum_assumedshape(input, length) result(output)
   complex, dimension(:), intent(in)  :: input


  •    complex            :: output
       integer, intent(in) :: length
       integer :: i
       
       output = cmplx(0.0, 0.0)
       
       do i = 1, length
          output = output + input(i)
       end do
       
      end function
     
      function sum_assumedsize(input, length) result(output)
       complex, dimension(length), intent(inout)  :: input

  •    complex                     :: output
       integer, intent(in) :: length
       integer :: i
       
       output = cmplx(0.0, 0.0)
       
       do i = 1, length
          output = output + input(i)
       end do
       
      end function
       
    end module
     
  • program sizevsshape
      use test
      implicit none

      complex, allocatable, dimension(:) :: in[:]
      complex                            :: out  
      integer  :: i
      integer, parameter :: length = 4
     
      allocate(in(length)

  • )
     
      in = (/(cmplx(real(i),0.0), i=1, length)/)
     
      if(this_image() == 1) write(*,*) in
       
      out = sum_assumedshape(in, length)
     
      if(this_image() == 1) write(*,*) out
     
      out = sum_assumedsize(in, length)
  •   if(this_image() == 1) write(*,*) out
     
    end program

     

    When I compile this with ifort 14. it works but the assumed size function

    gives me a wrong result.

     

    Thank you

    Jan

     

     

    0 Kudos
    2 Replies
    Steven_L_Intel1
    Employee
    431 Views

    The internal compiler error is gone in 15.0.3, but the wrong results remain. However, the 16.0 beta works fine,so it looks as if this has already been fixed.

    0 Kudos
    Jan_W_2
    Beginner
    431 Views

    Oh ok!

    Thank you!

    0 Kudos
    Reply