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

OpenMp and stacksize

john_deas
Beginner
502 Views

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.

The section of the code concerned looks like:
 

!$OMP PARALLEL DEFAULT(SHARED)
!$OMP DO SCHEDULE(STATIC) PRIVATE(j,i)
 do j=j1,j2
 do i=i1,i2
 sol(i,j,k1) = sol(i,j,k1)/ack(k1)
 enddo
 enddo
!$OMP END DO

...

!$OMP END PARALLEL

 


so if i2 is modified in any way, the program goes out of the sol boundaries in the loop and then 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. Or, if you know some compiler/debuger options that might help diagnose this problem...

Thanks,

J.D.

 

0 Kudos
2 Replies
TimP
Honored Contributor III
502 Views
As you have heard before, you have about reached the limits of advice which you can get with such incomplelte detail.
In addition to paying attention to the great deal of expert advice you have been soliciting, you should consider that Red Hat 9 went off support long before development of ifort 9 began. If your OS is too old for Intel Thread Checker to work, you should consider something more up to date. This would include CentOS or SuSE, if you are looking to avoid paying for OS support.
0 Kudos
john_deas
Beginner
502 Views
You are right I will cool down. I am new in this area and feel a bit overwhelmed by new problems. Thank you for your advice for the various software, and sorry for the multiposting flood.

J.D.
0 Kudos
Reply