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:
parent
76f2953a02
commit
ff2dcf069e
@ -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_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 zmq_set_running(zmq_to_qp_run_socket)
|
||||||
call create_selection_buffer(N, N*2, b)
|
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)
|
call add_task_to_taskserver(zmq_to_qp_run_socket,task)
|
||||||
end do
|
end do
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ subroutine selection_slaved(thread,iproc,energy)
|
|||||||
if (done) then
|
if (done) then
|
||||||
ctask = ctask - 1
|
ctask = ctask - 1
|
||||||
else
|
else
|
||||||
integer :: i_generator, N
|
integer :: i_generator, i_generator_start, i_generator_max, step, N
|
||||||
read (task,*) i_generator, N
|
read (task,*) i_generator_start, i_generator_max, step, N
|
||||||
if(buf%N == 0) then
|
if(buf%N == 0) then
|
||||||
! Only first time
|
! Only first time
|
||||||
call create_selection_buffer(N, N*2, buf)
|
call create_selection_buffer(N, N*2, buf)
|
||||||
@ -64,7 +64,9 @@ subroutine selection_slaved(thread,iproc,energy)
|
|||||||
end if
|
end if
|
||||||
!print *, "psi_selectors_coef ", psi_selectors_coef(N_det_selectors-5:N_det_selectors, 1)
|
!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)
|
!call debug_det(psi_selectors(1,1,N_det_selectors), N_int)
|
||||||
call select_connected(i_generator,energy,pt2,buf)
|
do i_generator=i_generator_start,i_generator_max,step
|
||||||
|
call select_connected(i_generator,energy,pt2,buf)
|
||||||
|
enddo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if(done .or. ctask == size(task_id)) then
|
if(done .or. ctask == size(task_id)) then
|
||||||
|
@ -25,9 +25,7 @@ subroutine run_wf
|
|||||||
integer(ZMQ_PTR) :: zmq_to_qp_run_socket
|
integer(ZMQ_PTR) :: zmq_to_qp_run_socket
|
||||||
double precision :: energy(N_states_diag)
|
double precision :: energy(N_states_diag)
|
||||||
character*(64) :: state
|
character*(64) :: state
|
||||||
integer :: oki
|
|
||||||
|
|
||||||
oki = 0
|
|
||||||
call provide_everything
|
call provide_everything
|
||||||
|
|
||||||
zmq_context = f77_zmq_ctx_new ()
|
zmq_context = f77_zmq_ctx_new ()
|
||||||
|
@ -718,10 +718,32 @@ END_PROVIDER
|
|||||||
|
|
||||||
dIj_unique(:size(X), s) = X(:)
|
dIj_unique(:size(X), s) = X(:)
|
||||||
|
|
||||||
do i=1,N_det_non_ref
|
norm = 0.d0
|
||||||
rho_mrcc(i,s) = psi_non_ref_coef(i,s) / rho_mrcc(i,s)
|
do i=1,N_det_ref
|
||||||
|
norm = norm + psi_ref_coef(i,s)*psi_ref_coef(i,s)
|
||||||
enddo
|
enddo
|
||||||
|
double precision :: f
|
||||||
|
do i=1,N_det_non_ref
|
||||||
|
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
|
end do
|
||||||
|
|
||||||
print *, "done"
|
print *, "done"
|
||||||
|
@ -23,7 +23,7 @@ use bitmasks
|
|||||||
do gen= 1, N_det_generators
|
do gen= 1, N_det_generators
|
||||||
allocate(buf(N_int, 2, N_det_non_ref))
|
allocate(buf(N_int, 2, N_det_non_ref))
|
||||||
iproc = omp_get_thread_num() + 1
|
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)
|
do h=1, hh_shortcut(0)
|
||||||
call apply_hole(psi_det_generators(1,1,gen), hh_exists(1, h), mask, ok, N_int)
|
call apply_hole(psi_det_generators(1,1,gen), hh_exists(1, h), mask, ok, N_int)
|
||||||
if(.not. ok) cycle
|
if(.not. ok) cycle
|
||||||
|
Loading…
Reference in New Issue
Block a user