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

openmp array reduction segmentation fault

camey1
Beginner
1,715 Views
Hello,

I have been trying to run some fairly straightforward code which uses array reductions, but have been getting segmentation faults when the array is made larger than a certain size.

I have set "ulimit -s 50000000", so stack size should not be a problem, and the code works in gfortran. Is this a known issue, or are there subtleties I am not noticing?

Compiled using ifort 11.1 20090511

[fortran]subroutine sparse(rowcol,dat,vold,vnew,matlength,arraylen)

integer matlength,arraylen
double precision dat(arraylen)
integer rowcol(arraylen,2)
double precision vnew(matlength)
double precision vold(matlength)

vnew = 0.0d0

!$OMP PARALLEL PRIVATE(i) SHARED(vold, rowcol, dat,l) REDUCTION(+:vnew)
!$OMP DO
  do i=1,arraylen,1
    vnew(rowcol(i,1)) = vnew(rowcol(i,1)) + vold(rowcol(i,2))*dat(i)
  end do
!$OMP END DO
!$OMP END PARALLEL

return
end[/fortran]

Any help would be appreciated,

Thanks
0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
1,715 Views
Are there any duplicates in

rowcol(i,1) i=1,arraylen?

if not, you can remove the reduction (and make vnew shared)

Jim Dempsey
0 Kudos
Reply