PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

shared() vector<int> w/ disjoint accesses

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Mark McKenna



Joined: 11 Dec 2005
Posts: 5

PostPosted: Mon Dec 12, 2005 8:55 pm    Post subject: shared() vector<int> w/ disjoint accesses Reply with quote

hi.

Could you let me know what the performance consequences of doing something like this are?

vector<int> A(100);

#pragma omp parallel for shared(A)
for (int i=0; i < 100; i++) {
A[i] = i*i;
}

In particular, what I would like to know is whether or not your implementation of OpenMP will recognise that there are no dependencies here, and optimise accordingly.

...for that matter, would the use of an STL structure introduce a dependency here (like something along the lines of bounds checking... although I'm pretty sure the array notation for vector doesn't do bounds checking)?

Thanks!

Mark
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Dec 13, 2005 4:15 pm    Post subject: Reply with quote

Hi Mark,

One of your C++ engineers gave the following response:

Quote:
The #omp pragma directive does not make dependency checks on the
code in question. It is up to the user to make sure that there are
no conflicting dependencies. The STL library does not introduce any
dependencies in this case

Code is generated for parallel execution as a result of the OMP pragma.

Other, non MP optimizations may occur as a result of -fast or -Minline,
or other optimization flags. In this case, the call to operator vector[]
does prohibit further some optimization at this time.


Hope this helps,
Mat
Back to top
View user's profile
Mark McKenna



Joined: 11 Dec 2005
Posts: 5

PostPosted: Tue Dec 13, 2005 7:53 pm    Post subject: Reply with quote

Hrm... yes it does.

Thanks,
Mark
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling 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