10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 21:03:56 +01:00

Fixed Fragments

This commit is contained in:
Anthony Scemama 2018-09-10 15:15:19 +02:00
parent f8bda54c75
commit ad7398f912
3 changed files with 21 additions and 13 deletions

View File

@ -6,7 +6,6 @@ BEGIN_PROVIDER [ integer, pt2_stoch_istate ]
pt2_stoch_istate = 1
END_PROVIDER
BEGIN_PROVIDER [ integer, pt2_N_teeth ]
&BEGIN_PROVIDER [ integer, pt2_minDetInFirstTeeth ]
&BEGIN_PROVIDER [ integer, pt2_n_tasks_max ]
@ -14,11 +13,14 @@ END_PROVIDER
implicit none
logical, external :: testTeethBuilding
integer :: i
pt2_F(:) = 1
pt2_n_tasks_max = N_det_generators/100 + 1
integer :: e
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
if (maxval(dabs(psi_coef_sorted_gen(i,:))) > 0.005d0) then
pt2_F(i) = max(1,min( ((elec_alpha_num-n_core_orb)**2)/4, pt2_n_tasks_max))
if (maxval(dabs(psi_coef_sorted_gen(i,1:N_states))) > 0.0001d0) then
pt2_F(i) = pt2_n_tasks_max
else
pt2_F(i) = 1
endif
enddo

View File

@ -43,10 +43,11 @@ subroutine run_pt2_slave(thread,iproc,energy)
call create_selection_buffer(0, 0, buf)
done = .False.
n_tasks = 1
do while (.not.done)
n_tasks = max(1,n_tasks)
n_tasks = min(n_tasks,pt2_n_tasks_max)
! n_tasks = max(1,n_tasks)
! n_tasks = min(pt2_n_tasks_max,n_tasks)
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
@ -61,13 +62,17 @@ subroutine run_pt2_slave(thread,iproc,energy)
enddo
double precision :: time0, time1
call wall_time(time0)
! call wall_time(time0)
do k=1,n_tasks
pt2(:,k) = 0.d0
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 wall_time(time1)
!print *, i_generator(1), time1-time2, n_tasks, pt2_F(i_generator(1))
enddo
call wall_time(time1)
! call wall_time(time1)
integer, external :: tasks_done_to_taskserver
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
call push_pt2_results(zmq_socket_push, i_generator, pt2, task_id, n_tasks)
! Try to adjust n_tasks around 1 second per job
n_tasks = min(n_tasks,int( 1.d0*dble(n_tasks) / (time1 - time0 + 1.d-9)))+1
! n_tasks = n_tasks+1
! Try to adjust n_tasks around nproc seconds per job
! n_tasks = min(2*n_tasks,int( dble(n_tasks * nproc) / (time1 - time0 + 1.d0)))
end do
integer, external :: disconnect_from_taskserver

View File

@ -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 (mat(N_states, mo_tot_num, mo_tot_num))
maskInd = -1
integer :: nb_count
integer :: nb_count, maskInd_save
logical :: found
do s1=1,2
do i1=N_holes(s1),1,-1 ! Generate low excitations first
h1 = hole_list(i1,s1)
call apply_hole(psi_det_generators(1,1,i_generator), s1,h1, pmask, ok, N_int)