|
| View previous topic :: View next topic |
| Author |
Message |
appleluo
Joined: 21 Nov 2012 Posts: 19
|
Posted: Wed Jan 23, 2013 11:32 am Post subject: Question about data movement as seen from compiler feedback |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Wed Jan 23, 2013 1:06 pm Post subject: |
|
|
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 |
|
 |
appleluo
Joined: 21 Nov 2012 Posts: 19
|
Posted: Wed Jan 23, 2013 1:34 pm Post subject: |
|
|
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 |
|
 |
appleluo
Joined: 21 Nov 2012 Posts: 19
|
Posted: Wed Jan 23, 2013 1:43 pm Post subject: |
|
|
Hi Mat,
Adding present(a, b, c) solved the problem. Thanks.
Ping |
|
| Back to top |
|
 |
appleluo
Joined: 21 Nov 2012 Posts: 19
|
Posted: Thu Jan 24, 2013 9:42 am Post subject: |
|
|
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 |
|
 |
|
|
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
|