10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-06-01 02:45:18 +02:00

Sort weights in SRMC

This commit is contained in:
Anthony Scemama 2016-12-22 02:03:11 +01:00
parent 4c42654401
commit e6f280d080
4 changed files with 12 additions and 8 deletions

View File

@ -18,6 +18,7 @@ let initialization_timeout = 600.
let bind_socket ~socket_type ~socket ~address =
try
ZMQ.Socket.bind socket address
with
| Unix.Unix_error (_, message, f) ->
failwith @@ Printf.sprintf
@ -42,7 +43,6 @@ let run ?(daemon=true) ezfio_filename =
end ;
in
(** Measures the time difference between [t0] and [Time.now ()] *)
let delta_t t0 =
let t1 =
@ -98,7 +98,6 @@ let run ?(daemon=true) ezfio_filename =
let result =
try
ZMQ.Socket.bind socket address;
ZMQ.Socket.unbind socket address;
accu;
with
| _ -> false;

View File

@ -11,7 +11,6 @@ subroutine reconfigure(ipos,w)
tmp = 0.d0
do k=1,walk_num
ipos(k) = k
tmp = tmp + w(k)
enddo
dwalk_num = dble(walk_num)/tmp

View File

@ -286,6 +286,10 @@ END_SHELL
! Reconfiguration
integer :: ipos(walk_num)
do k=1,walk_num
ipos(k) = k
enddo
call dsort(srmc_weight,ipos,walk_num)
call reconfigure(ipos,srmc_weight)
do k=1,walk_num

View File

@ -67,13 +67,14 @@ BEGIN_PROVIDER [ integer(ZMQ_PTR), zmq_to_dataserver_socket ]
if (rc /= 0) then
call abrt(irp_here, 'Unable to connect zmq_to_dataserver_socket')
endif
integer :: i
integer :: i,j
i=4
rc = f77_zmq_setsockopt(zmq_to_dataserver_socket, ZMQ_SNDTIMEO, 600000, i)
j=600000
rc = f77_zmq_setsockopt(zmq_to_dataserver_socket, ZMQ_SNDTIMEO, j, i)
if (rc /= 0) then
call abrt(irp_here, 'Unable to set send timout in zmq_to_dataserver_socket')
endif
rc = f77_zmq_setsockopt(zmq_to_dataserver_socket, ZMQ_RCVTIMEO, 600000, i)
rc = f77_zmq_setsockopt(zmq_to_dataserver_socket, ZMQ_RCVTIMEO, j, i)
if (rc /= 0) then
call abrt(irp_here, 'Unable to set recv timout in zmq_to_dataserver_socket')
endif
@ -103,12 +104,13 @@ BEGIN_PROVIDER [ integer(ZMQ_PTR), zmq_socket_push ]
BEGIN_DOC
! Socket on which to push the results
END_DOC
integer :: rc
integer :: rc,j
character*(64) :: address
character*(8), external :: zmq_port
zmq_socket_push = f77_zmq_socket(zmq_context, ZMQ_PUSH)
address = trim(dataserver_address)//':'//zmq_port(2)
rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,600000,4)
j=600000
rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,j,4)
rc = f77_zmq_connect(zmq_socket_push, trim(address))
if (rc /= 0) then
call abrt(irp_here, 'Unable to connect zmq_socket_push')