From 076803da1a80ab6ce1da182754616640b0b24c8d Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 10 Jun 2016 00:20:01 +0200 Subject: [PATCH] noprefetch --- src/det.irp.f | 66 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/src/det.irp.f b/src/det.irp.f index 0049d7b..c920099 100644 --- a/src/det.irp.f +++ b/src/det.irp.f @@ -324,14 +324,16 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) double precision :: zj, zj1, zj2, zj3 !DIR$ VECTOR ALIGNED - !DIR$ SIMD + !DIR$ NOPREFETCH + !DIR$ SIMD NOVECREMAINDER do i=1,$n u(i) = m(i) - S(i,l) enddo zj = 0.d0 !DIR$ VECTOR ALIGNED - !DIR$ SIMD REDUCTION(+:zj) + !DIR$ NOPREFETCH + !DIR$ SIMD REDUCTION(+:zj) NOVECREMAINDER do i=1,$n-1,4 zj = zj + S_inv(i,l)*u(i) + S_inv(i+1,l)*u(i+1) & + S_inv(i+2,l)*u(i+2) + S_inv(i+3,l)*u(i+3) @@ -352,7 +354,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj2 = 0.d0 zj3 = 0.d0 !DIR$ VECTOR ALIGNED - !DIR$ SIMD REDUCTION(+:zj,zj1,zj2,zj3) + !DIR$ NOPREFETCH + !DIR$ SIMD REDUCTION(+:zj,zj1,zj2,zj3) NOVECREMAINDER do i=1,$n zj = zj + S_inv(i,j )*u(i) zj1 = zj1 + S_inv(i,j+1)*u(i) @@ -366,7 +369,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) enddo !DIR$ VECTOR ALIGNED - !DIR$ SIMD FIRSTPRIVATE(d_inv) + !DIR$ NOPREFETCH + !DIR$ SIMD FIRSTPRIVATE(d_inv) NOVECREMAINDER do i=1,$n w(i) = S_inv(i,l)*d_inv S(i,l) = m(i) @@ -378,7 +382,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj2 = z(i+2) zj3 = z(i+3) !DIR$ VECTOR ALIGNED - !DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3) + !DIR$ NOPREFETCH + !DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3) NOVECREMAINDER do j=1,$n S_inv(j,i ) = S_inv(j,i )*lambda - w(j)*zj S_inv(j,i+1) = S_inv(j,i+1)*lambda - w(j)*zj1 @@ -452,12 +457,14 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) double precision :: zj, zj1, zj2, zj3 !DIR$ VECTOR ALIGNED - !DIR$ SIMD + !DIR$ NOPREFETCH + !DIR$ SIMD NOVECREMAINDER do i=1,$n u(i) = m(i) - S(i,l) enddo zj = 0.d0 + !DIR$ NOPREFETCH !DIR$ SIMD REDUCTION(+:zj) do i=1,$n-1,4 zj = zj + S_inv(i,l)*u(i) + S_inv(i+1,l)*u(i+1) & @@ -480,7 +487,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj2 = 0.d0 zj3 = 0.d0 !DIR$ VECTOR ALIGNED - !DIR$ SIMD REDUCTION(+:zj,zj1,zj2,zj3) + !DIR$ NOPREFETCH + !DIR$ SIMD REDUCTION(+:zj,zj1,zj2,zj3) NOVECREMAINDER do i=1,$n-1 zj = zj + S_inv(i,j )*u(i) zj1 = zj1 + S_inv(i,j+1)*u(i) @@ -495,14 +503,16 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj = 0.d0 !DIR$ VECTOR ALIGNED - !DIR$ SIMD REDUCTION(+:zj) - do i=1,$n + !DIR$ NOPREFETCH + !DIR$ SIMD REDUCTION(+:zj) NOVECREMAINDER + do i=1,$n-1 zj = zj + S_inv(i,$n)*u(i) enddo - z($n) = zj + z($n) = zj + S_inv($n,$n)*u($n) !DIR$ VECTOR ALIGNED - !DIR$ SIMD FIRSTPRIVATE(d_inv) + !DIR$ NOPREFETCH + !DIR$ SIMD FIRSTPRIVATE(d_inv) NOVECREMAINDER do i=1,$n w(i) = S_inv(i,l)*d_inv S(i,l) = m(i) @@ -514,7 +524,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj2 = z(i+2) zj3 = z(i+3) !DIR$ VECTOR ALIGNED - !DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3) + !DIR$ NOPREFETCH + !DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3) NOVECREMAINDER do j=1,$n-1 S_inv(j,i ) = S_inv(j,i )*lambda - w(j)*zj S_inv(j,i+1) = S_inv(j,i+1)*lambda - w(j)*zj1 @@ -529,7 +540,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj = z($n) !DIR$ VECTOR ALIGNED - !DIR$ SIMD FIRSTPRIVATE(lambda,zj) + !DIR$ NOPREFETCH + !DIR$ SIMD FIRSTPRIVATE(lambda,zj) NOVECREMAINDER do i=1,$n S_inv(i,$n) = S_inv(i,$n)*lambda -w(i)*zj enddo @@ -602,14 +614,16 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) double precision :: zj, zj1, zj2, zj3 !DIR$ VECTOR ALIGNED - !DIR$ SIMD + !DIR$ NOPREFETCH + !DIR$ SIMD NOVECREMAINDER do i=1,$n u(i) = m(i) - S(i,l) enddo zj = 0.d0 !DIR$ VECTOR ALIGNED - !DIR$ SIMD REDUCTION(+:zj) + !DIR$ NOPREFETCH + !DIR$ SIMD REDUCTION(+:zj) NOVECREMAINDER do i=1,$n-2,4 zj = zj + S_inv(i,l)*u(i) + S_inv(i+1,l)*u(i+1) & + S_inv(i+2,l)*u(i+2) + S_inv(i+3,l)*u(i+3) @@ -653,7 +667,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj = 0.d0 zj1 = 0.d0 !DIR$ VECTOR ALIGNED - !DIR$ SIMD REDUCTION(+:zj,zj1) + !DIR$ NOPREFETCH + !DIR$ SIMD REDUCTION(+:zj,zj1) NOVECREMAINDER do i=1,$n-2 zj = zj + S_inv(i,j )*u(i) zj1 = zj1 + S_inv(i,j+1)*u(i) @@ -664,7 +679,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) z(j+1) = z(j+1) + S_inv($n,j+1)*u($n) !DIR$ VECTOR ALIGNED - !DIR$ SIMD FIRSTPRIVATE(d_inv) + !DIR$ NOPREFETCH + !DIR$ SIMD FIRSTPRIVATE(d_inv) NOVECREMAINDER do i=1,$n w(i) = S_inv(i,l)*d_inv S(i,l) = m(i) @@ -780,7 +796,8 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj = 0.d0 !DIR$ VECTOR ALIGNED - !DIR$ SIMD REDUCTION(+:zj) + !DIR$ NOPREFETCH + !DIR$ SIMD REDUCTION(+:zj) NOVECREMAINDER do i=1,$n-3,4 zj = zj + S_inv(i,l)*u(i) + S_inv(i+1,l)*u(i+1) & + S_inv(i+2,l)*u(i+2) + S_inv(i+3,l)*u(i+3) @@ -830,6 +847,7 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj1 = 0.d0 zj2 = 0.d0 !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD REDUCTION(+:zj,zj1,zj2) do i=1,$n-3 zj = zj + S_inv(i,j )*u(i) @@ -847,6 +865,7 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) z(j+2) = z(j+2) + S_inv($n,j+2)*u($n) !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD FIRSTPRIVATE(d_inv) do i=1,$n w(i) = S_inv(i,l)*d_inv @@ -859,6 +878,7 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj2 = z(i+2) zj3 = z(i+3) !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3) do j=1,$n-3 S_inv(j,i ) = S_inv(j,i )*lambda - w(j)*zj @@ -885,6 +905,7 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d) zj1 = z(i+1) zj2 = z(i+2) !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2) do j=1,$n S_inv(j,i ) = S_inv(j,i )*lambda - w(j)*zj @@ -962,6 +983,7 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d) double precision :: zl !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD do i=1,n u(i) = m(i) - S(i,l) @@ -969,6 +991,7 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d) zl = 0.d0 !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD REDUCTION(+:zl) do i=1,n zl = zl + S_inv(i,l)*u(i) @@ -987,12 +1010,14 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d) n4 = iand(n,not(3)) !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH do j=1,n4,4 zj = 0.d0 zj1 = 0.d0 zj2 = 0.d0 zj3 = 0.d0 !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD REDUCTION(+:zj,zj1,zj2,zj3) do i=1,n zj = zj + S_inv(i,j )*u(i) @@ -1009,6 +1034,7 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d) do j=n4+1,n zj = 0.d0 !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD REDUCTION(+:zj) do i=1,n zj = zj + S_inv(i,j)*u(i) @@ -1017,6 +1043,7 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d) enddo !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD FIRSTPRIVATE(d_inv) do i=1,n w(i) = S_inv(i,l)*d_inv @@ -1024,6 +1051,7 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d) enddo !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD FIRSTPRIVATE(d_inv) do i=1,n w(i) = S_inv(i,l)*d_inv @@ -1036,6 +1064,7 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d) zj2 = z(i+2) zj3 = z(i+3) !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3) do j=1,n S_inv(j,i ) = S_inv(j,i )*lambda -zj *w(j) @@ -1048,6 +1077,7 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d) do i=n4+1,n zj = z(i) !DIR$ VECTOR ALIGNED + !DIR$ NOPREFETCH !DIR$ SIMD FIRSTPRIVATE(lambda,zj) do j=1,n S_inv(j,i) = S_inv(j,i)*lambda -zj*w(j)