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 something
}
}
I get this error: error: invalid controlling predicate.
I check the openMP reference guide and it says that for the parallel for it "only" allows one of the following operators: < <= > >=.
I don't understand why not allow i != j
. I could understand if it was the static schedule, since openMP need to pre-compute the number of iterations assigned to each thread. But i can't understand why this limitation in such case for example. Any clues ?
EDIT: even if I make for(i = 0; i != 100; i++)
, although I could just put "<" or "<=" .