10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-23 04:43:45 +01:00

Cleaning allocation of string

This commit is contained in:
Anthony Scemama 2019-07-09 17:18:05 +02:00
parent a6c95879de
commit 1120d572fa
2 changed files with 7 additions and 7 deletions

View File

@ -15,5 +15,7 @@ subroutine usleep(us)
use iso_c_binding
implicit none
integer, intent(in) :: us
call usleep_c(int(us,c_int))
integer(c_int) :: u
u = us
call usleep_c(u)
end

View File

@ -300,7 +300,6 @@ function new_zmq_push_socket(thread)
END_DOC
integer, intent(in) :: thread
integer :: rc
character*(8), external :: zmq_port
integer(ZMQ_PTR) :: new_zmq_push_socket
call omp_set_lock(zmq_lock)
@ -424,7 +423,6 @@ subroutine end_zmq_pair_socket(zmq_socket_pair)
END_DOC
integer(ZMQ_PTR), intent(in) :: zmq_socket_pair
integer :: rc
character*(8), external :: zmq_port
call omp_set_lock(zmq_lock)
rc = f77_zmq_close(zmq_socket_pair)
@ -444,7 +442,6 @@ subroutine end_zmq_pull_socket(zmq_socket_pull)
END_DOC
integer(ZMQ_PTR), intent(in) :: zmq_socket_pull
integer :: rc
character*(8), external :: zmq_port
! rc = f77_zmq_setsockopt(zmq_socket_pull,ZMQ_LINGER,0,4)
! if (rc /= 0) then
@ -471,7 +468,6 @@ subroutine end_zmq_push_socket(zmq_socket_push,thread)
integer, intent(in) :: thread
integer(ZMQ_PTR), intent(in) :: zmq_socket_push
integer :: rc
character*(8), external :: zmq_port
rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,300000,4)
if (rc /= 0) then
@ -751,10 +747,12 @@ integer function add_task_to_taskserver(zmq_to_qp_run_socket,task)
character*(*), intent(in) :: task
integer :: rc, sze
character(len=:), allocatable :: message
character(len=:), allocatable :: message
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)
sze = len(message)
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
return
endif
deallocate(message)
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
END_DOC
integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket
character*(8), external :: zmq_port
integer :: rc
rc = f77_zmq_setsockopt(zmq_to_qp_run_socket,ZMQ_LINGER,300000,4)