9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-21 11:03:29 +01:00

Fixed davidson ZMQ termination

This commit is contained in:
Anthony Scemama 2019-02-05 18:44:03 +01:00
parent 5a8a4fb37e
commit 9babb038dc
4 changed files with 8 additions and 6 deletions

View File

@ -519,7 +519,7 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, varianc
else else
call pull_pt2_results(zmq_socket_pull, index, eI_task, vI_task, nI_task, task_id, n_tasks, b2) call pull_pt2_results(zmq_socket_pull, index, eI_task, vI_task, nI_task, task_id, n_tasks, b2)
if (zmq_delete_tasks_async_send(zmq_to_qp_run_socket,task_id,n_tasks,sending) == -1) then if (zmq_delete_tasks_async_send(zmq_to_qp_run_socket,task_id,n_tasks,sending) == -1) then
stop 'Unable to delete tasks' stop 'PT2: Unable to delete tasks (send)'
endif endif
do i=1,n_tasks do i=1,n_tasks
eI(1:N_states, index(i)) += eI_task(1:N_states,i) eI(1:N_states, index(i)) += eI_task(1:N_states,i)
@ -533,7 +533,7 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, varianc
call add_to_selection_buffer(b, b2%det(1,1,i), b2%val(i)) call add_to_selection_buffer(b, b2%det(1,1,i), b2%val(i))
end do end do
if (zmq_delete_tasks_async_recv(zmq_to_qp_run_socket,more,sending) == -1) then if (zmq_delete_tasks_async_recv(zmq_to_qp_run_socket,more,sending) == -1) then
stop 'Unable to delete tasks' stop 'PT2: Unable to delete tasks (recv)'
endif endif
end if end if
end do end do

View File

@ -31,7 +31,7 @@ subroutine run_pt2_slave(thread,iproc,energy)
double precision, intent(in) :: energy(N_states_diag) double precision, intent(in) :: energy(N_states_diag)
integer, intent(in) :: thread, iproc integer, intent(in) :: thread, iproc
if (N_det > 1000000) then if (N_det > nproc*(elec_alpha_num * (mo_num-elec_alpha_num))**2) then
call run_pt2_slave_large(thread,iproc,energy) call run_pt2_slave_large(thread,iproc,energy)
else else
call run_pt2_slave_small(thread,iproc,energy) call run_pt2_slave_small(thread,iproc,energy)
@ -236,7 +236,7 @@ subroutine run_pt2_slave_large(thread,iproc,energy)
call create_selection_buffer(bsize, bsize*2, b) call create_selection_buffer(bsize, bsize*2, b)
buffer_ready = .True. buffer_ready = .True.
else else
ASSERT (N == b%N) ASSERT (b%N == bsize)
endif endif
double precision :: time0, time1 double precision :: time0, time1

View File

@ -359,7 +359,7 @@ subroutine davidson_collector(zmq_to_qp_run_socket, zmq_socket_pull, v0, s0, sze
do while (more == 1) do while (more == 1)
call davidson_pull_results(zmq_socket_pull, v_t, s_t, imin, imax, task_id) call davidson_pull_results(zmq_socket_pull, v_t, s_t, imin, imax, task_id)
if (zmq_delete_task_async_send(zmq_to_qp_run_socket,task_id,sending) == -1) then if (zmq_delete_task_async_send(zmq_to_qp_run_socket,task_id,sending) == -1) then
stop 'Unable to delete task' stop 'davidson: Unable to delete task (send)'
endif endif
do j=1,N_st do j=1,N_st
do i=imin,imax do i=imin,imax
@ -368,7 +368,7 @@ subroutine davidson_collector(zmq_to_qp_run_socket, zmq_socket_pull, v0, s0, sze
enddo enddo
enddo enddo
if (zmq_delete_task_async_recv(zmq_to_qp_run_socket,more,sending) == -1) then if (zmq_delete_task_async_recv(zmq_to_qp_run_socket,more,sending) == -1) then
stop 'Unable to delete task' stop 'davidson: Unable to delete task (recv)'
endif endif
end do end do
deallocate(v_t,s_t) deallocate(v_t,s_t)

View File

@ -1127,6 +1127,7 @@ integer function zmq_delete_task_async_recv(zmq_to_qp_run_socket,more,sending)
integer :: rc integer :: rc
character*(512) :: message character*(512) :: message
character*(64) :: reply character*(64) :: reply
zmq_delete_task_async_recv = 0
if (.not.sending) return if (.not.sending) return
sending = .False. sending = .False.
reply = '' reply = ''
@ -1136,6 +1137,7 @@ integer function zmq_delete_task_async_recv(zmq_to_qp_run_socket,more,sending)
else if (reply(16:19) == 'done') then else if (reply(16:19) == 'done') then
more = 0 more = 0
else else
print *, reply(1:rc)
zmq_delete_task_async_recv = -1 zmq_delete_task_async_recv = -1
return return
endif endif