9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-25 13:03:28 +01:00

Merge branch 'dev' into csf

This commit is contained in:
Anthony Scemama 2021-02-23 01:31:43 +01:00
commit b8b9174670

View File

@ -702,7 +702,7 @@ integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_i
write(message,*) 'disconnect '//trim(state), worker_id write(message,*) 'disconnect '//trim(state), worker_id
sze = len(trim(message)) sze = min(510,len(trim(message)))
rc = f77_zmq_send(zmq_to_qp_run_socket, trim(message), sze, 0) rc = f77_zmq_send(zmq_to_qp_run_socket, trim(message), sze, 0)
if (rc /= sze) then if (rc /= sze) then
@ -711,6 +711,11 @@ integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_i
endif endif
rc = f77_zmq_recv(zmq_to_qp_run_socket, message, 510, 0) rc = f77_zmq_recv(zmq_to_qp_run_socket, message, 510, 0)
if (rc <= 0) then
disconnect_from_taskserver_state = -3
return
endif
rc = min(510,rc)
message = trim(message(1:rc)) message = trim(message(1:rc))
read(message,*, end=10, err=10) reply, state_tmp read(message,*, end=10, err=10) reply, state_tmp
@ -906,13 +911,14 @@ integer function get_task_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id
return return
endif endif
task_id = 0
message = repeat(' ',1024) message = repeat(' ',1024)
rc = f77_zmq_recv(zmq_to_qp_run_socket, message, 1024, 0) rc = f77_zmq_recv(zmq_to_qp_run_socket, message, 1024, 0)
if (rc <= 0) then if (rc <= 0) then
print *, rc print *, rc
stop "rc" stop "rc"
end if end if
rc = min(1024,rc) rc = min(64,rc)
read(message(1:rc),*, end=10, err=10) reply read(message(1:rc),*, end=10, err=10) reply
if (trim(reply) == 'get_task_reply') then if (trim(reply) == 'get_task_reply') then
read(message(1:rc),*, end=10, err=10) reply, task_id read(message(1:rc),*, end=10, err=10) reply, task_id
@ -926,13 +932,10 @@ integer function get_task_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id
rc += 1 rc += 1
task = message(rc:) task = message(rc:)
else if (trim(reply) == 'terminate') then else if (trim(reply) == 'terminate') then
task_id = 0
task = 'terminate' task = 'terminate'
else if (trim(message) == 'error No job is running') then else if (trim(message) == 'error No job is running') then
task_id = 0
task = 'terminate' task = 'terminate'
else if (trim(message) == 'error Wrong state') then else if (trim(message) == 'error Wrong state') then
task_id = 0
task = 'terminate' task = 'terminate'
else else
get_task_from_taskserver = -1 get_task_from_taskserver = -1