OpenMP in Fortran

Posted by user345293 on Stack Overflow See other posts from Stack Overflow or by user345293
Published on 2010-05-19T16:56:51Z Indexed on 2010/05/19 17:00 UTC
Read the original article Hit count: 212

Filed under:
|

I very rarely use fortran, however I have been tasked with taking legacy code rewriting it to run in parallel. I'm using gfortran for my compiler choice. I found some excellent resources at https://computing.llnl.gov/tutorials/openMP/ as well as a few others.

My problem is this, before I add any OpenMP directives, if I simply compile the legacy program:

gfortran Example1.F90 -o Example1

everything works, but turning on the openmp compiler option even without adding directives:

gfortran -openmp Example1.F90 -o Example1

ends up with a Segmentation fault when I run the legacy program. Using smaller test programs that I wrote, I've successfully compiled other programs with -openmp that run on multiple threads, but I'm rather at a loss why enabling the option alone and no directives is resulting in a seg fault.

I apologize if my question is rather simple. I could post code but it is rather long. It faults as I assign initial values:

    REAL, DIMENSION(da,da) :: uconsold
    REAL, DIMENSION(da,da,dr,dk) :: uconsolde

    ...

    uconsold=0.0    
    uconsolde=0.0       

The first assignment to "uconsold" works fine, the second seems to be the source of the fault as when I comment the line out the next several lines execute merrily until "uconsolde" is used again.

Thank you for any help in this matter.

© Stack Overflow or respective owner

Related posts about fortran

Related posts about openmp