mirror of
https://gitlab.com/scemama/qmcchem.git
synced 2024-11-07 22:53:39 +01:00
Sort weights in SRMC
This commit is contained in:
parent
4c42654401
commit
e6f280d080
@ -18,6 +18,7 @@ let initialization_timeout = 600.
|
|||||||
let bind_socket ~socket_type ~socket ~address =
|
let bind_socket ~socket_type ~socket ~address =
|
||||||
try
|
try
|
||||||
ZMQ.Socket.bind socket address
|
ZMQ.Socket.bind socket address
|
||||||
|
|
||||||
with
|
with
|
||||||
| Unix.Unix_error (_, message, f) ->
|
| Unix.Unix_error (_, message, f) ->
|
||||||
failwith @@ Printf.sprintf
|
failwith @@ Printf.sprintf
|
||||||
@ -42,7 +43,6 @@ let run ?(daemon=true) ezfio_filename =
|
|||||||
end ;
|
end ;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
||||||
(** Measures the time difference between [t0] and [Time.now ()] *)
|
(** Measures the time difference between [t0] and [Time.now ()] *)
|
||||||
let delta_t t0 =
|
let delta_t t0 =
|
||||||
let t1 =
|
let t1 =
|
||||||
@ -98,7 +98,6 @@ let run ?(daemon=true) ezfio_filename =
|
|||||||
let result =
|
let result =
|
||||||
try
|
try
|
||||||
ZMQ.Socket.bind socket address;
|
ZMQ.Socket.bind socket address;
|
||||||
ZMQ.Socket.unbind socket address;
|
|
||||||
accu;
|
accu;
|
||||||
with
|
with
|
||||||
| _ -> false;
|
| _ -> false;
|
||||||
|
@ -11,7 +11,6 @@ subroutine reconfigure(ipos,w)
|
|||||||
|
|
||||||
tmp = 0.d0
|
tmp = 0.d0
|
||||||
do k=1,walk_num
|
do k=1,walk_num
|
||||||
ipos(k) = k
|
|
||||||
tmp = tmp + w(k)
|
tmp = tmp + w(k)
|
||||||
enddo
|
enddo
|
||||||
dwalk_num = dble(walk_num)/tmp
|
dwalk_num = dble(walk_num)/tmp
|
||||||
|
@ -286,6 +286,10 @@ END_SHELL
|
|||||||
! Reconfiguration
|
! Reconfiguration
|
||||||
integer :: ipos(walk_num)
|
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)
|
call reconfigure(ipos,srmc_weight)
|
||||||
|
|
||||||
do k=1,walk_num
|
do k=1,walk_num
|
||||||
|
@ -67,13 +67,14 @@ BEGIN_PROVIDER [ integer(ZMQ_PTR), zmq_to_dataserver_socket ]
|
|||||||
if (rc /= 0) then
|
if (rc /= 0) then
|
||||||
call abrt(irp_here, 'Unable to connect zmq_to_dataserver_socket')
|
call abrt(irp_here, 'Unable to connect zmq_to_dataserver_socket')
|
||||||
endif
|
endif
|
||||||
integer :: i
|
integer :: i,j
|
||||||
i=4
|
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
|
if (rc /= 0) then
|
||||||
call abrt(irp_here, 'Unable to set send timout in zmq_to_dataserver_socket')
|
call abrt(irp_here, 'Unable to set send timout in zmq_to_dataserver_socket')
|
||||||
endif
|
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
|
if (rc /= 0) then
|
||||||
call abrt(irp_here, 'Unable to set recv timout in zmq_to_dataserver_socket')
|
call abrt(irp_here, 'Unable to set recv timout in zmq_to_dataserver_socket')
|
||||||
endif
|
endif
|
||||||
@ -103,12 +104,13 @@ BEGIN_PROVIDER [ integer(ZMQ_PTR), zmq_socket_push ]
|
|||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Socket on which to push the results
|
! Socket on which to push the results
|
||||||
END_DOC
|
END_DOC
|
||||||
integer :: rc
|
integer :: rc,j
|
||||||
character*(64) :: address
|
character*(64) :: address
|
||||||
character*(8), external :: zmq_port
|
character*(8), external :: zmq_port
|
||||||
zmq_socket_push = f77_zmq_socket(zmq_context, ZMQ_PUSH)
|
zmq_socket_push = f77_zmq_socket(zmq_context, ZMQ_PUSH)
|
||||||
address = trim(dataserver_address)//':'//zmq_port(2)
|
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))
|
rc = f77_zmq_connect(zmq_socket_push, trim(address))
|
||||||
if (rc /= 0) then
|
if (rc /= 0) then
|
||||||
call abrt(irp_here, 'Unable to connect zmq_socket_push')
|
call abrt(irp_here, 'Unable to connect zmq_socket_push')
|
||||||
|
Loading…
Reference in New Issue
Block a user