10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-24 13:23:41 +01:00

Pack tasks

This commit is contained in:
Anthony Scemama 2018-10-02 22:48:45 +02:00
parent b6bcff1ba2
commit d2e3ed360c
2 changed files with 8 additions and 11 deletions

View File

@ -17,11 +17,7 @@ END_PROVIDER
e = elec_num - n_core_orb * 2
pt2_n_tasks_max = 1+min((e*(e-1))/2, int(dsqrt(dble(N_det_selectors)))/10)
do i=1,N_det_generators
if (maxval(dabs(psi_coef_sorted_gen(i,1:N_states))) > 0.01d0) then
pt2_F(i) = pt2_n_tasks_max
else
pt2_F(i) = 1
endif
pt2_F(i) = 1 + dble(pt2_n_tasks_max)*maxval(dsqrt(dabs(psi_coef_sorted_gen(i,1:N_states))))
enddo
if(N_det_generators < 1024) then

View File

@ -46,8 +46,8 @@ subroutine run_pt2_slave(thread,iproc,energy)
n_tasks = 1
do while (.not.done)
! n_tasks = max(1,n_tasks)
! n_tasks = min(pt2_n_tasks_max,n_tasks)
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
@ -62,7 +62,7 @@ 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
@ -72,7 +72,8 @@ subroutine run_pt2_slave(thread,iproc,energy)
!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)
!print *, i_generator(1), time1-time0, n_tasks
integer, external :: tasks_done_to_taskserver
if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then
@ -80,8 +81,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 nproc seconds per job
! n_tasks = min(2*n_tasks,int( dble(n_tasks * nproc) / (time1 - time0 + 1.d0)))
! Try to adjust n_tasks around nproc/8 seconds per job
n_tasks = min(2*n_tasks,int( dble(n_tasks * nproc/8) / (time1 - time0 + 1.d0)))
end do
integer, external :: disconnect_from_taskserver