Is there a way have a line break of an OMP pragma statement?

I’m a bit anally retentive when it comes to writing neat source code.

Is there a way to implement a line break (i.e. analogous to the use of & in fortran code) of an OMP pragma statement?

i.e., if I have some code:

!OMP PARALLEL PRIVATE ( A, B, C, D, E, F, G ) SHARED ( H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z )
 ........
!OMP END PARALLEL

Can I somehow get all the SHARED variables on the next line (i.e. I like to keep the source code character width to something approximating the old F77 limit of 72 characters (or whatever it used to be))…

Cheers,

Rob.

Hi Rob,

In fixed form, add the “&” just after the !$OMP directive:

!$OMP  PARALLEL PRIVATE ( A, B, C, D, E, F, G )
!$OMP& SHARED ( H, I, J, K, L, M, N, O, P, Q, R,
!$OMP&          S, T, U, V, W, X, Y, Z )
...
!$OMP END PARALLEL
        end

In free form, put the “&” at the end of the line:

!$OMP  PARALLEL PRIVATE ( A, B, C, D, E, F, G )  &
!$OMP  SHARED ( H, I, J, K, L, M, N, O, P, Q, R, &
!$OMP          S, T, U, V, W, X, Y, Z )
...
!$OMP END PARALLEL
        end

Hope this helps,
Mat

D’OH! Nearly guessed that (forgot to put the !$OMP infront of SHARED…).

Thanks as always Mat,

Rob.