10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 04:43:50 +01:00

Multiple generators per task

This commit is contained in:
Anthony Scemama 2016-08-03 00:18:53 +02:00
parent 76f2953a02
commit ff2dcf069e
5 changed files with 41 additions and 11 deletions

View File

@ -132,8 +132,16 @@ subroutine ZMQ_selection(N, pt2)
call zmq_put_psi(zmq_to_qp_run_socket,1,ci_electronic_energy,size(ci_electronic_energy))
call zmq_set_running(zmq_to_qp_run_socket)
call create_selection_buffer(N, N*2, b)
do i= N_det_generators, 1, -1
write(task,*) i, N
integer :: i_generator, i_generator_start, i_generator_max, step
! step = int(max(1.,10*elec_num/mo_tot_num)
step = int(10000000.d0 / dble(N_int * N_states * elec_num * elec_num * mo_tot_num * mo_tot_num ))
step = max(1,step)
do i= N_det_generators, 1, -step
i_generator_start = max(i-step+1,1)
i_generator_max = i
write(task,*) i_generator_start, i_generator_max, 1, N
call add_task_to_taskserver(zmq_to_qp_run_socket,task)
end do

View File

@ -53,8 +53,8 @@ subroutine selection_slaved(thread,iproc,energy)
if (done) then
ctask = ctask - 1
else
integer :: i_generator, N
read (task,*) i_generator, N
integer :: i_generator, i_generator_start, i_generator_max, step, N
read (task,*) i_generator_start, i_generator_max, step, N
if(buf%N == 0) then
! Only first time
call create_selection_buffer(N, N*2, buf)
@ -64,7 +64,9 @@ subroutine selection_slaved(thread,iproc,energy)
end if
!print *, "psi_selectors_coef ", psi_selectors_coef(N_det_selectors-5:N_det_selectors, 1)
!call debug_det(psi_selectors(1,1,N_det_selectors), N_int)
do i_generator=i_generator_start,i_generator_max,step
call select_connected(i_generator,energy,pt2,buf)
enddo
endif
if(done .or. ctask == size(task_id)) then

View File

@ -25,9 +25,7 @@ subroutine run_wf
integer(ZMQ_PTR) :: zmq_to_qp_run_socket
double precision :: energy(N_states_diag)
character*(64) :: state
integer :: oki
oki = 0
call provide_everything
zmq_context = f77_zmq_ctx_new ()

View File

@ -718,8 +718,30 @@ END_PROVIDER
dIj_unique(:size(X), s) = X(:)
norm = 0.d0
do i=1,N_det_ref
norm = norm + psi_ref_coef(i,s)*psi_ref_coef(i,s)
enddo
double precision :: f
do i=1,N_det_non_ref
rho_mrcc(i,s) = psi_non_ref_coef(i,s) / rho_mrcc(i,s)
f = psi_non_ref_coef(i,s) / rho_mrcc(i,s)
! Avoid numerical instabilities
f = min(f, 3.d0)
f = max(f,-3.d0)
! norm = norm + (psi_non_ref_coef(i,s) * f * rho_mrcc(i,s))
norm = norm + ( f * rho_mrcc(i,s))**2
rho_mrcc(i,s) = f
enddo
print *, '<Psi | (1+T) Psi_0> = ', norm
f = 1.d0/norm
norm = 0.d0
do i=1,N_det_ref
norm = norm + psi_ref_coef(i,s)*psi_ref_coef(i,s)
enddo
do i=1,N_det_non_ref
rho_mrcc(i,s) = rho_mrcc(i,s) * f
enddo
end do

View File

@ -23,7 +23,7 @@ use bitmasks
do gen= 1, N_det_generators
allocate(buf(N_int, 2, N_det_non_ref))
iproc = omp_get_thread_num() + 1
if(mod(gen, 10) == 0) print *, "mrcc ", gen, "/", N_det_generators
if(mod(gen, 1000) == 0) print *, "mrcc ", gen, "/", N_det_generators
do h=1, hh_shortcut(0)
call apply_hole(psi_det_generators(1,1,gen), hh_exists(1, h), mask, ok, N_int)
if(.not. ok) cycle