PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

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

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
alfvenwave



Joined: 08 Apr 2010
Posts: 79

PostPosted: Wed Apr 28, 2010 7:05 am    Post subject: Is there a way have a line break of an OMP pragma statement? Reply with quote

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
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6208
Location: The Portland Group Inc.

PostPosted: Wed Apr 28, 2010 8:39 am    Post subject: Reply with quote

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
View user's profile
alfvenwave



Joined: 08 Apr 2010
Posts: 79

PostPosted: Wed Apr 28, 2010 10:37 am    Post subject: Reply with quote

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

Thanks as always Mat,

Rob.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
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 © phpBB Group