[Users] OpenMP is making it slower?
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
& agxx, agxy, agxz, agyy, agyz, agzz,
& aKxx, aKxy, aKxz, aKyy, aKyz, aKzz,
& ax, ay, az, nx, ny, nz, ibonly, k
And that's it. Also, 'bkslice' includes a write statement for the "progress indicator" I wanted to preserve. All works well.
FYI. Thanks guys.
-------------- next part --------------
A non-text attachment was scrubbed...
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