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

ifc 8.0 - Array reduction supported?

adolfo-banchio
Beginner
706 Views
Is array reduction supported (under OpenMP) in
the new Intel Fortran compiler 8.0 ?

My code gives a runtime error ("Aborted")
when reaching a parallel do with an array
REDUCTION.

I tried to look in the "Limitations", but
did not find anything.


thanks in advance for your help.

adolfo
0 Kudos
4 Replies
TimP
Honored Contributor III
706 Views
Your question is rather indefinite, which version, which architecture? Evidently, as they say, ymmv, but I've found the Dec. 10 build of the IPF ifort 8 significantly more reliable for OpenMP than prior or subsequent builds. For the ia32 builds, you will likely get best results with the current version.
If you can make a reproducer which works with the 7.1 compiler and fails with 8.0, please submit on premier.intel.com.
0 Kudos
adolfo-banchio
Beginner
706 Views
To be more specific, I am using

ifort 8.0.039 baseline package for Linux IA32,
patched with 8.0.039_pe042 patch.

I tried to reproduce the problem with a simpler
example (sample code attached array_red.f90).
It still crashes (with SIGSEGV) but with different
error message (in my complete code the error message was "Aborted").

If compiled with ifc 7.1.037-NCOM the sample
code give the following compilation error:

>
> Error 313 at (10:array_red.f90) : This variable cannot be > an assumed size or deferred shape array
>


I also include another sample code (array_red_mod.f90)
which compiles with both versions (as
my complete code does) and works fine if compiled
with version 7.1.037 and still crashes using the
ifort 8.0

adolfo


!-------------- array_red.f90 --------------
program error
implicit none
integer :: n,i,j
real, allocatable, dimension(:) :: array
!
n = 500
allocate( array(3) )
array(:) = 0.0
!
!$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(j), REDUCTION(+:array)
do i=1,1000
do j=1,3
array(j) = array(j) + 1
enddo
enddo
write(*,*) array
end
!
!----------------------------------------------



!----------- array_red_mod.f90 ------------
module mod
real, allocatable, dimension(:) :: ar
integer :: n
CONTAINS
subroutine alloc
n = 5
allocate( ar(n) )
return
end subroutine alloc
end module mod
!
program error
use mod
implicit none
call alloc
call sub
end
!
subroutine sub
use mod, only: n,ar
implicit none
integer :: i,j
real :: array(n)
!
array(:) = 0.0
!
!$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(j), SHARED(n), REDUCTION(+:array)
do i=1,1000
do j=1,n
array(j) = array(j) + 1
enddo
enddo
write(*,*) array
return
end subroutine sub
!
! -----------------------------------------------------
0 Kudos
Steven_L_Intel1
Employee
706 Views
Have you submitted this to support?
0 Kudos
adolfo-banchio
Beginner
706 Views
yes I submitted the issue to Intel Premier
Support.

Issue Nr: 234622


They were able to reproduce the error and
are investigating (current status).
0 Kudos
Reply