diff --git a/ocaml/Charge.ml b/ocaml/Charge.ml index b40469d2..714a5690 100644 --- a/ocaml/Charge.ml +++ b/ocaml/Charge.ml @@ -1,6 +1,6 @@ -open Core.Std;; +open Core.Std -type t = float with sexp;; +type t = float with sexp let of_float x = x let of_int i = Float.of_int i @@ -14,5 +14,4 @@ let to_string x = Printf.sprintf "+%f" x else Printf.sprintf "%f" x -;; diff --git a/ocaml/Progress_bar.ml b/ocaml/Progress_bar.ml index 9762153a..3473ac4b 100644 --- a/ocaml/Progress_bar.ml +++ b/ocaml/Progress_bar.ml @@ -22,6 +22,11 @@ let update ~cur_value bar = let increment_end bar = { bar with end_value=(bar.end_value +. 1.) ; dirty=false } +let clear bar = + Printf.eprintf " \r%!"; + None + + let increment_cur bar = { bar with cur_value=(bar.cur_value +. 1.) ; dirty=true } diff --git a/ocaml/TaskServer.ml b/ocaml/TaskServer.ml index abc2de1d..0128c3c3 100644 --- a/ocaml/TaskServer.ml +++ b/ocaml/TaskServer.ml @@ -212,7 +212,7 @@ let end_job msg program_state rep_socket pair_socket = reply_ok rep_socket; { program_state with state = None ; - progress_bar = None ; + progress_bar = Progress_bar.clear (); } in diff --git a/plugins/Full_CI_ZMQ/fci_zmq.irp.f b/plugins/Full_CI_ZMQ/fci_zmq.irp.f index 7b7c9b04..699376a4 100644 --- a/plugins/Full_CI_ZMQ/fci_zmq.irp.f +++ b/plugins/Full_CI_ZMQ/fci_zmq.irp.f @@ -128,7 +128,7 @@ program fci_zmq double precision :: relative_error relative_error=1.d-3 pt2 = 0.d0 - if (N_states > 1) then + if (N_states == 1) then print *, 'Stochastic PT2' call ZMQ_pt2(E_CI_before(1), pt2,relative_error) ! Stochastic PT2 else diff --git a/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f b/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f index facaf346..784ca8fa 100644 --- a/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f +++ b/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f @@ -32,7 +32,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error) sum2above = 0d0 Nabove = 0d0 - provide nproc fragment_first fragment_count mo_bielec_integrals_in_map mo_mono_elec_integral pt2_weight + provide nproc fragment_first fragment_count mo_bielec_integrals_in_map mo_mono_elec_integral pt2_weight psi_selectors !call random_seed() @@ -52,15 +52,13 @@ subroutine ZMQ_pt2(E, pt2,relative_error) print *, '========== ================ ================' do while(.true.) - call write_time(6) - call new_parallel_job(zmq_to_qp_run_socket,"pt2") + call new_parallel_job(zmq_to_qp_run_socket,'pt2') call zmq_put_psi(zmq_to_qp_run_socket,1,pt2_e0_denominator,size(pt2_e0_denominator)) call create_selection_buffer(1, 1*2, b) Ncomb=size(comb)/100 call get_carlo_workbatch(computed, comb, Ncomb, tbc) - call write_time(6) integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket @@ -123,6 +121,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error) exit endif end do + print *, '========== ================ ================' deallocate(pt2_detail, comb, computed, tbc) @@ -231,6 +230,9 @@ subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, time0 = omp_get_wtime() endif timeLast = time0 + + call get_first_tooth(actually_computed, tooth) + Nabove_old = Nabove(tooth) ! print *, 'N_deterministic = ', first_det_of_teeth(1)-1 pullLoop : do while (more == 1) @@ -288,13 +290,12 @@ subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, else ! print "(4(G22.13), 4(I9))", time - time0, avg, eqt, Nabove(tooth), tooth, first_det_of_teeth(tooth)-1, done, first_det_of_teeth(tooth+1)-first_det_of_teeth(tooth) if (Nabove(tooth) > Nabove_old) then - print '(E10.1, X, F16.10, E16.3,A30)', Nabove(tooth), avg+E, eqt, '' + print '(G10.3, X, F16.10, G16.3,A30)', Nabove(tooth), avg+E, eqt, '' Nabove_old = Nabove(tooth) endif endif end if end do pullLoop - print *, '========== ================ ================' call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) call end_zmq_pull_socket(zmq_socket_pull) diff --git a/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f b/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f index 306320f7..46250be6 100644 --- a/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f +++ b/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f @@ -37,7 +37,7 @@ subroutine run_wf do - call wait_for_states(states,zmq_state,2) + call wait_for_states(states,zmq_state,3) if(trim(zmq_state) == 'Stopped') then diff --git a/src/Utils/sort.irp.f b/src/Utils/sort.irp.f index bb93d44f..ee1e4cca 100644 --- a/src/Utils/sort.irp.f +++ b/src/Utils/sort.irp.f @@ -359,6 +359,10 @@ BEGIN_TEMPLATE integer :: err !DIR$ ATTRIBUTES ALIGN : 128 :: iorder1,iorder2, x2, x1 + if (isize < 2) then + return + endif + if (iradix == -1) then ! Sort Positive and negative allocate(x1(isize),iorder1(isize), x2(isize),iorder2(isize),stat=err)