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

Added error messages in davidson slave

This commit is contained in:
Anthony Scemama 2019-01-25 17:02:44 +01:00
parent fe86a9b9ed
commit 0992b52dcf
2 changed files with 29 additions and 25 deletions

0
external/Python/.gitignore vendored Normal file
View File

View File

@ -37,13 +37,16 @@ subroutine davidson_run_slave(thread,iproc)
integer, external :: connect_to_taskserver integer, external :: connect_to_taskserver
integer, external :: zmq_get_N_states_diag integer, external :: zmq_get_N_states_diag
PROVIDE mpi_rank
zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() zmq_to_qp_run_socket = new_zmq_to_qp_run_socket()
zmq_socket_push = new_zmq_push_socket(thread)
integer :: ierr, doexit integer :: ierr, doexit
do
doexit = 0 doexit = 0
if (connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) == -1) then if (connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) == -1) then
call sleep(1) call sleep( int(1.5+float(mpi_rank)/10.) )
if (connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) == -1) then if (connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) == -1) then
doexit=1 doexit=1
endif endif
@ -62,18 +65,18 @@ subroutine davidson_run_slave(thread,iproc)
doexit = recvbuf doexit = recvbuf
IRP_ENDIF IRP_ENDIF
if (doexit > 0) then if (doexit == 0) then
call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) exit
return else
print *, irp_here, ': retrying connection (', doexit, ')'
endif endif
enddo
zmq_socket_push = new_zmq_push_socket(thread)
do do
if (zmq_get_N_states_diag(zmq_to_qp_run_socket, 1) /= -1) then if (zmq_get_N_states_diag(zmq_to_qp_run_socket, 1) /= -1) then
exit exit
endif endif
print *, 'Waiting for N_states_diag in ', irp_here print *, irp_here, ': Waiting for N_states_diag'
call sleep(1) call sleep(1)
enddo enddo
call davidson_slave_work(zmq_to_qp_run_socket, zmq_socket_push, N_states_diag, N_det, worker_id) call davidson_slave_work(zmq_to_qp_run_socket, zmq_socket_push, N_states_diag, N_det, worker_id)
@ -82,6 +85,7 @@ subroutine davidson_run_slave(thread,iproc)
if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) == -1) then if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) == -1) then
call sleep(1) call sleep(1)
if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) == -1) then if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) == -1) then
print *, irp_here, ': disconnect failed'
continue continue
endif endif
endif endif