diff --git a/plugins/Full_CI_ZMQ/fci_zmq.irp.f b/plugins/Full_CI_ZMQ/fci_zmq.irp.f index e3e8c52d..2d3c1f29 100644 --- a/plugins/Full_CI_ZMQ/fci_zmq.irp.f +++ b/plugins/Full_CI_ZMQ/fci_zmq.irp.f @@ -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 diff --git a/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f b/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f index b07aa1b8..bc88c23c 100644 --- a/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f +++ b/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f @@ -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) diff --git a/plugins/Generators_full/generators.irp.f b/plugins/Generators_full/generators.irp.f index 4f2c715e..835897bd 100644 --- a/plugins/Generators_full/generators.irp.f +++ b/plugins/Generators_full/generators.irp.f @@ -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 diff --git a/src/ZMQ/utils.irp.f b/src/ZMQ/utils.irp.f index d0c73f17..a77f974a 100644 --- a/src/ZMQ/utils.irp.f +++ b/src/ZMQ/utils.irp.f @@ -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