Two threads always serialized

General OpenMP discussion

Two threads always serialized

Postby mvalle » Tue Jul 17, 2012 10:03 pm

Application: C++ pure OpenMP on Linux compiled with gcc.

Looking at it with Vampir (profiling tool) I notice that in all my simple parallel for the last thread starts always after the end of the first one or sometimes the first function call in the first thread is stretched till the end of the last thread execution. In the body of the for there are no lock, no critical sections, nothing except computation. Also there are plenty of cores available and the behavior happens with different number of threads.

Any idea?

I'm happy to reduce the number of cores I'm using for my code to avoid this behavior and obtain a decent scalability of the application.
Thanks for your help!
mario
mvalle
 
Posts: 3
Joined: Mon Jul 16, 2012 11:50 pm

Re: Two threads always serialized

Postby MarkB » Fri Jul 20, 2012 3:20 am

Sounds like the runtime is not managing/scheduling threads correctly. What version of gcc are you using?

If you have not already done so it might be worth trying the following environment variable settings:
OMP_DYNAMIC=false
OMP_PROC_BIND=true
OMP_WAIT_POLICY=active
MarkB
 
Posts: 487
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Two threads always serialized

Postby mvalle » Fri Jul 20, 2012 6:47 am

I'm using gcc 4.7.0 on Cray XK6.

I tried your suggestion, but the execution becomes mortally slow and was not able to obtain a trace to check if the problem has been solved. I will retry and I'll keep you informed.
Thanks!
mario
mvalle
 
Posts: 3
Joined: Mon Jul 16, 2012 11:50 pm

Re: Two threads always serialized

Postby MarkB » Fri Jul 20, 2012 10:55 am

mvalle wrote:I'm using gcc 4.7.0 on Cray XK6.


Aha! I have seen a problem before with gcc and OpenMP on the Cray: try running your job with aprun -cc none (and without setting OMP_PROC_BIND=true).

If you are able to, it would be better to use the Cray compiler (or PGI, if that is installed).
MarkB
 
Posts: 487
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh

Re: Two threads always serialized

Postby mvalle » Sun Jul 22, 2012 9:48 am

Yes! following your suggestion I solved the serialization problem. Thanks.
Anyway, now I build the application using the Intel compiler and everything works well.
Thanks again
mario
mvalle
 
Posts: 3
Joined: Mon Jul 16, 2012 11:50 pm


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot] and 11 guests