- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
using :
Intel Fortran Compiler for 32-bit applications, Version 8.0 Build 20040616Z Package ID: l_fc_pc_8.0.046_pe049.1
I'm trying to get something like the following to work:
!=============================================
MODULE TEST
TYPE dd
REAL, POINTER, DIMENSION(:,:,:) :: xx
END TYPE dd
CONTAINS
SUBROUTINE TT(A,B)
TYPE(dd), INTENT(INOUT) :: A
TYPE(dd), INTENT(IN) :: B
A%xx=A%xx+B%xx
END SUBROUTINE TT
END MODULE TEST
USE TEST
INTEGER, PARAMETER :: N=100
TYPE(dd), POINTER :: A,B
ALLOCATE(A,B)
ALLOCATE(A%xx(N,N,N),B%xx(N,N,N))
CALL TT(A,B)
END
!=============================================
MODULE TEST
TYPE dd
REAL, POINTER, DIMENSION(:,:,:) :: xx
END TYPE dd
CONTAINS
SUBROUTINE TT(A,B)
TYPE(dd), INTENT(INOUT) :: A
TYPE(dd), INTENT(IN) :: B
A%xx=A%xx+B%xx
END SUBROUTINE TT
END MODULE TEST
USE TEST
INTEGER, PARAMETER :: N=100
TYPE(dd), POINTER :: A,B
ALLOCATE(A,B)
ALLOCATE(A%xx(N,N,N),B%xx(N,N,N))
CALL TT(A,B)
END
!=============================================
But the code segfaults at runtime. This seems to be happening as soon as the arrays xx are +- 2Mb (N~80). I've tried using ulimit -s up to 30Mb stack, but this doesn't seem to help. Before I ask my sysadmin again to update to
pe050.1 is it fixed there ? Is there another easy solution (that doesn't involve recoding things with an explicit do loop)
Thanks,
Joost
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see anything in what you have posted that should cause a temporary to be created. What does routine TT do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My guess is that a temporary is created for this thing as the xx are arrays
A%xx=A%xx+B%xx
but I might be wrong...
The little program in the first message is sufficient to recreate the segfault, and is actually very close to the real subroutine having trouble.
Joost
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I apologize - I read too quickly.
The compiler really ought to be able to tell in this case that a temp is not needed for the array assignment. My recollection is that we don't get the case where the array is a component of a derived type.
Please feel free to submit this to Intel Premier Support as a feature request.
I was able to run this with a 5MB stack.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
strangly, this doesn't work in my case, the stack size (in kbytes) being 20000, and the value of N=100 being unmodified. Does that mean it works with the newer release, or is there something else... ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try ulimit -a to see what the limit really is. Worked for me with ulimit -s 8192.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it really is 20000 :-)
jv244:~$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 20000
cpu time (seconds, -t) 900
max user processes (-u) 7168
virtual memory (kbytes, -v) unlimited
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 20000
cpu time (seconds, -t) 900
max user processes (-u) 7168
virtual memory (kbytes, -v) unlimited
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see that I reported this to engineering a while ago, and they took it under consideration. I did run your program successfully using a current compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if this is of any use: the same happens after updating ifort to Build 20040716Z Package ID: l_fc_pc_8.0.046_pe050.1

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