mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 03:23:29 +01:00
Reduce memory
This commit is contained in:
parent
349f956e1c
commit
1e390d8357
@ -33,8 +33,7 @@ END_PROVIDER
|
|||||||
double precision, parameter :: dscale = 1.d0
|
double precision, parameter :: dscale = 1.d0
|
||||||
|
|
||||||
double precision, allocatable :: D(:), Delta(:,:), Ltmp_p(:,:), Ltmp_q(:,:)
|
double precision, allocatable :: D(:), Delta(:,:), Ltmp_p(:,:), Ltmp_q(:,:)
|
||||||
integer, allocatable :: Lset(:), Dset(:), addr(:,:), LDmap(:), DLmap(:)
|
integer, allocatable :: Lset(:), Dset(:), addr(:,:)
|
||||||
integer, allocatable :: Lset_rev(:), Dset_rev(:)
|
|
||||||
logical, allocatable :: computed(:)
|
logical, allocatable :: computed(:)
|
||||||
|
|
||||||
integer :: i,j,k,m,p,q, qj, dj, p2, q2
|
integer :: i,j,k,m,p,q, qj, dj, p2, q2
|
||||||
@ -47,8 +46,6 @@ END_PROVIDER
|
|||||||
double precision, external :: ao_two_e_integral
|
double precision, external :: ao_two_e_integral
|
||||||
integer :: block_size, iblock, ierr
|
integer :: block_size, iblock, ierr
|
||||||
|
|
||||||
integer(omp_lock_kind), allocatable :: lock(:)
|
|
||||||
|
|
||||||
double precision :: mem
|
double precision :: mem
|
||||||
double precision, external :: memory_of_double, memory_of_int
|
double precision, external :: memory_of_double, memory_of_int
|
||||||
|
|
||||||
@ -100,12 +97,8 @@ END_PROVIDER
|
|||||||
|
|
||||||
rank = 0
|
rank = 0
|
||||||
|
|
||||||
allocate( D(ndim), Lset(ndim), LDmap(ndim), DLmap(ndim), Dset(ndim) )
|
allocate( D(ndim), Lset(ndim), Dset(ndim) )
|
||||||
allocate( Lset_rev(ndim), Dset_rev(ndim), lock(ndim) )
|
|
||||||
allocate( addr(3,ndim) )
|
allocate( addr(3,ndim) )
|
||||||
do k=1,ndim
|
|
||||||
call omp_init_lock(lock(k))
|
|
||||||
enddo
|
|
||||||
|
|
||||||
! 1.
|
! 1.
|
||||||
k=0
|
k=0
|
||||||
@ -139,12 +132,10 @@ END_PROVIDER
|
|||||||
|
|
||||||
! 2.
|
! 2.
|
||||||
np=0
|
np=0
|
||||||
Lset_rev = 0
|
|
||||||
do p=1,ndim
|
do p=1,ndim
|
||||||
if ( dscale*dscale*Dmax*D(p) > tau*tau ) then
|
if ( dscale*dscale*Dmax*D(p) > tau*tau ) then
|
||||||
np = np+1
|
np = np+1
|
||||||
Lset(np) = p
|
Lset(np) = p
|
||||||
Lset_rev(p) = np
|
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -169,16 +160,10 @@ END_PROVIDER
|
|||||||
|
|
||||||
! c.
|
! c.
|
||||||
nq=0
|
nq=0
|
||||||
LDmap = 0
|
|
||||||
DLmap = 0
|
|
||||||
Dset_rev = 0
|
|
||||||
do p=1,np
|
do p=1,np
|
||||||
if ( D(Lset(p)) > Dmin ) then
|
if ( D(Lset(p)) > Dmin ) then
|
||||||
nq = nq+1
|
nq = nq+1
|
||||||
Dset(nq) = Lset(p)
|
Dset(nq) = Lset(p)
|
||||||
Dset_rev(Dset(nq)) = nq
|
|
||||||
LDmap(p) = nq
|
|
||||||
DLmap(nq) = p
|
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -380,21 +365,15 @@ END_PROVIDER
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
np=0
|
np=0
|
||||||
Lset_rev = 0
|
|
||||||
do p=1,ndim
|
do p=1,ndim
|
||||||
if ( dscale*dscale*Dmax*D(p) > tau*tau ) then
|
if ( dscale*dscale*Dmax*D(p) > tau*tau ) then
|
||||||
np = np+1
|
np = np+1
|
||||||
Lset(np) = p
|
Lset(np) = p
|
||||||
Lset_rev(p) = np
|
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
do k=1,ndim
|
|
||||||
call omp_destroy_lock(lock(k))
|
|
||||||
enddo
|
|
||||||
|
|
||||||
allocate(cholesky_ao(ao_num,ao_num,rank), stat=ierr)
|
allocate(cholesky_ao(ao_num,ao_num,rank), stat=ierr)
|
||||||
if (ierr /= 0) then
|
if (ierr /= 0) then
|
||||||
call print_memory_usage()
|
call print_memory_usage()
|
||||||
|
@ -18,6 +18,13 @@ subroutine run_ccsd_space_orb
|
|||||||
integer(bit_kind) :: det(N_int,2)
|
integer(bit_kind) :: det(N_int,2)
|
||||||
integer :: nO, nV, nOa, nVa
|
integer :: nO, nV, nOa, nVa
|
||||||
|
|
||||||
|
if (do_ao_cholesky) then
|
||||||
|
PROVIDE cholesky_mo_transp
|
||||||
|
FREE cholesky_ao
|
||||||
|
else
|
||||||
|
PROVIDE mo_two_e_integrals_in_map
|
||||||
|
endif
|
||||||
|
|
||||||
det = psi_det(:,:,cc_ref)
|
det = psi_det(:,:,cc_ref)
|
||||||
print*,'Reference determinant:'
|
print*,'Reference determinant:'
|
||||||
call print_det(det,N_int)
|
call print_det(det,N_int)
|
||||||
|
Loading…
Reference in New Issue
Block a user