open mp performance degradation

General OpenMP discussion

open mp performance degradation

Postby NITTINARORA » Thu Jul 03, 2008 9:31 pm

Given below (lintel Fortran compiler) FORTRAN 'do loop' takes 2 sec to compute if I dont use open mp directives.

But using open-mp as shown below takes 60 sec! any idea why such a regression in performance ? I have a core 2 duo processor.

i,s,m , j_val , b , track(:,:) are integers.
Perm_mat is a double precision , big dense 25 mb matrix
and h,h1,oneby6 are double precision constants

C(s:m,4) is double precision

Its basically getting the 4 coefficents of a spline polynomial- interpolation
!-----------------------------------------
!$OMP PARALLEL DO PRIVATE(I) DEFAULT(SHARED)
do i=s,m

j_val = track(j_imd(i,body),4) + b

C(i,1) = Perm_Mat(j_val,1)
C(i,2) = ( Perm_Mat((j_val+1),1) - Perm_Mat(j_val,1) )*h1 - h*oneby6*( & 2.00d0*Perm_Mat((j_val),2) + Perm_Mat((j_val+1),2) )
C(i,3) = Perm_Mat(j_val,2)*oneby2
C(i,4) = ( Perm_Mat((j_val+1),2) - Perm_Mat((j_val),2) )*h1*oneby6

end do
!$OMP END PARALLEL DO
!-------------------------------------------------------------------------

tHANKS ALL
NITTINARORA
 

Re: open mp performance degradation

Postby ejd » Fri Jul 04, 2008 8:23 am

First, you have a problem with the code you have shown. Variable "j_val" needs to be private. Second, you don't say what the values of "i" can be (lower bounds "s" and upper bounds "m"). Without more information it is hard to say what is going on. A guess would be that the array "C" is suffering from "false-sharing".
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Re: open mp performance degradation

Postby NITTINARORA » Fri Jul 04, 2008 4:26 pm

Thanks for the quick reply :)

I will try to see if I can get over these loop holes. Am experienced in FORTRAN but new to OPEN MP and parallel programming . Can you please give some good reading references on this material ?


Thanks...
NITTINARORA
 

Re: open mp performance degradation

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

Since I don't really know your experience level with parallel programming, it is hard to make a recommendation. There are a couple of books out on OpenMP and numerous articles on the web. Maybe someone else can offer a suggestion?
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 7 guests