Seg-fault during profiling of MPi+OpenMP application

Hi all,
this is my first time on this forum. I have a problem with my application when I enable profiling and multithreading options. My application uses both MPI and OpenMP and it’s written in FORTRAN90. I have followed all the instructions and expedients reported on the documentation but the segmentation fault continue to appear on each execution

I use LSF batch system to submit my application…

export OMP_STACK_SIZE=256M
mpirun -np 4 […] ./myapp.x

The error is similar to the following
[node0009:11998] *** Process received signal ***
[node0009:11998] Signal: Segmentation fault (11)
[node0009:11998] Signal code: Address not mapped (1)
[node0009:11998] Failing at address: 0xffffffffffffff18
[node0009:11998] *** End of error message ***

$ ldd myapp.x => /opt/openmpi/1.2.8/pgi–8.0-2–binary/lib/ (0x00002aaaaacc6000) => /opt/openmpi/1.2.8/pgi–8.0-2–binary/lib/ (0x00002aaaaaf22000) => /opt/openmpi/1.2.8/pgi–8.0-2–binary/lib/ (0x00002aaaab152000) => /opt/openmpi/1.2.8/pgi–8.0-2–binary/lib/ (0x00002aaaab4a1000) => /copt/openmpi/1.2.8/pgi–8.0-2–binary/lib/ (0x00002aaaab76f000) => /usr/lib64/ (0x00002aaaab9eb000) => /lib64/ (0x00002aaaabbf7000) => /lib64/ (0x00002aaaabe00000) => /lib64/ (0x00002aaaac004000) => /lib64/ (0x00002aaaac21d000) => /lib64/ (0x00002aaaac420000) => /popt/pgi/linux86-64/8.0-2/lib/ (0x00002aaaac63a000) => /opt/pgi/linux86-64/8.0-2/lib/ (0x00002aaaac73c000) => /lib64/ (0x00002aaaac83d000) => /lib64/ (0x00002aaaacac0000) => /opt/pgi/linux86-64/8.0-2/libso/ (0x00002aaaace11000) => /opt/pgi/linux86-64/8.0-2/libso/ (0x00002aaaad1cc000) => /opt/pgi/linux86-64/8.0-2/libso/ (0x00002aaaad2ce000) => /opt/pgi/linux86-64/8.0-2/libso/ (0x00002aaaad3e1000) => /opt/pgi/linux86-64/8.0-2/libso/ (0x00002aaaad504000) => /opt/pgi/linux86-64/8.0-2/libso/ (0x00002aaaad632000)
/lib64/ (0x00002aaaaaaab000)

Compile/linker flags are:
MPIF90 = mpif90
CC = pgcc
F77 = pgf77
CFLAGS = -mp -O1 -W0,-profile,lines -Mprof=lines
F90FLAGS = -mp -O1 -r8 -W0,-profile,lines -Mprof=lines
LD = mpif90 -mp -lpgnod_prof_openmpi -W0,-profile,lines -Mprof=lines

If I remove “-mp” flag, the application works without faults!
I’m using the latest available version of PGI compiler (8.0-2).

How I can resolve this problem?

Thank you very much in advance!

Hi filippo.spiga,

The most likely cause is a stack overflow. I see that you’ve tried increasing the stack size, but accidently misspelled the environment variable. The OpenMP 3.0 variable is “OMP_STACKSIZE”. If removing the second underscore doesn’t work, try increaseing the size to 512M.

If it still seg faults, then try running your code in the PGI debugger, PGDBG, to get a better understanding of the error. You’ll need to use the MPI libraries that accompany your compilers. If you have the PGI CDK product you’ll be able to debug your program using either MPI or MPI-2 on your cluster. Otherwise, you’ll need use MPI-1 (mpich) and will be limited to debugging on a single node.

  • Mat