PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Wrong results when using the private directive with PGI 12.6
Goto page Previous  1, 2
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
mkcolg



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

PostPosted: Wed Aug 08, 2012 3:39 pm    Post subject: Reply with quote

Hi Tiziano,

Quote:
But I'm not sure that it is correct that "i" has to be declared private in the outer loop, does that mean that "i" is privatized per every gang? I would want "i" to be private per each worker, no?
Loop index variables are treated a bit differently since privatizing them across the gang wouldn't be possible. So in this particular case, it will work.

Quote:
Why do I get a live-out for "i" in the declaration of the outer loop on "j"? And what is the best practice?
It's either compiler error or i and j's values are used after the end of the accelerator region. What's the code like after the region?

- Mat
Back to top
View user's profile
Tiziano



Joined: 14 May 2012
Posts: 8

PostPosted: Tue Aug 14, 2012 2:53 am    Post subject: Reply with quote

mkcolg wrote:
It's either compiler error or i and j's values are used after the end of the accelerator region. What's the code like after the region?

- Mat


I have other loops using again i and j, but I have a parallel region per every loop, because many times the loop count is different.
So I don't understand why the compiler gives me this messages, also because I have a very similar situation in other routines, but there I haven't the messages. My feeling is that for some reasons the compiler starts to see wrong connections for some unknows reasons, and this is not easy to reproduce in an example. The routine where it happens is the last one in my file, could it help if I copy-paste in a new file?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Aug 14, 2012 10:21 am    Post subject: Reply with quote

Quote:
My feeling is that for some reasons the compiler starts to see wrong connections for some unknows reasons, and this is not easy to reproduce in an example. The routine where it happens is the last one in my file, could it help if I copy-paste in a new file?
It possible that the compiler is getting confused or there may be some other reason. If you can post a reproducing example, that would be great. If it's too large to post, please send the example to PGI Customer Service (trs@pgroup.com) and ask them to send it to me.

Thanks,
Mat
Back to top
View user's profile
Tiziano



Joined: 14 May 2012
Posts: 8

PostPosted: Wed Aug 15, 2012 2:44 am    Post subject: Reply with quote

Hi,
I found out the problem: there was a routine cointained in the routine where these strange messages appeared, and the contained routine used the same i and j indexes, my bet is that the programmer thought it to be always inlined, but I guess this confused the compiler.
Best regards
Tiziano
Back to top
View user's profile
franzisko



Joined: 11 Jan 2011
Posts: 25

PostPosted: Wed Aug 22, 2012 3:33 am    Post subject: privatizing scalars Reply with quote

Hi Mat,

I have the same problem discussed in this post and I would like to know the best solution according to your view.

I am using PGI 12.8 (12.6 is the same, while 12.5 works for this part) and PGI Accelerator. I need to privatize some scalars because I have a live-out message (the compiler fails about that but I think it is reasonable because the program is complex). Since the loops are nested, if I privatize scalars in the external loop, results are wrong, probably because privatization occurs at the block level. If I privatize the internal loop the results seem to be correct but I wonder if:
a) I can be always safe privatizing the most internal parallelized nested loop
b) this strategy is efficient in view of code performance, or it is better to check each loop and privatize as little as possibile (quite laborious to do).

My personal view is that "private" should be
a) local to kernel when no loop specification is given (gang, worker,..., or similar for PGI Acc)
b) corresponding to the specification of the loop only when explicitely given by the programmer

thanks for help
bye, Francesco
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
Goto page Previous  1, 2
Page 2 of 2

 
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