- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If I compile the following code:
[fortran]module routine implicit none contains subroutine sub() implicit none integer,parameter :: nmax=1000000 complex(8),dimension(nmax) :: d d = 0. end subroutine sub end module routine program test use routine !$OMP PARALLEL DO do iw=1,100 call sub() end do !$OMP END PARALLEL DO end program test [/fortran]with the following compile command:
ifort -heap-arrays -O0 -openmp test.f90 -static-intel
Then run it, I get:
$ ./a.out
Segmentation fault
Notes:
- If I change complex(8) to real(8) I get:
forrtl: severe (180): SIGBUS, bus error occurred
Image PC Routine Line Source
a.out 00000001000011AA Unknown Unknown Unknown
a.out 0000000100001423 Unknown Unknown Unknown
a.out 00000001000BED13 Unknown Unknown Unknown
- If I set nmax <=262061 then the code runs properly (with complex(8))
- If I set262061 < nmax <=262308 then I get
Illegal instruction
- If I set nmax >262308 then I get a segfault as before
Details
$ ifort -V
Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.2.142 Build 20110112
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
System: MacOS 10.6.6, XCode 3.2.5
Thanks in advance for any help!
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As an experiment, declare sub as a recursive subroutine
recursive subroutine sub()
...
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's probably better to attempt to design separate experiments for each abuse of the compiler.
Are you asking why the compiler doesn't complain, or which issues prevent dead code elimination?
Are you asking why the compiler doesn't complain, or which issues prevent dead code elimination?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding 'recursive' does not seem to change anything - I still get a Segmentation fault. Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are getting a stack overflow, even with -heap-arrays. Try this substitute code which works for me:
complex(8),dimension(:),allocatable :: d
allocate (d(nmax))
complex(8),dimension(:),allocatable :: d
allocate (d(nmax))
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page