Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
10 Views

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;
if (p != NULL)
{
#ifdef _OPENMP
++nPSize;
#endif
#pragma omp critical
{
p->vItems.push_back(c);
}
}
}
}
#ifdef ...


......
0 Kudos
2 Replies
Highlighted
Black Belt
10 Views

How could this example work with nowait?
0 Kudos
Highlighted
Beginner
10 Views

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.

0 Kudos