mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-11-03 20:53:54 +01:00
Cleaning allocation of string
This commit is contained in:
parent
a6c95879de
commit
1120d572fa
@ -15,5 +15,7 @@ subroutine usleep(us)
|
|||||||
use iso_c_binding
|
use iso_c_binding
|
||||||
implicit none
|
implicit none
|
||||||
integer, intent(in) :: us
|
integer, intent(in) :: us
|
||||||
call usleep_c(int(us,c_int))
|
integer(c_int) :: u
|
||||||
|
u = us
|
||||||
|
call usleep_c(u)
|
||||||
end
|
end
|
||||||
|
@ -300,7 +300,6 @@ function new_zmq_push_socket(thread)
|
|||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: thread
|
integer, intent(in) :: thread
|
||||||
integer :: rc
|
integer :: rc
|
||||||
character*(8), external :: zmq_port
|
|
||||||
integer(ZMQ_PTR) :: new_zmq_push_socket
|
integer(ZMQ_PTR) :: new_zmq_push_socket
|
||||||
|
|
||||||
call omp_set_lock(zmq_lock)
|
call omp_set_lock(zmq_lock)
|
||||||
@ -424,7 +423,6 @@ subroutine end_zmq_pair_socket(zmq_socket_pair)
|
|||||||
END_DOC
|
END_DOC
|
||||||
integer(ZMQ_PTR), intent(in) :: zmq_socket_pair
|
integer(ZMQ_PTR), intent(in) :: zmq_socket_pair
|
||||||
integer :: rc
|
integer :: rc
|
||||||
character*(8), external :: zmq_port
|
|
||||||
|
|
||||||
call omp_set_lock(zmq_lock)
|
call omp_set_lock(zmq_lock)
|
||||||
rc = f77_zmq_close(zmq_socket_pair)
|
rc = f77_zmq_close(zmq_socket_pair)
|
||||||
@ -444,7 +442,6 @@ subroutine end_zmq_pull_socket(zmq_socket_pull)
|
|||||||
END_DOC
|
END_DOC
|
||||||
integer(ZMQ_PTR), intent(in) :: zmq_socket_pull
|
integer(ZMQ_PTR), intent(in) :: zmq_socket_pull
|
||||||
integer :: rc
|
integer :: rc
|
||||||
character*(8), external :: zmq_port
|
|
||||||
|
|
||||||
! rc = f77_zmq_setsockopt(zmq_socket_pull,ZMQ_LINGER,0,4)
|
! rc = f77_zmq_setsockopt(zmq_socket_pull,ZMQ_LINGER,0,4)
|
||||||
! if (rc /= 0) then
|
! if (rc /= 0) then
|
||||||
@ -471,7 +468,6 @@ subroutine end_zmq_push_socket(zmq_socket_push,thread)
|
|||||||
integer, intent(in) :: thread
|
integer, intent(in) :: thread
|
||||||
integer(ZMQ_PTR), intent(in) :: zmq_socket_push
|
integer(ZMQ_PTR), intent(in) :: zmq_socket_push
|
||||||
integer :: rc
|
integer :: rc
|
||||||
character*(8), external :: zmq_port
|
|
||||||
|
|
||||||
rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,300000,4)
|
rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,300000,4)
|
||||||
if (rc /= 0) then
|
if (rc /= 0) then
|
||||||
@ -751,10 +747,12 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task)
|
|||||||
character*(*), intent(in) :: task
|
character*(*), intent(in) :: task
|
||||||
|
|
||||||
integer :: rc, sze
|
integer :: rc, sze
|
||||||
character(len=:), allocatable :: message
|
character(len=:), allocatable :: message
|
||||||
|
|
||||||
add_task_to_taskserver = 0
|
add_task_to_taskserver = 0
|
||||||
|
|
||||||
|
sze = len(trim(task)) + len(trim(zmq_state))+11
|
||||||
|
allocate(character(len=sze) :: message)
|
||||||
message='add_task '//trim(zmq_state)//' '//trim(task)
|
message='add_task '//trim(zmq_state)//' '//trim(task)
|
||||||
sze = len(message)
|
sze = len(message)
|
||||||
rc = f77_zmq_send(zmq_to_qp_run_socket, message, sze, 0)
|
rc = f77_zmq_send(zmq_to_qp_run_socket, message, sze, 0)
|
||||||
@ -770,6 +768,7 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task)
|
|||||||
add_task_to_taskserver = -1
|
add_task_to_taskserver = -1
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
deallocate(message)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1031,7 +1030,6 @@ subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket)
|
|||||||
! Terminate the socket from the application to qp_run
|
! Terminate the socket from the application to qp_run
|
||||||
END_DOC
|
END_DOC
|
||||||
integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket
|
integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket
|
||||||
character*(8), external :: zmq_port
|
|
||||||
integer :: rc
|
integer :: rc
|
||||||
|
|
||||||
rc = f77_zmq_setsockopt(zmq_to_qp_run_socket,ZMQ_LINGER,300000,4)
|
rc = f77_zmq_setsockopt(zmq_to_qp_run_socket,ZMQ_LINGER,300000,4)
|
||||||
|
Loading…
Reference in New Issue
Block a user