PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

OpenMP not parallelizing nested loop, depends on order

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



Joined: 02 Oct 2008
Posts: 6

PostPosted: Thu Nov 08, 2012 12:23 pm    Post subject: OpenMP not parallelizing nested loop, depends on order Reply with quote

I'm having a strange issue with pgcc not parallelizing a nested loop, depending on the order of the loops.

For example, I have:
Code:

void function (vars) {
int row, col;
#pragma omp parallel for private(row, col)
148 for (row = 0; row < NUM; ++row) {
150     for (col = 0; col < NUM - 1; ++col) {

    ...
    }
}
206 }


Compiling with pgcc -fast -mp -Minfo gives me:
148, Parallel region activated
Parallel loop activated with static block schedule
206, Barrier
Parallel region terminated
150, Invariant if transformation
Loop not vectorized: may not be beneficial

If I switch the order of the for loops, then I get the same thing but without the "Loop not vectorized: may not be beneficial".

Why would it be doing this? The order of the loops shouldn't affect how it is parallelized, since they are independent. I would use the second way, but I have an operation that is in the outer loop only.

OpenACC doesn't have a problem with this, so I'm not sure why OpenMP is having trouble. Any advice?
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Nov 08, 2012 2:24 pm    Post subject: Reply with quote

Hi Kyle,

Quote:
Why would it be doing this? The order of the loops shouldn't affect how it is parallelized, since they are independent.
It's still parallelized, this message is about vectorization.

- Mat
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