I have a fortran program which I’m trying to run using OpenMP parallel directives. When I compile the program with -mp -r8 -mcmodel=medium -O3 it segfaults at the first OMP worksharing directive. If I run with one thread there is no problem. Debugging gives the following:
(gdb) run
Starting program: /data1/scamicha/INDIRECTPOT/MODEDECOMPOSE/test/decompose
[Thread debugging using libthread_db enabled]
[New Thread 47510998064320 (LWP 14037)]
…/…/WAN_SAVED/saved.290000
Your time is 12.03332300130014
[New Thread 1082132800 (LWP 14044)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1082132800 (LWP 14044)]
0x00002b3603033356 in _mp_slave () from /opt/pgi/linux86-64/8.0-6/libso/libpgmp.so
Am I not passing the right compiler flags or something? It seems that this must be something painfully obvious that I’m missing. This code works fine with other compilers, Intel, Pathscale, GNU