[Users] OpenMP is making it slower?
Scott Hawley
scott.hawley at belmont.edu
Thu May 26 13:39:31 CDT 2011
As a follow-up....
In terms of performance: it turns out that, despite the overhead associated with defining 1000's of temporary variables over & over, it's not actually that time-consuming. Thus, parallelization via OpenMP "wins" in the end.
In terms of coding: Trying to declare "privates" and/or "shared" carefully was too much work. In the end I put it all in another subroutine --- Frank's original suggestion -- and got the benefit of the compiler helping me track the variables. :-)
So the relecant part of my code now reads
!$OMP PARALLEL DO DEFAULT(SHARED) SCHEDULE(STATIC,chunk) PRIVATE(k)
do k = 1, nz
call bksslice(
& agxx, agxy, agxz, agyy, agyz, agzz,
& aKxx, aKxy, aKxz, aKyy, aKyz, aKzz,
& mask,
& M1,a1,pos1x,pos1y,pos1z,vx_1,vy_1,vz_1,v_1,v1,n1,
& gam_1,gam1,theta1,phi1,
& M2,a2,pos2x,pos2y,pos2z,vx_2,vy_2,vz_2,v_2,v2,n2,
& gam_2,gam2,theta2,phi2,
& ax, ay, az, nx, ny, nz, ibonly, k
& )
enddo
And that's it. Also, 'bkslice' includes a write statement for the "progress indicator" I wanted to preserve. All works well.
FYI. Thanks guys.
-Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 535 bytes
Desc: This is a digitally signed message part
Url : http://lists.einsteintoolkit.org/pipermail/users/attachments/20110526/75fb53a3/attachment.bin
More information about the Users
mailing list