10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-23 11:17:33 +02:00
This commit is contained in:
Anthony Scemama 2018-06-08 02:09:42 +02:00
parent c48623a5c9
commit ef92609192
4 changed files with 10 additions and 8 deletions

View File

@ -70,7 +70,7 @@ program fci_zmq
if (do_pt2) then
pt2 = 0.d0
threshold_selectors = 1.d0
threshold_generators = 1d0
threshold_generators = 1.d0
SOFT_TOUCH threshold_selectors threshold_generators
call ZMQ_pt2(CI_energy, pt2,relative_error,absolute_error,error) ! Stochastic PT2
threshold_selectors = threshold_selectors_save

View File

@ -87,9 +87,11 @@ subroutine run_pt2_slave(thread,iproc,energy)
end do
integer, external :: disconnect_from_taskserver
if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) == -1) then
continue
endif
do i=1,300
if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) /= -2) exit
call sleep(1)
print *, 'Retry disconnect...'
end do
call end_zmq_push_socket(zmq_socket_push,thread)
call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket)

View File

@ -13,7 +13,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ]
N_det_generators = N_det
do i=1,N_det
norm = norm + psi_average_norm_contrib_sorted(i)
if (norm >= threshold_generators) then
if (norm > threshold_generators) then
N_det_generators = i
exit
endif

View File

@ -601,7 +601,7 @@ subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in)
stop 'Wrong end of job'
endif
do i=300,1,-1
do i=3600,1,-1
rc = f77_zmq_send(zmq_to_qp_run_socket, 'end_job '//trim(zmq_state),8+len(trim(zmq_state)),0)
rc = f77_zmq_recv(zmq_to_qp_run_socket, message, 512, 0)
if (trim(message(1:13)) == 'error waiting') then
@ -612,6 +612,7 @@ subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in)
endif
end do
if (i==0) then
print *, '.. Forcing kill ..'
rc = f77_zmq_send(zmq_to_qp_run_socket, 'end_job force',13,0)
rc = f77_zmq_recv(zmq_to_qp_run_socket, message, 512, 0)
endif
@ -718,7 +719,7 @@ integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_i
rc = f77_zmq_send(zmq_to_qp_run_socket, trim(message), sze, 0)
if (rc /= sze) then
disconnect_from_taskserver_state = -1
disconnect_from_taskserver_state = -2
return
endif
@ -727,7 +728,6 @@ integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_i
read(message,*, end=10, err=10) reply, state
if ((trim(reply) == 'disconnect_reply').and.(trim(state) == trim(zmq_state))) then
disconnect_from_taskserver_state = -1
return
endif
if (trim(message) == 'error Wrong state') then