mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-25 05:43:47 +01:00
Pack tasks
This commit is contained in:
parent
b6bcff1ba2
commit
d2e3ed360c
@ -17,11 +17,7 @@ END_PROVIDER
|
|||||||
e = elec_num - n_core_orb * 2
|
e = elec_num - n_core_orb * 2
|
||||||
pt2_n_tasks_max = 1+min((e*(e-1))/2, int(dsqrt(dble(N_det_selectors)))/10)
|
pt2_n_tasks_max = 1+min((e*(e-1))/2, int(dsqrt(dble(N_det_selectors)))/10)
|
||||||
do i=1,N_det_generators
|
do i=1,N_det_generators
|
||||||
if (maxval(dabs(psi_coef_sorted_gen(i,1:N_states))) > 0.01d0) then
|
pt2_F(i) = 1 + dble(pt2_n_tasks_max)*maxval(dsqrt(dabs(psi_coef_sorted_gen(i,1:N_states))))
|
||||||
pt2_F(i) = pt2_n_tasks_max
|
|
||||||
else
|
|
||||||
pt2_F(i) = 1
|
|
||||||
endif
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
if(N_det_generators < 1024) then
|
if(N_det_generators < 1024) then
|
||||||
|
@ -46,8 +46,8 @@ subroutine run_pt2_slave(thread,iproc,energy)
|
|||||||
n_tasks = 1
|
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(pt2_n_tasks_max,n_tasks)
|
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
|
||||||
@ -62,7 +62,7 @@ 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
|
||||||
@ -72,7 +72,8 @@ subroutine run_pt2_slave(thread,iproc,energy)
|
|||||||
!call wall_time(time1)
|
!call wall_time(time1)
|
||||||
!print *, i_generator(1), time1-time2, n_tasks, pt2_F(i_generator(1))
|
!print *, i_generator(1), time1-time2, n_tasks, pt2_F(i_generator(1))
|
||||||
enddo
|
enddo
|
||||||
! call wall_time(time1)
|
call wall_time(time1)
|
||||||
|
!print *, i_generator(1), time1-time0, n_tasks
|
||||||
|
|
||||||
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
|
||||||
@ -80,8 +81,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 nproc seconds per job
|
! Try to adjust n_tasks around nproc/8 seconds per job
|
||||||
! n_tasks = min(2*n_tasks,int( dble(n_tasks * nproc) / (time1 - time0 + 1.d0)))
|
n_tasks = min(2*n_tasks,int( dble(n_tasks * nproc/8) / (time1 - time0 + 1.d0)))
|
||||||
end do
|
end do
|
||||||
|
|
||||||
integer, external :: disconnect_from_taskserver
|
integer, external :: disconnect_from_taskserver
|
||||||
|
Loading…
Reference in New Issue
Block a user