Bug report: Intel C++ Compiler 10.1: OpenMP running fails. (while MSCL is OK)

Bug report: Intel C++ Compiler 10.1: OpenMP running fails. (while MSCL is OK)

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!
{
#ifdef _OPENMP
#pragma omp for reduction(+: nPSize) nowait
for (int c = 0; c <= BlockMax; ++c)
#else
for (BlockT c = 0; c <= BlockMax; ++c)
#endif
{
const PieceT a = genPiece(c);
PieceStat* p = stat[a];
if (p != NULL)
{
#ifdef _OPENMP
++nPSize;
#endif
#pragma omp critical
{
p->vItems.push_back(c);
}
}
}
}
#ifdef _OPENMP
nPSize /= nCount;
#endif
......
3 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

How could this example work with nowait?

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.

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!