mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-24 13:23:41 +01:00
Fixed Fragments
This commit is contained in:
parent
f8bda54c75
commit
2cb6b48ecb
@ -6,7 +6,6 @@ BEGIN_PROVIDER [ integer, pt2_stoch_istate ]
|
|||||||
pt2_stoch_istate = 1
|
pt2_stoch_istate = 1
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, pt2_N_teeth ]
|
BEGIN_PROVIDER [ integer, pt2_N_teeth ]
|
||||||
&BEGIN_PROVIDER [ integer, pt2_minDetInFirstTeeth ]
|
&BEGIN_PROVIDER [ integer, pt2_minDetInFirstTeeth ]
|
||||||
&BEGIN_PROVIDER [ integer, pt2_n_tasks_max ]
|
&BEGIN_PROVIDER [ integer, pt2_n_tasks_max ]
|
||||||
@ -14,11 +13,14 @@ END_PROVIDER
|
|||||||
implicit none
|
implicit none
|
||||||
logical, external :: testTeethBuilding
|
logical, external :: testTeethBuilding
|
||||||
integer :: i
|
integer :: i
|
||||||
pt2_F(:) = 1
|
integer :: e
|
||||||
pt2_n_tasks_max = N_det_generators/100 + 1
|
e = elec_num - n_core_orb * 2
|
||||||
|
pt2_n_tasks_max = min(1+(e*(e-1))/2, int(dsqrt(dble(N_det_generators))))
|
||||||
do i=1,N_det_generators
|
do i=1,N_det_generators
|
||||||
if (maxval(dabs(psi_coef_sorted_gen(i,:))) > 0.005d0) then
|
if (maxval(dabs(psi_coef_sorted_gen(i,1:N_states))) > 0.0001d0) then
|
||||||
pt2_F(i) = max(1,min( ((elec_alpha_num-n_core_orb)**2)/4, pt2_n_tasks_max))
|
pt2_F(i) = pt2_n_tasks_max
|
||||||
|
else
|
||||||
|
pt2_F(i) = 1
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
@ -43,10 +43,11 @@ subroutine run_pt2_slave(thread,iproc,energy)
|
|||||||
call create_selection_buffer(0, 0, buf)
|
call create_selection_buffer(0, 0, buf)
|
||||||
|
|
||||||
done = .False.
|
done = .False.
|
||||||
|
n_tasks = 1
|
||||||
do while (.not.done)
|
do while (.not.done)
|
||||||
|
|
||||||
n_tasks = max(1,n_tasks)
|
! n_tasks = max(1,n_tasks)
|
||||||
n_tasks = min(n_tasks,pt2_n_tasks_max)
|
! n_tasks = min(pt2_n_tasks_max,n_tasks)
|
||||||
|
|
||||||
integer, external :: get_tasks_from_taskserver
|
integer, external :: get_tasks_from_taskserver
|
||||||
if (get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id, task_id, task, n_tasks) == -1) then
|
if (get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id, task_id, task, n_tasks) == -1) then
|
||||||
@ -61,13 +62,17 @@ subroutine run_pt2_slave(thread,iproc,energy)
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
double precision :: time0, time1
|
double precision :: time0, time1
|
||||||
call wall_time(time0)
|
! call wall_time(time0)
|
||||||
do k=1,n_tasks
|
do k=1,n_tasks
|
||||||
pt2(:,k) = 0.d0
|
pt2(:,k) = 0.d0
|
||||||
buf%cur = 0
|
buf%cur = 0
|
||||||
|
!double precision :: time2
|
||||||
|
!call wall_time(time2)
|
||||||
call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k),pt2_F(i_generator(k)))
|
call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k),pt2_F(i_generator(k)))
|
||||||
|
!call wall_time(time1)
|
||||||
|
!print *, i_generator(1), time1-time2, n_tasks, pt2_F(i_generator(1))
|
||||||
enddo
|
enddo
|
||||||
call wall_time(time1)
|
! call wall_time(time1)
|
||||||
|
|
||||||
integer, external :: tasks_done_to_taskserver
|
integer, external :: tasks_done_to_taskserver
|
||||||
if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then
|
if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then
|
||||||
@ -75,9 +80,8 @@ subroutine run_pt2_slave(thread,iproc,energy)
|
|||||||
endif
|
endif
|
||||||
call push_pt2_results(zmq_socket_push, i_generator, pt2, task_id, n_tasks)
|
call push_pt2_results(zmq_socket_push, i_generator, pt2, task_id, n_tasks)
|
||||||
|
|
||||||
! Try to adjust n_tasks around 1 second per job
|
! Try to adjust n_tasks around nproc seconds per job
|
||||||
n_tasks = min(n_tasks,int( 1.d0*dble(n_tasks) / (time1 - time0 + 1.d-9)))+1
|
! n_tasks = min(2*n_tasks,int( dble(n_tasks * nproc) / (time1 - time0 + 1.d0)))
|
||||||
! n_tasks = n_tasks+1
|
|
||||||
end do
|
end do
|
||||||
|
|
||||||
integer, external :: disconnect_from_taskserver
|
integer, external :: disconnect_from_taskserver
|
||||||
|
@ -409,9 +409,11 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d
|
|||||||
allocate(banned(mo_tot_num, mo_tot_num,2), bannedOrb(mo_tot_num, 2))
|
allocate(banned(mo_tot_num, mo_tot_num,2), bannedOrb(mo_tot_num, 2))
|
||||||
allocate (mat(N_states, mo_tot_num, mo_tot_num))
|
allocate (mat(N_states, mo_tot_num, mo_tot_num))
|
||||||
maskInd = -1
|
maskInd = -1
|
||||||
integer :: nb_count
|
integer :: nb_count, maskInd_save
|
||||||
|
logical :: found
|
||||||
do s1=1,2
|
do s1=1,2
|
||||||
do i1=N_holes(s1),1,-1 ! Generate low excitations first
|
do i1=N_holes(s1),1,-1 ! Generate low excitations first
|
||||||
|
|
||||||
h1 = hole_list(i1,s1)
|
h1 = hole_list(i1,s1)
|
||||||
call apply_hole(psi_det_generators(1,1,i_generator), s1,h1, pmask, ok, N_int)
|
call apply_hole(psi_det_generators(1,1,i_generator), s1,h1, pmask, ok, N_int)
|
||||||
|
|
||||||
|
@ -51,7 +51,9 @@ subroutine run_wf
|
|||||||
PROVIDE psi_det psi_coef threshold_generators threshold_selectors state_average_weight mpi_master
|
PROVIDE psi_det psi_coef threshold_generators threshold_selectors state_average_weight mpi_master
|
||||||
PROVIDE zmq_state N_det_selectors pt2_stoch_istate N_det pt2_e0_denominator
|
PROVIDE zmq_state N_det_selectors pt2_stoch_istate N_det pt2_e0_denominator
|
||||||
PROVIDE N_det_generators N_states N_states_diag
|
PROVIDE N_det_generators N_states N_states_diag
|
||||||
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
IRP_IF MPI
|
||||||
|
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
||||||
|
IRP_ENDIF
|
||||||
do
|
do
|
||||||
|
|
||||||
if (mpi_master) then
|
if (mpi_master) then
|
||||||
|
Loading…
Reference in New Issue
Block a user