问题
My code looks-like as below:
#pragma omp parallel for num_threads(5)
for(int i = 0; i < N; i++)
{
//some code
//#pragma omp parallel for reduction(+ : S_x,S_y,S_theta)
for(int j = 0; j < N; j++)
{
if (j==i) continue;
// some code
for(int ky = -1; ky<= 1; ky++)
{
for(int kx = -1; kx<= 1; kx++)
{
//some code
if (r_ij_square > l0_two)
{
//some code
}
}
}
}
//some code
}
I'm not sure if continue
in above code could cause any prblem or not. To avoid any problem, I have ignored second #pragma
in above code by //
. But I'm not still sure if above code could cause any problem due to using continue
or not? My question is if above code could cause problem or not, and if yes, how can I remove the problem?
When searching, I found these two sentences loops with "restricted" continue statements can be parallelized.
or Only an iteration of the innermost associated loop may be curtailed by a continue statement.
. But I don't know what do they mean exactly
来源:https://stackoverflow.com/questions/47426526/using-continue-inside-the-paralleld-for-loop