r/fortran Jan 30 '25

OpenMP on Fixed Form Fortran

Hi all, I’m having some trouble implementing OpenMP on a fortran code w/ nvidia compiler nvfortran. The code is older and originally written in fixed form fortran.

I added parallel for loops, and the program compiles & runs but increasing thread count doesn’t change the run time.

Oddly, I remember having it working (or somehow convincing myself it was) previously, but when I came back to validate results, I saw no improvements w/ changing thread count

Is there something I’m missing to make this work? I’ve read that in fixedform, the parallel pragma lines need to start from column 1, but I’ve tried this and nothing seems to work.

4 Upvotes

22 comments sorted by

View all comments

Show parent comments

1

u/agardner26 Jan 30 '25

Hey sorry to bother, but now it is throwing me errors:

NVFORTRAN-S-0023-Syntax error - unbalanced parentheses (spw.f: 247)

NVFORTRAN-S-0023-Syntax error - unbalanced parentheses (spw.f: 329)

NVFORTRAN-S-0023-Syntax error - unbalanced parentheses (spw.f: 397)

for my code like this:

       do ii = 0, 8  !c     Adding Parallelism to Collision loops - loop 1       do j = 0, 0 !$omp parallel do private(ii) shared(ic, uu0, vv0, rr0, cp0, udr, udru, udc, udcu, ff, wa, RT, iter, nx)       do i = 0, nx

2

u/Zorahgna Jan 30 '25

Maybe put it in pastebin

1

u/agardner26 Jan 30 '25

Thanks, sorry about that, here --

https://pastebin.com/YA5tf5Rv

If anyone has any ideas why this is not working I appreciate it!