I was trying to compiled the following code:
#pragma omp parallel shared (j)
{
#pragma omp for schedule(dynamic)
for(i = 0; i != j; i++)
{
// do
The answer is simple. OpenMP does not allow premature termination of a team of threads. With == or !=, OpenMP has no way of determining when the loop stops. 1. One or more threads could hit the termination condition, which might not be unique. 2. OpenMP has no way to shut down the other threads that might never detect the condition.