Fortran segmentation fault when using openmp WORKSHARE


I’m converting an MPI Fortran program of mine to utilise openmp as well, but I’m getting segmentation faults when using a pgi compiler. I have a stripped down test case which exhibits the problem:

Program main
    Use omp_lib

    Type group
        Real(8), Pointer ::  a(:),b(:)
    End Type group
    type(group) :: test


       test%a = 2 *test%b

end Program Main

Running the above code gives me a segmentation fault. If I change the WORKSHARE to be an explicit loop with an !$OMP DO, then it runs fine. If I change the Pointers to be Allocatable, then it runs fine. If I leave the Pointers “loose” rather than contained in type group, then it runs fine. If I switch to either intel or gnu compilers, then it runs fine.

I’ve replicated this problem using pgfortran versions 11.9.0, 12.8.0 and 12.9.0. No newer versions of pgi exist on this machine (Kraken over at the National Institute for Computational Sciences). I don’t compile with any flags, save for the one enabling openmp. Is this a compiler bug, and if so is there a better place to report it than this forum (assuming it’s not fixed in newer versions than I have access to)? Am I doing something illegal that I’m not noticing and intel/gnu are just letting slide?

Thanks in advance,


Hi Ben,

I passed this on to engineer for triage and they have determined this is a compiler error. We have assigned it to TPR#19163 and hope to have it fixed in the near future.



Engineering has confirmed that this problem is fixed in the 13,6 and current 13.7 release.

Thanks again for your submission.