PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Question about data movement as seen from compiler feedback
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
appleluo



Joined: 21 Nov 2012
Posts: 19

PostPosted: Wed Jan 23, 2013 11:32 am    Post subject: Question about data movement as seen from compiler feedback Reply with quote

Hello,

I have a subroutine that contains a data region and two parallel regions inside the data region, as below:

subroutine sub1
...
!$acc data copyin(a,b,c)
!$acc parallel
....
!$acc end parallel
...
!$acc parallel
...
!$acc end parallel
!$acc end data

end subroutine sub1

When I compile the code, the compiler outputs
generating copyin(a)
generating copyin(b)
generating copyin(c)
at three places, where the data region and the two parallel regions start. Does that mean the code will copy in a, b, and c at those three places. I know it shouldn't be this case. But how to explain the message?

Thanks,

Ping
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jan 23, 2013 1:06 pm    Post subject: Reply with quote

Hi Ping,

Are you sure they are all copyins or are two present_or_copyins? There will be a present before each parallel region in order to allow for pointer swapping.

- Mat
Back to top
View user's profile
appleluo



Joined: 21 Nov 2012
Posts: 19

PostPosted: Wed Jan 23, 2013 1:34 pm    Post subject: Reply with quote

Hi Mat,

Thanks for the quick response.

I saw exactly three copyins for every variable in the list, one at the beginning of the data region and two at the beginning of the two parallel regions. I didn't specify present(a,b,c) at the parallel regions. Would that caused the problems?

Ping
Back to top
View user's profile
appleluo



Joined: 21 Nov 2012
Posts: 19

PostPosted: Wed Jan 23, 2013 1:43 pm    Post subject: Reply with quote

Hi Mat,

Adding present(a, b, c) solved the problem. Thanks.


Ping
Back to top
View user's profile
appleluo



Joined: 21 Nov 2012
Posts: 19

PostPosted: Thu Jan 24, 2013 9:42 am    Post subject: Reply with quote

Hi Mat,

I still have some doubts.

First, the OpenACC standard says an array referenced in the kernels or parallel construct that doesn't appear in a data clause for the construct or any enclosing data construct will be treated as if it appeared in a present_or_copy for the construct. This means my original code should generate two present_or_copy, right?

Second, after adding the present clause, now the compiler shows present_or_copyin. But should it be present only?

Third, in terms of overhead, does present_or_copyin poses much overhead than present?

Thanks,

Ping
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 1, 2  Next
Page 1 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