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

Segmentation fault

mathieu52
Beginner
486 Views
Hi,

The following program creates segmentation
fault under ifc 8.1 and ifort 9.0 but not
under ifc 7.0
PROGRAM BUGSEARCH
CALL gls_corstep_tile(1044574)
CONTAINS
SUBROUTINE gls_corstep_tile(Jend)
integer, intent(in) :: Jend
integer, parameter :: r8 = selected_real_kind(12,300) ! 64-bit
real(r8), dimension(Jend) :: var1
! real(r8), dimension(1044574) :: var1
Print *, 'The program has finished'
END SUBROUTINE gls_corstep_tile
END PROGRAM
Replacing 1044574 by a smaller value make it work.

Replacing Jend by its value 1044574 (i.e. uncommenting and commenting the critical declaration lines) make it works also.

This was tested under linux 2.6.8-24.16-bigsmp
and under 2.4.20-8.

Mathieu
0 Kudos
3 Replies
TimP
Honored Contributor III
486 Views
Under what operating system do you see this problem? You say you have tested under linux, but you posted in the Windows forum. I suppose we can assume you are running a 32-bit system, since ifc 7.1 didn't have EM64T support.

It's not entirely surprising that the threshold where you would run out of space would change somewhat when you change from an automatic array to a fixed size array.
As Steve suggested on the linux forum, an allocatable array, with error checking, may be preferable to the use of such a large automatic array. The space available for an automatic array will depend on several considerations which aren't under your control.

Message Edited by tim18 on 10-24-2005 08:42 AM

0 Kudos
Steven_L_Intel1
Employee
486 Views
I posted a reply in the Linux forum where this was also asked.
0 Kudos
mathieu52
Beginner
486 Views
Hi,

thank you to both of you, you solved my problem
and sorry for having put the problem first in
windows forum.

Mathieu
0 Kudos
Reply