Discussion:
OpenMP stacksize
(too old to reply)
John Deas
2007-05-17 22:44:58 UTC
Permalink
Hi,

I have a program which manipulate large arrays (speed vectors for
direct numerical simulation, CFD), and I a trying to modify and debug
it with ifort and idb. The code contains openmp sections. When
compiled without the openmp option, everything looks fine, but when I
try to compile it with openmp, and I run it, I had crash early in the
run at trivial functions call. After some research, I thought it might
be linked to the stack size. I set "ulimit -s 2000000" and "export
KMP_STACKSIZE=2g" and the program get further when it run, but, I got
segmentation fault at a point later (I run it with 2 threads).
A step-by-step debugging show me that, inside an omp do loop, the
values of some SHARED variables where modified, but no line inside the
do loop does this modification. Since those variables store arrays
boundaries, once they are modified the do loop get outside the
corresponding array and I got segfault.

my configuration is :

Red Hat Linux 9.0
Intel Fortran Compiler (and debugger) 9.1
Intel 2x3.6 ghz
3.6 gig of ram

If you have any advice on this problem, I would really appreciate it,
since I have no clue why the openmp version version modify those
values.

Thanks,

J.D.

--
algorimancer
2007-05-22 19:37:53 UTC
Permalink
Post by John Deas
I have a program which manipulate large arrays (speed vectors for
...
Post by John Deas
it with ifort and idb. The code contains openmp sections. When
...
Post by John Deas
values of some SHARED variables where modified, but no line inside the
do loop does this modification. Since those variables store arrays
boundaries, once they are modified the do loop get outside the
corresponding array and I got segfault.
It has been my experience that, when values of variables begin
changing for no obvious good reason, it is due to bad pointer(s),
though in this case it may be due to uninitialized variables. It
sounds to me like you need to take a close look at what variables are
being used within the OpenMP section, and specifically check that
relevant variables are appropriately tagged with private(),
firstprivate(), or shared(). Don't forget that private() does not
copy the value of a variable into the separate threads that OpenMP
creates, meaning that the variables would be uninitialized (and show
random values within the loop); firstprivate() would fix that. Hope
this helps :)

--

Loading...