Suppose there is a vector odds, which stores the number of even and odd numbers, and there is a vector numbers, which stores these numbers themselves.
OpenMP parallelizable loop:
#pragma omp parallel for for (int i = 0; i < numbers.size(); ++i) { ++(odds[numbers[i] % 2]); } The serial and parallel versions of this cycle give different results. Where is the bug?