Do you guys have any suggestion on the following parallelization? In the code "ne" and "ne2" are two integer vectors. As shown, the exit condition of the first parallel "for loop" depends on "ne" and values can be added into "ne" inside the loop. But, what I am getting is, the code consider only the INITIAL size of ne when terminates, even though the size is increasing inside the loop.
I appreciate your helps. Thanks.
#pragma omp parallel for shared(ne) private(ne2, k)
for (j = 0; j < ne.size(); j++)
// SOME ADDITIONAL CODES ARE HERE that insert values to "ne2"
for(k = 0; k < ne2.size(); k++)
#pragma omp critical