mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-25 13:53:49 +01:00
Adjust ntasks with time
This commit is contained in:
parent
c8ee603667
commit
535a3402d8
@ -46,13 +46,14 @@ subroutine run_pt2_slave(thread,iproc,energy)
|
|||||||
zmq_socket_push = new_zmq_push_socket(thread)
|
zmq_socket_push = new_zmq_push_socket(thread)
|
||||||
|
|
||||||
buf%N = 0
|
buf%N = 0
|
||||||
n_tasks = 0
|
n_tasks = 1
|
||||||
call create_selection_buffer(0, 0, buf)
|
call create_selection_buffer(0, 0, buf)
|
||||||
|
|
||||||
done = .False.
|
done = .False.
|
||||||
do while (.not.done)
|
do while (.not.done)
|
||||||
|
|
||||||
n_tasks = min(n_tasks+1,n_tasks_max)
|
n_tasks = max(1,n_tasks)
|
||||||
|
n_tasks = min(n_tasks,n_tasks_max)
|
||||||
|
|
||||||
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
|
||||||
@ -66,16 +67,23 @@ subroutine run_pt2_slave(thread,iproc,energy)
|
|||||||
read (task(k),*) subset(k), i_generator(k)
|
read (task(k),*) subset(k), i_generator(k)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
double precision :: time0, time1
|
||||||
|
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
|
||||||
call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k))
|
call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k))
|
||||||
enddo
|
enddo
|
||||||
|
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
|
||||||
done = .true.
|
done = .true.
|
||||||
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 10 seconds per job
|
||||||
|
n_tasks = int(10.d0 * dble(n_tasks) / (time1 - time0 + 1.d-9))+1
|
||||||
end do
|
end do
|
||||||
|
|
||||||
integer, external :: disconnect_from_taskserver
|
integer, external :: disconnect_from_taskserver
|
||||||
|
@ -50,12 +50,13 @@ subroutine run_selection_slave_new(thread,iproc,energy)
|
|||||||
zmq_socket_push = new_zmq_push_socket(thread)
|
zmq_socket_push = new_zmq_push_socket(thread)
|
||||||
|
|
||||||
buf%N = 0
|
buf%N = 0
|
||||||
n_tasks = 0
|
n_tasks = 1
|
||||||
call create_selection_buffer(0, 0, buf)
|
call create_selection_buffer(0, 0, buf)
|
||||||
done = .False.
|
done = .False.
|
||||||
do while (.not.done)
|
do while (.not.done)
|
||||||
|
|
||||||
n_tasks = min(n_tasks+1,n_tasks_max)
|
n_tasks = max(1,n_tasks)
|
||||||
|
n_tasks = min(n_tasks,n_tasks_max)
|
||||||
|
|
||||||
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
|
||||||
@ -76,11 +77,15 @@ subroutine run_selection_slave_new(thread,iproc,energy)
|
|||||||
buffer_ready = .True.
|
buffer_ready = .True.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
double precision :: time0, time1
|
||||||
|
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
|
||||||
call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k))
|
call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k))
|
||||||
enddo
|
enddo
|
||||||
|
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
|
||||||
done = .true.
|
done = .true.
|
||||||
@ -91,6 +96,9 @@ subroutine run_selection_slave_new(thread,iproc,energy)
|
|||||||
buf%mini = buf2%mini
|
buf%mini = buf2%mini
|
||||||
pt2(:,:) = 0d0
|
pt2(:,:) = 0d0
|
||||||
buf%cur = 0
|
buf%cur = 0
|
||||||
|
|
||||||
|
! Try to adjust n_tasks around 10 seconds per job
|
||||||
|
n_tasks = int(10.d0 * dble(n_tasks) / (time1 - time0 + 1.d-9))+1
|
||||||
end do
|
end do
|
||||||
|
|
||||||
integer, external :: disconnect_from_taskserver
|
integer, external :: disconnect_from_taskserver
|
||||||
|
@ -72,7 +72,7 @@ subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_d
|
|||||||
call davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state,converged)
|
call davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state,converged)
|
||||||
N_st_diag_local = N_st_diag
|
N_st_diag_local = N_st_diag
|
||||||
do while (.not.converged)
|
do while (.not.converged)
|
||||||
N_st_diag_local += N_states
|
N_st_diag_local = 2 * N_st_diag_local
|
||||||
allocate (energies_local(N_st_diag_local), s2_out_local(N_st_diag_local), u_in_local(sze,N_st_diag_local))
|
allocate (energies_local(N_st_diag_local), s2_out_local(N_st_diag_local), u_in_local(sze,N_st_diag_local))
|
||||||
u_in_local(1:sze,1:N_st_diag) = u_in(1:sze,1:N_st_diag)
|
u_in_local(1:sze,1:N_st_diag) = u_in(1:sze,1:N_st_diag)
|
||||||
call davidson_diag_hjj_sjj(dets_in,u_in_local,H_jj,s2_out_local,energies_local,dim_in,sze,N_st,N_st_diag_local,Nint,dressing_state,converged)
|
call davidson_diag_hjj_sjj(dets_in,u_in_local,H_jj,s2_out_local,energies_local,dim_in,sze,N_st,N_st_diag_local,Nint,dressing_state,converged)
|
||||||
@ -237,7 +237,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_
|
|||||||
|
|
||||||
do while (.not.converged)
|
do while (.not.converged)
|
||||||
itertot = itertot+1
|
itertot = itertot+1
|
||||||
if (itertot == 5) then
|
if (itertot == 8) then
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user