mirror of
https://gitlab.com/scemama/qmcchem.git
synced 2025-01-02 17:45:39 +01:00
SIMD
This commit is contained in:
parent
f88fc822d9
commit
72baed17c2
174
src/det.irp.f
174
src/det.irp.f
@ -373,13 +373,17 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d)
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
do i=1,$n,4
|
do i=1,$n,4
|
||||||
|
zj = z(i )
|
||||||
|
zj1 = z(i+1)
|
||||||
|
zj2 = z(i+2)
|
||||||
|
zj3 = z(i+3)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3)
|
||||||
do j=1,$n
|
do j=1,$n
|
||||||
S_inv(j,i ) = S_inv(j,i )*lambda - w(j)*z(i )
|
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)*z(i+1)
|
S_inv(j,i+1) = S_inv(j,i+1)*lambda - w(j)*zj1
|
||||||
S_inv(j,i+2) = S_inv(j,i+2)*lambda - w(j)*z(i+2)
|
S_inv(j,i+2) = S_inv(j,i+2)*lambda - w(j)*zj2
|
||||||
S_inv(j,i+3) = S_inv(j,i+3)*lambda - w(j)*z(i+3)
|
S_inv(j,i+3) = S_inv(j,i+3)*lambda - w(j)*zj3
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -505,24 +509,29 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d)
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
do i=1,$n-1,4
|
do i=1,$n-1,4
|
||||||
|
zj = z(i )
|
||||||
|
zj1 = z(i+1)
|
||||||
|
zj2 = z(i+2)
|
||||||
|
zj3 = z(i+3)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3)
|
||||||
do j=1,$n-1
|
do j=1,$n-1
|
||||||
S_inv(j,i ) = S_inv(j,i )*lambda - w(j)*z(i )
|
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)*z(i+1)
|
S_inv(j,i+1) = S_inv(j,i+1)*lambda - w(j)*zj1
|
||||||
S_inv(j,i+2) = S_inv(j,i+2)*lambda - w(j)*z(i+2)
|
S_inv(j,i+2) = S_inv(j,i+2)*lambda - w(j)*zj2
|
||||||
S_inv(j,i+3) = S_inv(j,i+3)*lambda - w(j)*z(i+3)
|
S_inv(j,i+3) = S_inv(j,i+3)*lambda - w(j)*zj3
|
||||||
enddo
|
enddo
|
||||||
S_inv($n,i ) = S_inv($n,i )*lambda - w($n)*z(i )
|
S_inv($n,i ) = S_inv($n,i )*lambda - w($n)*zj
|
||||||
S_inv($n,i+1) = S_inv($n,i+1)*lambda - w($n)*z(i+1)
|
S_inv($n,i+1) = S_inv($n,i+1)*lambda - w($n)*zj1
|
||||||
S_inv($n,i+2) = S_inv($n,i+2)*lambda - w($n)*z(i+2)
|
S_inv($n,i+2) = S_inv($n,i+2)*lambda - w($n)*zj2
|
||||||
S_inv($n,i+3) = S_inv($n,i+3)*lambda - w($n)*z(i+3)
|
S_inv($n,i+3) = S_inv($n,i+3)*lambda - w($n)*zj3
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
zj = z($n)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,zj)
|
||||||
do i=1,$n
|
do i=1,$n
|
||||||
S_inv(i,$n) = S_inv(i,$n)*lambda -w(i)*z($n)
|
S_inv(i,$n) = S_inv(i,$n)*lambda -w(i)*zj
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
|
||||||
@ -662,35 +671,41 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d)
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
do i=1,$n-2,4
|
do i=1,$n-2,4
|
||||||
|
zj = z(i)
|
||||||
|
zj1 = z(i+1)
|
||||||
|
zj2 = z(i+2)
|
||||||
|
zj3 = z(i+3)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,z,zj1,zj2,zj3)
|
||||||
do j=1,$n-2
|
do j=1,$n-2
|
||||||
S_inv(j,i ) = S_inv(j,i )*lambda -z(i )*w(j)
|
S_inv(j,i ) = S_inv(j,i )*lambda -zj *w(j)
|
||||||
S_inv(j,i+1) = S_inv(j,i+1)*lambda -z(i+1)*w(j)
|
S_inv(j,i+1) = S_inv(j,i+1)*lambda -zj1*w(j)
|
||||||
S_inv(j,i+2) = S_inv(j,i+2)*lambda -z(i+2)*w(j)
|
S_inv(j,i+2) = S_inv(j,i+2)*lambda -zj2*w(j)
|
||||||
S_inv(j,i+3) = S_inv(j,i+3)*lambda -z(i+3)*w(j)
|
S_inv(j,i+3) = S_inv(j,i+3)*lambda -zj3*w(j)
|
||||||
enddo
|
enddo
|
||||||
S_inv($n-1,i ) = S_inv($n-1,i )*lambda -z(i )*w($n-1)
|
S_inv($n-1,i ) = S_inv($n-1,i )*lambda -zj *w($n-1)
|
||||||
S_inv($n ,i ) = S_inv($n ,i )*lambda -z(i )*w($n )
|
S_inv($n ,i ) = S_inv($n ,i )*lambda -zj *w($n )
|
||||||
S_inv($n-1,i+1) = S_inv($n-1,i+1)*lambda -z(i+1)*w($n-1)
|
S_inv($n-1,i+1) = S_inv($n-1,i+1)*lambda -zj1*w($n-1)
|
||||||
S_inv($n ,i+1) = S_inv($n ,i+1)*lambda -z(i+1)*w($n )
|
S_inv($n ,i+1) = S_inv($n ,i+1)*lambda -zj1*w($n )
|
||||||
S_inv($n-1,i+2) = S_inv($n-1,i+2)*lambda -z(i+2)*w($n-1)
|
S_inv($n-1,i+2) = S_inv($n-1,i+2)*lambda -zj2*w($n-1)
|
||||||
S_inv($n ,i+2) = S_inv($n ,i+2)*lambda -z(i+2)*w($n )
|
S_inv($n ,i+2) = S_inv($n ,i+2)*lambda -zj2*w($n )
|
||||||
S_inv($n-1,i+3) = S_inv($n-1,i+3)*lambda -z(i+3)*w($n-1)
|
S_inv($n-1,i+3) = S_inv($n-1,i+3)*lambda -zj3*w($n-1)
|
||||||
S_inv($n ,i+3) = S_inv($n ,i+3)*lambda -z(i+3)*w($n )
|
S_inv($n ,i+3) = S_inv($n ,i+3)*lambda -zj3*w($n )
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
i=$n-1
|
i=$n-1
|
||||||
|
zj = z(i)
|
||||||
|
zj1= z(i+1)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1)
|
||||||
do j=1,$n-2
|
do j=1,$n-2
|
||||||
S_inv(j,i ) = S_inv(j,i )*lambda -z(i )*w(j)
|
S_inv(j,i ) = S_inv(j,i )*lambda -zj*w(j)
|
||||||
S_inv(j,i+1) = S_inv(j,i+1)*lambda -z(i+1)*w(j)
|
S_inv(j,i+1) = S_inv(j,i+1)*lambda -zj1*w(j)
|
||||||
enddo
|
enddo
|
||||||
S_inv($n-1,i ) = S_inv($n-1,i )*lambda -z(i )*w($n-1)
|
S_inv($n-1,i ) = S_inv($n-1,i )*lambda -zj*w($n-1)
|
||||||
S_inv($n-1,i+1) = S_inv($n-1,i+1)*lambda -z(i+1)*w($n-1)
|
S_inv($n-1,i+1) = S_inv($n-1,i+1)*lambda -zj1*w($n-1)
|
||||||
S_inv($n ,i ) = S_inv($n ,i )*lambda -z(i )*w($n )
|
S_inv($n ,i ) = S_inv($n ,i )*lambda -zj*w($n )
|
||||||
S_inv($n ,i+1) = S_inv($n ,i+1)*lambda -z(i+1)*w($n )
|
S_inv($n ,i+1) = S_inv($n ,i+1)*lambda -zj1*w($n )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -816,11 +831,20 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d)
|
|||||||
zj2 = 0.d0
|
zj2 = 0.d0
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD REDUCTION(+:zj,zj1,zj2)
|
!DIR$ SIMD REDUCTION(+:zj,zj1,zj2)
|
||||||
do i=1,$n
|
do i=1,$n-3
|
||||||
zj = zj + S_inv(i,j )*u(i)
|
zj = zj + S_inv(i,j )*u(i)
|
||||||
zj1 = zj1 + S_inv(i,j+1)*u(i)
|
zj1 = zj1 + S_inv(i,j+1)*u(i)
|
||||||
zj2 = zj2 + S_inv(i,j+2)*u(i)
|
zj2 = zj2 + S_inv(i,j+2)*u(i)
|
||||||
enddo
|
enddo
|
||||||
|
z(j ) = zj + S_inv($n-2,j )*u($n-2)
|
||||||
|
z(j ) = z(j ) + S_inv($n-1,j )*u($n-1)
|
||||||
|
z(j ) = z(j ) + S_inv($n,j )*u($n)
|
||||||
|
z(j+1) = zj1 + S_inv($n-2,j+1)*u($n-2)
|
||||||
|
z(j+1) = z(j+1) + S_inv($n-1,j+1)*u($n-1)
|
||||||
|
z(j+1) = z(j+1) + S_inv($n,j+1)*u($n)
|
||||||
|
z(j+2) = zj2 + S_inv($n-2,j+2)*u($n-2)
|
||||||
|
z(j+2) = z(j+2) + S_inv($n-1,j+2)*u($n-1)
|
||||||
|
z(j+2) = z(j+2) + S_inv($n,j+2)*u($n)
|
||||||
|
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(d_inv)
|
!DIR$ SIMD FIRSTPRIVATE(d_inv)
|
||||||
@ -830,37 +854,45 @@ subroutine det_update$n(n,LDS,m,l,S,S_inv,d)
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
do i=1,$n-3,4
|
do i=1,$n-3,4
|
||||||
|
zj = z(i)
|
||||||
|
zj1 = z(i+1)
|
||||||
|
zj2 = z(i+2)
|
||||||
|
zj3 = z(i+3)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3)
|
||||||
do j=1,$n-3
|
do j=1,$n-3
|
||||||
S_inv(j,i ) = S_inv(j,i )*lambda - w(j)*z(i )
|
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)*z(i+1)
|
S_inv(j,i+1) = S_inv(j,i+1)*lambda - w(j)*zj1
|
||||||
S_inv(j,i+2) = S_inv(j,i+2)*lambda - w(j)*z(i+2)
|
S_inv(j,i+2) = S_inv(j,i+2)*lambda - w(j)*zj2
|
||||||
S_inv(j,i+3) = S_inv(j,i+3)*lambda - w(j)*z(i+3)
|
S_inv(j,i+3) = S_inv(j,i+3)*lambda - w(j)*zj3
|
||||||
enddo
|
enddo
|
||||||
S_inv($n-2,i ) = S_inv($n-2,i )*lambda -z(i )*w($n-2)
|
S_inv($n-2,i ) = S_inv($n-2,i )*lambda -zj *w($n-2)
|
||||||
S_inv($n-1,i ) = S_inv($n-1,i )*lambda -z(i )*w($n-1)
|
S_inv($n-1,i ) = S_inv($n-1,i )*lambda -zj *w($n-1)
|
||||||
S_inv($n ,i ) = S_inv($n ,i )*lambda -z(i )*w($n )
|
S_inv($n ,i ) = S_inv($n ,i )*lambda -zj *w($n )
|
||||||
S_inv($n-2,i+1) = S_inv($n-2,i+1)*lambda -z(i+1)*w($n-2)
|
S_inv($n-2,i+1) = S_inv($n-2,i+1)*lambda -zj1*w($n-2)
|
||||||
S_inv($n-1,i+1) = S_inv($n-1,i+1)*lambda -z(i+1)*w($n-1)
|
S_inv($n-1,i+1) = S_inv($n-1,i+1)*lambda -zj1*w($n-1)
|
||||||
S_inv($n ,i+1) = S_inv($n ,i+1)*lambda -z(i+1)*w($n )
|
S_inv($n ,i+1) = S_inv($n ,i+1)*lambda -zj1*w($n )
|
||||||
S_inv($n-2,i+2) = S_inv($n-2,i+2)*lambda -z(i+2)*w($n-2)
|
S_inv($n-2,i+2) = S_inv($n-2,i+2)*lambda -zj2*w($n-2)
|
||||||
S_inv($n-1,i+2) = S_inv($n-1,i+2)*lambda -z(i+2)*w($n-1)
|
S_inv($n-1,i+2) = S_inv($n-1,i+2)*lambda -zj2*w($n-1)
|
||||||
S_inv($n ,i+2) = S_inv($n ,i+2)*lambda -z(i+2)*w($n )
|
S_inv($n ,i+2) = S_inv($n ,i+2)*lambda -zj2*w($n )
|
||||||
S_inv($n-2,i+3) = S_inv($n-2,i+3)*lambda -z(i+3)*w($n-2)
|
S_inv($n-2,i+3) = S_inv($n-2,i+3)*lambda -zj3*w($n-2)
|
||||||
S_inv($n-1,i+3) = S_inv($n-1,i+3)*lambda -z(i+3)*w($n-1)
|
S_inv($n-1,i+3) = S_inv($n-1,i+3)*lambda -zj3*w($n-1)
|
||||||
S_inv($n ,i+3) = S_inv($n ,i+3)*lambda -z(i+3)*w($n )
|
S_inv($n ,i+3) = S_inv($n ,i+3)*lambda -zj3*w($n )
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
i=$n-2
|
i=$n-2
|
||||||
|
zj = z(i)
|
||||||
|
zj1 = z(i+1)
|
||||||
|
zj2 = z(i+2)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2)
|
||||||
do j=1,$n
|
do j=1,$n
|
||||||
S_inv(j,i ) = S_inv(j,i )*lambda - w(j)*z(i )
|
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)*z(i+1)
|
S_inv(j,i+1) = S_inv(j,i+1)*lambda - w(j)*zj1
|
||||||
S_inv(j,i+2) = S_inv(j,i+2)*lambda - w(j)*z(i+2)
|
S_inv(j,i+2) = S_inv(j,i+2)*lambda - w(j)*zj2
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
SUBST [ n ]
|
SUBST [ n ]
|
||||||
@ -991,22 +1023,34 @@ subroutine det_update_general(n,LDS,m,l,S,S_inv,d)
|
|||||||
S(i,l) = m(i)
|
S(i,l) = m(i)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
!DIR$ VECTOR ALIGNED
|
||||||
|
!DIR$ SIMD FIRSTPRIVATE(d_inv)
|
||||||
|
do i=1,n
|
||||||
|
w(i) = S_inv(i,l)*d_inv
|
||||||
|
S(i,l) = m(i)
|
||||||
|
enddo
|
||||||
|
|
||||||
do i=1,n4,4
|
do i=1,n4,4
|
||||||
|
zj = z(i)
|
||||||
|
zj1 = z(i+1)
|
||||||
|
zj2 = z(i+2)
|
||||||
|
zj3 = z(i+3)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,zj,zj1,zj2,zj3)
|
||||||
do j=1,n
|
do j=1,n
|
||||||
S_inv(j,i ) = S_inv(j,i )*lambda -z(i )*w(j)
|
S_inv(j,i ) = S_inv(j,i )*lambda -zj *w(j)
|
||||||
S_inv(j,i+1) = S_inv(j,i+1)*lambda -z(i+1)*w(j)
|
S_inv(j,i+1) = S_inv(j,i+1)*lambda -zj1*w(j)
|
||||||
S_inv(j,i+2) = S_inv(j,i+2)*lambda -z(i+2)*w(j)
|
S_inv(j,i+2) = S_inv(j,i+2)*lambda -zj2*w(j)
|
||||||
S_inv(j,i+3) = S_inv(j,i+3)*lambda -z(i+3)*w(j)
|
S_inv(j,i+3) = S_inv(j,i+3)*lambda -zj3*w(j)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
do i=n4+1,n
|
do i=n4+1,n
|
||||||
|
zj = z(i)
|
||||||
!DIR$ VECTOR ALIGNED
|
!DIR$ VECTOR ALIGNED
|
||||||
!DIR$ SIMD FIRSTPRIVATE(lambda,z)
|
!DIR$ SIMD FIRSTPRIVATE(lambda,zj)
|
||||||
do j=1,n
|
do j=1,n
|
||||||
S_inv(j,i) = S_inv(j,i)*lambda -z(i)*w(j)
|
S_inv(j,i) = S_inv(j,i)*lambda -zj*w(j)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user