Can “#pragma omp parallel for” be used inside a loop in the following form:
For (i=0;i<...;.i+=1)
{ #pragma omp parallel for
for(j=0;j<...;j+=1)
{ Some code.....}
- Will this just parralelize the loop on ‘j’ ?
Thanks on advence !
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it can be used like that. But compiler directives have to be on a line of their own
Also, this will indeed only execute the inner loop in parallel. If you need both loops to execute in parallel you need a second
#pragma omp parallel forabove the outer loop.