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

Array size problems

rge21
Beginner
409 Views
Greetings,

I'm trying to increase the problem size in a program I've written, and it's started segfaulting for no apparent reason. The following block invariably segaults:

FORALL( i=1:SIZE(gParticles) )
gParticles(i)%lastPhi = gParticles(i)%phi
gParticles(i)%lastr = gParticles(i)%r
gParticles(i)%phi = gParticles(i)%phi + ( dtStep * GetOmega( gParticles(i)%r ) )
END FORALL

gParticles itself is an allocateable array, whose size is set at runtime. The problem appears when it gets past about 80k elements. The exact error reported by gdb (idb isn't installed on this machine) is:

0x0804cd33 in main_mp_advanceparticles_ () at main.f90:97

Line 97 is the first line in the FORALL block, but which line fails does vary. However, this is not the first time in the program that this array is accessed. By the time this point is reaced, the gParticles array has already been initialised and used to produce an output file.

My compiler options are
-g -C
and the version is
Version 8.0 Build 20031016Z
I'm aware this is fairly old, but I don't control this machine, and hence getting it upgraded takes a while (although if this is a known and fixed compiler problem, I should be able to get it done).

One more thing, I have
ulimit -s unlimited set too.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
409 Views
Try increasing the stacksize limit.
0 Kudos
rge21
Beginner
409 Views


sblionel wrote:
Try increasing the stacksize limit.




Isn't that what
ulimit -s unlimited
does under bash (the shell I'm using)? Or is there something else I've got to tell the compiler itself? TIA.
0 Kudos
Steven_L_Intel1
Employee
409 Views
Sorry, I missed that you did the unlimit.
0 Kudos
rge21
Beginner
408 Views
I've just run a further test, and this problem seems to be related to whole array operations. Turning the problem FORALL loop into a DO loop fixed the problem. However, a later whole array operation using one of my ELEMENTAL functions then failed.

I can obviously fix this by putting in explicit DO loops, but I'd prefer not to do that. The way I've done it should work.
0 Kudos
Reply