- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 _OPENMP
nPSize /= nCount;
#endif
......
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How could this example work with nowait?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page