I get right result at mscl, but wrong at icl.
It happens atp->vItems, where items pushed wrong.
#pragma omp parallel// this section fails in ICL!
#pragma omp for reduction(+: nPSize) nowait
for (int c = 0; c <= BlockMax; ++c)
for (BlockT c = 0; c <= BlockMax; ++c)
const PieceT a = genPiece(c);
PieceStat* p = stat;
if (p != NULL)
#pragma omp critical
According to the convention of OpenMP, nowait overrides the barrier implicit in a directive. Barrier synchronizes all threads in a team.
Since the outside parallel directive has an enforced barrier, the inside for directive has no necessary to use a barrier.