PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

openmp does not perform as expected

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Reggie



Joined: 16 Sep 2005
Posts: 5

PostPosted: Thu Aug 07, 2008 5:23 pm    Post subject: openmp does not perform as expected Reply with quote

Hi there,

We are porting a package from Windows to linux (32 bit Redhat 9).
We use openmp to compile since our Windows and linux have multiple
CPUs.

On Windows, we got good performance with Intel Intel Fortran. However,
using 1 CPU and 2 CPUs to run on linux got about the same performance
(same elapsed/CPU time with the linux having very little load).

On linux, we have PGI workstation 7.2-3 and benchmark code pi.f works
perfectly. Therefore we are confident that PGI fortran has been installed properly.

The bizare thing is the following. Command top did show both CPU0 and
CPU1 with nearly 100% usage (the executable is the only main load while
running our package). This is for OMP_NUM_THREADS=2. Besides, the
executable (only one shown) has correct increase under column TIME,
which is about 10 second increase at each 5-sec flash.

With OMP_NUM_THREADS=1, it is 5 second increase under column TIME
to corresponding executable at each 5-sec flash. And the elapsed time
is about the same as running the executable with OMP_NUM_THREADS=2.

Any opinion on this situation (no performance advantage with 2 CPUs)
is appreciated.

Reggie
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Fri Aug 08, 2008 9:10 am    Post subject: Reply with quote

Hi Reggie,

Suse 9.0 and Redhat 9.0's Native POSIX Thread Library (NPTL) has problems with OpenMP threading since NPTL was not fully supported in the 2.4 kernel. I would suggest moving to an OS with a 2.6 kernel such as SuSE 9.1 (or later) or Fedora.

- Mat
Back to top
View user's profile
Reggie



Joined: 16 Sep 2005
Posts: 5

PostPosted: Fri Aug 08, 2008 10:30 am    Post subject: Reply with quote

Hi Mat,

Thanks for the info.

Indeed pi.f, the test program that I used running successfully with clear
performance improvement, is too simple since it only has one loop.
!$OMP PARALLEL DO PRIVATE(x), SHARED(w)
!$OMP& REDUCTION(+: sum)
do i = 1, n
x = w * (i - 0.5d0)
sum = sum + f(x)
enddo

Our package is more complicated.

Another question related to this issue is:
If I take the executable built on 2.4 kernel with -mp to 2.6 kernel,
will I get enhancement with OMP_NUM_THREADS=2?

Best regards,

Reggie
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Fri Aug 08, 2008 12:18 pm    Post subject: Reply with quote

Hi Reggie,

It should but let us know if it doesn't.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group