9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-10-30 10:18:07 +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
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
stop 'Unable to delete tasks'
stop 'PT2: Unable to delete tasks (send)'
endif
do i=1,n_tasks
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))
end do
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
end if
end do

View File

@ -31,7 +31,7 @@ subroutine run_pt2_slave(thread,iproc,energy)
double precision, intent(in) :: energy(N_states_diag)
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)
else
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)
buffer_ready = .True.
else
ASSERT (N == b%N)
ASSERT (b%N == bsize)
endif
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)
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
stop 'Unable to delete task'
stop 'davidson: Unable to delete task (send)'
endif
do j=1,N_st
do i=imin,imax
@ -368,7 +368,7 @@ subroutine davidson_collector(zmq_to_qp_run_socket, zmq_socket_pull, v0, s0, sze
enddo
enddo
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
end do
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
character*(512) :: message
character*(64) :: reply
zmq_delete_task_async_recv = 0
if (.not.sending) return
sending = .False.
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
more = 0
else
print *, reply(1:rc)
zmq_delete_task_async_recv = -1
return
endif