nested parallelism

General OpenMP discussion

nested parallelism

Postby yoav naveh » Tue Jul 29, 2008 8:07 am

Hello All,

I run into a weird problem using OMP with nested parallelism. I'v run the following code:


int id;
#pragma omp parallel for schedule(static)
for (ii = 0; ii < 5; ++ii) // for more averaged time measurements
int i, j, k;
#pragma omp parallel for private(j, k, i) schedule(static)
for (k = 0; k < loopSize; ++k)

#pragma omp parallel for private(j, i)
for (i = 0; i < loopSize2; ++i)

in short, there are 3 levels of parallelism.
when I run it on a 2-core CPU (in VS2005) the program run infinitely with the CPU worling 100%. looks like some kind of deadlock!
when breaking the run with the debuger and looking at the stack, I saw that the topmost location of each of the threads was
vcompd.dll!_vcomp::PartialBarrier1_Poll::Block() + 0x3f bytes

what is the problem ?
if I use only 2 levels of parallelisation everything works o.k., is there a limit to the number of nested omp directives ?

yoav naveh

Re: nested parallelism

Postby ejd » Wed Aug 13, 2008 11:05 pm

Unfortunately I do not have the particular software you are using setup to try this out. This forum is really to answer OpenMP questions and not questions about specific vendor implementations. I have tried your code using a couple of other implementations and it runs fine. I see that you have dynamic set to true. Some early implementations had some problems with this so you might try setting it to false. I also see you are using 4 threads with three levels of nesting. This could require up to 64 threads which is the maximum that the Microsoft implementation supports. You might try using 3 threads and see what happens. The only other suggestion I have is to post your problem in a Microsoft forum and see if you get an answer.
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Return to Using OpenMP

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests