On Thu, 30 Jul 2020, Damian McGuckin wrote:
To be fair and match what I to do in Chapel, I instead should save the
results of those dot products in an intermediate vector, t(*) as:
do i=1,n
t(i) = ddot(n, x, z(1, i)) // i.e. a = x.(column j of z(*,*))
end do
do i=1,n
axpy(n, a, x, z(1, i)) // (column j of z(*, *)) += a * x
end do
This runs a whole 20% Wow. Incredible! I fell off my chair!
... This runs a whole 20% SLOWER! Sorry.
So this Fortran technique of having the dot product in the same loop as
the vector addition has a performance gain of 1.0/0.8 = 125%. Or forcing
the storage of the intermediate results has the penalty.
It was obvious.
The original Fortran has the column in cache from the dot product.
It then does the vector addition on stuff in the cache.
Storing it causes memory to be scanned twice. No wonder there is a
penalty.
In Chapel's case, we have to store it in memory. As I said, I can live
with that.
Regards - Damian
Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers