- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I've just started using Intel's fortran compiler (I used to use IBM's). Among other changes, I noticed that passing an intrinsic function of an array as the argument to a subroutine resulted in a segmentation fault. Basically, if A is an array, then a call to
some_subroutine(A)
is fine, but, for example,
some_subroutine(transpose(A))
causes a segfault. I'm attaching a minimal code that will reproduce this. I compiled it with
ifort -m64 -r8 -O3 -o bad_ifort bad_ifort.F90
The segfault does not happen for small matrices, but my problem size is in fact a few thousand by a few thousand, and I never had a problem with this when I was using xlf. Is this a limitation of Intel's fortran compiler, or is there a compiler switch that I need to use?
Cheers,
Sourish
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you port, it is a good practice to use the /gen:interfaces /warn:interfaces
as well as to enable all runtime checks.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you use "transpose(B)" as an actual argument, a temporary array of the requisite size needs to be allocated (on the stack or the heap, depending on which compiler options have been used). Use the "stack" shell command of your system (ulimit -s for the bash shell) to raise the stack size from the default size, which can be quite small on some Linux/Unix distributions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the feedback, guys. Unfortunately, the warn:interfaces and gen:interfaces (-warn interfaces and -gen-interfaces on a unix system) did not solve my problem. Also, on the cluster I'm working on there is no "stack" command, but when I try ulimit, I get
$ ulimit
unlimited
Does this mean that the stack size is not small?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@mecej4, thanks for the suggestion. I just discovered the 'ulimit -s', and setting that to 'unlimited' solved my problem. Alternatively, adding
-heap-arrays `ulimit -s`
also works!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page