|
| View previous topic :: View next topic |
| Author |
Message |
alfvenwave
Joined: 08 Apr 2010 Posts: 77
|
Posted: Wed Apr 28, 2010 7:05 am Post subject: 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:
| 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. |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Wed Apr 28, 2010 8:39 am Post subject: |
|
|
Hi Rob,
In fixed form, add the "&" just after the !$OMP directive: | Code: |
!$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: | Code: |
!$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 |
|
| Back to top |
|
 |
alfvenwave
Joined: 08 Apr 2010 Posts: 77
|
Posted: Wed Apr 28, 2010 10:37 am Post subject: |
|
|
D'OH! Nearly guessed that (forgot to put the !$OMP infront of SHARED....).
Thanks as always Mat,
Rob. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|