mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-05 11:00:10 +01:00
OMP atomic
This commit is contained in:
parent
607164a4ac
commit
0aadde30a0
@ -477,13 +477,12 @@ subroutine H_u_0_mrcc_nstates(v_0,u_0,H_jj,n,keys_tmp,Nint,istate_in,N_st,sze_8)
|
|||||||
enddo
|
enddo
|
||||||
!$OMP END DO
|
!$OMP END DO
|
||||||
|
|
||||||
!$OMP CRITICAL
|
|
||||||
do istate=1,N_st
|
do istate=1,N_st
|
||||||
do i=n,1,-1
|
do i=n,1,-1
|
||||||
|
!$OMP ATOMIC
|
||||||
v_0(i,istate) = v_0(i,istate) + vt(i,istate)
|
v_0(i,istate) = v_0(i,istate) + vt(i,istate)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
!$OMP END CRITICAL
|
|
||||||
|
|
||||||
deallocate(vt)
|
deallocate(vt)
|
||||||
!$OMP END PARALLEL
|
!$OMP END PARALLEL
|
||||||
@ -1115,14 +1114,14 @@ subroutine H_S2_u_0_mrcc_nstates(v_0,s_0,u_0,H_jj,S2_jj,n,keys_tmp,Nint,istate_i
|
|||||||
! End Specific to dressing
|
! End Specific to dressing
|
||||||
! ------------------------
|
! ------------------------
|
||||||
|
|
||||||
!$OMP CRITICAL
|
|
||||||
do istate=1,N_st
|
do istate=1,N_st
|
||||||
do i=n,1,-1
|
do i=n,1,-1
|
||||||
|
!$OMP ATOMIC
|
||||||
v_0(i,istate) = v_0(i,istate) + vt(istate,i)
|
v_0(i,istate) = v_0(i,istate) + vt(istate,i)
|
||||||
|
!$OMP ATOMIC
|
||||||
s_0(i,istate) = s_0(i,istate) + st(istate,i)
|
s_0(i,istate) = s_0(i,istate) + st(istate,i)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
!$OMP END CRITICAL
|
|
||||||
|
|
||||||
deallocate(vt,st)
|
deallocate(vt,st)
|
||||||
!$OMP END PARALLEL
|
!$OMP END PARALLEL
|
||||||
|
@ -13,6 +13,7 @@ use bitmasks
|
|||||||
integer(bit_kind),allocatable :: buf(:,:,:)
|
integer(bit_kind),allocatable :: buf(:,:,:)
|
||||||
logical :: ok
|
logical :: ok
|
||||||
logical, external :: detEq
|
logical, external :: detEq
|
||||||
|
integer, external :: omp_get_thread_num
|
||||||
|
|
||||||
delta_ij_mrcc = 0d0
|
delta_ij_mrcc = 0d0
|
||||||
delta_ii_mrcc = 0d0
|
delta_ii_mrcc = 0d0
|
||||||
@ -291,26 +292,30 @@ subroutine mrcc_part_dress(delta_ij_, delta_ii_,delta_ij_s2_, delta_ii_s2_,i_gen
|
|||||||
dIa_sla(i_state,k_sd) = dIa(i_state) * sla
|
dIa_sla(i_state,k_sd) = dIa(i_state) * sla
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
call omp_set_lock( psi_ref_lock(i_I) )
|
|
||||||
do i_state=1,N_states
|
do i_state=1,N_states
|
||||||
if(dabs(psi_ref_coef(i_I,i_state)).ge.1.d-3)then
|
if(dabs(psi_ref_coef(i_I,i_state)).ge.1.d-3)then
|
||||||
do l_sd=1,idx_alpha(0)
|
do l_sd=1,idx_alpha(0)
|
||||||
k_sd = idx_alpha(l_sd)
|
k_sd = idx_alpha(l_sd)
|
||||||
|
!$OMP ATOMIC
|
||||||
delta_ij_(i_state,k_sd,i_I) = delta_ij_(i_state,k_sd,i_I) + dIa_hla(i_state,k_sd)
|
delta_ij_(i_state,k_sd,i_I) = delta_ij_(i_state,k_sd,i_I) + dIa_hla(i_state,k_sd)
|
||||||
|
!$OMP ATOMIC
|
||||||
delta_ii_(i_state,i_I) = delta_ii_(i_state,i_I) - dIa_hla(i_state,k_sd) * ci_inv(i_state) * psi_non_ref_coef_transp(i_state,k_sd)
|
delta_ii_(i_state,i_I) = delta_ii_(i_state,i_I) - dIa_hla(i_state,k_sd) * ci_inv(i_state) * psi_non_ref_coef_transp(i_state,k_sd)
|
||||||
|
!$OMP ATOMIC
|
||||||
delta_ij_s2_(i_state,k_sd,i_I) = delta_ij_s2_(i_state,k_sd,i_I) + dIa_sla(i_state,k_sd)
|
delta_ij_s2_(i_state,k_sd,i_I) = delta_ij_s2_(i_state,k_sd,i_I) + dIa_sla(i_state,k_sd)
|
||||||
|
!$OMP ATOMIC
|
||||||
delta_ii_s2_(i_state,i_I) = delta_ii_s2_(i_state,i_I) - dIa_sla(i_state,k_sd) * ci_inv(i_state) * psi_non_ref_coef_transp(i_state,k_sd)
|
delta_ii_s2_(i_state,i_I) = delta_ii_s2_(i_state,i_I) - dIa_sla(i_state,k_sd) * ci_inv(i_state) * psi_non_ref_coef_transp(i_state,k_sd)
|
||||||
enddo
|
enddo
|
||||||
else
|
else
|
||||||
delta_ii_(i_state,i_I) = 0.d0
|
delta_ii_(i_state,i_I) = 0.d0
|
||||||
do l_sd=1,idx_alpha(0)
|
do l_sd=1,idx_alpha(0)
|
||||||
k_sd = idx_alpha(l_sd)
|
k_sd = idx_alpha(l_sd)
|
||||||
|
!$OMP ATOMIC
|
||||||
delta_ij_(i_state,k_sd,i_I) = delta_ij_(i_state,k_sd,i_I) + 0.5d0*dIa_hla(i_state,k_sd)
|
delta_ij_(i_state,k_sd,i_I) = delta_ij_(i_state,k_sd,i_I) + 0.5d0*dIa_hla(i_state,k_sd)
|
||||||
|
!$OMP ATOMIC
|
||||||
delta_ij_s2_(i_state,k_sd,i_I) = delta_ij_s2_(i_state,k_sd,i_I) + 0.5d0*dIa_sla(i_state,k_sd)
|
delta_ij_s2_(i_state,k_sd,i_I) = delta_ij_s2_(i_state,k_sd,i_I) + 0.5d0*dIa_sla(i_state,k_sd)
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
call omp_unset_lock( psi_ref_lock(i_I) )
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
deallocate (dIa_hla,dIa_sla,hij_cache,sij_cache)
|
deallocate (dIa_hla,dIa_sla,hij_cache,sij_cache)
|
||||||
@ -329,7 +334,6 @@ end
|
|||||||
integer :: i, j, i_state
|
integer :: i, j, i_state
|
||||||
|
|
||||||
!mrmode : 1=mrcepa0, 2=mrsc2 add, 3=mrcc
|
!mrmode : 1=mrcepa0, 2=mrsc2 add, 3=mrcc
|
||||||
PROVIDE psi_ref_lock
|
|
||||||
|
|
||||||
if(mrmode == 3) then
|
if(mrmode == 3) then
|
||||||
do i = 1, N_det_ref
|
do i = 1, N_det_ref
|
||||||
|
@ -223,13 +223,12 @@ subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8)
|
|||||||
enddo
|
enddo
|
||||||
!$OMP END DO NOWAIT
|
!$OMP END DO NOWAIT
|
||||||
|
|
||||||
!$OMP CRITICAL
|
|
||||||
do istate=1,N_st
|
do istate=1,N_st
|
||||||
do i=n,1,-1
|
do i=n,1,-1
|
||||||
|
!$OMP ATOMIC
|
||||||
v_0(i,istate) = v_0(i,istate) + vt(i,istate)
|
v_0(i,istate) = v_0(i,istate) + vt(i,istate)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
!$OMP END CRITICAL
|
|
||||||
|
|
||||||
deallocate(vt)
|
deallocate(vt)
|
||||||
!$OMP END PARALLEL
|
!$OMP END PARALLEL
|
||||||
|
Loading…
Reference in New Issue
Block a user