From e0812d4b41d13fab430fc857c4dc9874e4dbf5fa Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 4 May 2017 15:51:33 +0200 Subject: [PATCH 1/2] Removed IPC --- ocaml/TaskServer.ml | 13 ++----------- plugins/Full_CI_ZMQ/fci_zmq.irp.f | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/ocaml/TaskServer.ml b/ocaml/TaskServer.ml index 887c7482..62de9fbd 100644 --- a/ocaml/TaskServer.ml +++ b/ocaml/TaskServer.ml @@ -70,16 +70,7 @@ let bind_socket ~socket_type ~socket ~port = with | Unix.Unix_error _ -> (Time.pause @@ Time.Span.of_float 1. ; loop (i-1) ) | other_exception -> raise other_exception - in loop 60; - let filename = - Printf.sprintf "/tmp/qp_run:%d" port - in - begin - match Sys.file_exists filename with - | `Yes -> Sys.remove filename - | _ -> () - end; - ZMQ.Socket.bind socket ("ipc://"^filename) + in loop 60 let hostname = lazy ( @@ -133,7 +124,7 @@ let stop ~port = let req_socket = ZMQ.Socket.create zmq_context ZMQ.Socket.req and address = - Printf.sprintf "ipc:///tmp/qp_run:%d" port + Printf.sprintf "tcp://localhost:%d" port in ZMQ.Socket.set_linger_period req_socket 1_000_000; ZMQ.Socket.connect req_socket address; diff --git a/plugins/Full_CI_ZMQ/fci_zmq.irp.f b/plugins/Full_CI_ZMQ/fci_zmq.irp.f index 3d9acf8b..0d883cae 100644 --- a/plugins/Full_CI_ZMQ/fci_zmq.irp.f +++ b/plugins/Full_CI_ZMQ/fci_zmq.irp.f @@ -147,7 +147,7 @@ program fci_zmq print *, 'E+PT2 = ', E_CI_before(k)+pt2(k) print *, '-----' enddo - call ezfio_set_full_ci_zmq_energy(CI_energy(1)) + call ezfio_set_full_ci_zmq_energy(E_CI_before(1)) call ezfio_set_full_ci_zmq_energy_pt2(E_CI_before(1)+pt2(1)) endif From 73ce5610b307cb05cf3103ef7f9353f4b8d52b06 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 5 May 2017 00:19:33 +0200 Subject: [PATCH 2/2] heap sort --- plugins/Full_CI_ZMQ/selection_buffer.irp.f | 2 +- src/Utils/sort.irp.f | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/Full_CI_ZMQ/selection_buffer.irp.f b/plugins/Full_CI_ZMQ/selection_buffer.irp.f index 8a067357..902e2af7 100644 --- a/plugins/Full_CI_ZMQ/selection_buffer.irp.f +++ b/plugins/Full_CI_ZMQ/selection_buffer.irp.f @@ -51,7 +51,7 @@ subroutine sort_selection_buffer(b) allocate(iorder(b%cur), detmp(N_int, 2, size(b%det,3)), absval(b%cur), vals(size(b%val))) - absval = -dabs(b%val(:b%cur)) + absval = b%val(:b%cur) do i=1,b%cur iorder(i) = i end do diff --git a/src/Utils/sort.irp.f b/src/Utils/sort.irp.f index ee1e4cca..1ebf3b17 100644 --- a/src/Utils/sort.irp.f +++ b/src/Utils/sort.irp.f @@ -202,11 +202,11 @@ BEGIN_TEMPLATE if (isize < 2) then return endif - call sorted_$Xnumber(x,isize,n) - if (isize == n) then - return - endif - if ( isize < 32+n) then +! call sorted_$Xnumber(x,isize,n) +! if (isize == n) then +! return +! endif + if ( isize < 16) then call insertion_$Xsort(x,iorder,isize) else call heap_$Xsort(x,iorder,isize)