Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29284 Discussions

Limits in dynamics allocatable variable

bxm
Beginner
352 Views

I installed gentoo with 2.6.12-r10 kernel and lastest 9.0.021 fortran on i865 2.8GHz Nortwood core with 4GB RAM.I tested allocating memory with gcc and i reached 3057MB. So I want to do with ifort too, but i got error
forrtl: severe (174): SIGSEGV, segmentation fault occurred, when program allocated array in subroutine. Is there some limits in allocating memory or where I made mistake?

mem.def:

integer*8 n,nnn,i
integer err
parameter (n=500)
parameter (nnn=n*n*n)

mem.f:

program mem
include 'mem.def'
real*8, allocatable :: p(:)
allocate(p(nnn),stat=err)
do i=1,nnn
p(i)=i
enddo
write(*,*)'stat=',err
read(*,*)i
call one
deallocate(p)
end

subroutine one
include 'mem.def'
real*8, allocatable :: k(:), l(:)
allocate(k(nnn),l(nnn),stat=err)
write(*,*)'started'
do i=1,nnn
k(i)=i
l(i)=i+1
enddo
write(*,*)'stat=',err
read(*,*)i
deallocate(k,l)
return
end

0 Kudos
0 Replies
Reply