10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 20:35:19 +01:00

Fixed minor bugs

This commit is contained in:
Anthony Scemama 2017-05-02 16:18:02 +02:00
parent 2454862cb0
commit be00409eaf
7 changed files with 21 additions and 12 deletions

View File

@ -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_float x = x
let of_int i = Float.of_int i let of_int i = Float.of_int i
@ -14,5 +14,4 @@ let to_string x =
Printf.sprintf "+%f" x Printf.sprintf "+%f" x
else else
Printf.sprintf "%f" x Printf.sprintf "%f" x
;;

View File

@ -22,6 +22,11 @@ let update ~cur_value bar =
let increment_end bar = let increment_end bar =
{ bar with end_value=(bar.end_value +. 1.) ; dirty=false } { bar with end_value=(bar.end_value +. 1.) ; dirty=false }
let clear bar =
Printf.eprintf " \r%!";
None
let increment_cur bar = let increment_cur bar =
{ bar with cur_value=(bar.cur_value +. 1.) ; dirty=true } { bar with cur_value=(bar.cur_value +. 1.) ; dirty=true }

View File

@ -212,7 +212,7 @@ let end_job msg program_state rep_socket pair_socket =
reply_ok rep_socket; reply_ok rep_socket;
{ program_state with { program_state with
state = None ; state = None ;
progress_bar = None ; progress_bar = Progress_bar.clear ();
} }
in in

View File

@ -128,7 +128,7 @@ program fci_zmq
double precision :: relative_error double precision :: relative_error
relative_error=1.d-3 relative_error=1.d-3
pt2 = 0.d0 pt2 = 0.d0
if (N_states > 1) then if (N_states == 1) then
print *, 'Stochastic PT2' print *, 'Stochastic PT2'
call ZMQ_pt2(E_CI_before(1), pt2,relative_error) ! Stochastic PT2 call ZMQ_pt2(E_CI_before(1), pt2,relative_error) ! Stochastic PT2
else else

View File

@ -32,7 +32,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error)
sum2above = 0d0 sum2above = 0d0
Nabove = 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() !call random_seed()
@ -52,15 +52,13 @@ subroutine ZMQ_pt2(E, pt2,relative_error)
print *, '========== ================ ================' print *, '========== ================ ================'
do while(.true.) 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 zmq_put_psi(zmq_to_qp_run_socket,1,pt2_e0_denominator,size(pt2_e0_denominator))
call create_selection_buffer(1, 1*2, b) call create_selection_buffer(1, 1*2, b)
Ncomb=size(comb)/100 Ncomb=size(comb)/100
call get_carlo_workbatch(computed, comb, Ncomb, tbc) call get_carlo_workbatch(computed, comb, Ncomb, tbc)
call write_time(6)
integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket
@ -123,6 +121,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error)
exit exit
endif endif
end do end do
print *, '========== ================ ================'
deallocate(pt2_detail, comb, computed, tbc) deallocate(pt2_detail, comb, computed, tbc)
@ -232,6 +231,9 @@ subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove,
endif endif
timeLast = time0 timeLast = time0
call get_first_tooth(actually_computed, tooth)
Nabove_old = Nabove(tooth)
! print *, 'N_deterministic = ', first_det_of_teeth(1)-1 ! print *, 'N_deterministic = ', first_det_of_teeth(1)-1
pullLoop : do while (more == 1) pullLoop : do while (more == 1)
call pull_pt2_results(zmq_socket_pull, Nindex, index, pt2_mwen, task_id, ntask) call pull_pt2_results(zmq_socket_pull, Nindex, index, pt2_mwen, task_id, ntask)
@ -288,13 +290,12 @@ subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove,
else 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) ! 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 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) Nabove_old = Nabove(tooth)
endif endif
endif endif
end if end if
end do pullLoop end do pullLoop
print *, '========== ================ ================'
call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket)
call end_zmq_pull_socket(zmq_socket_pull) call end_zmq_pull_socket(zmq_socket_pull)

View File

@ -37,7 +37,7 @@ subroutine run_wf
do do
call wait_for_states(states,zmq_state,2) call wait_for_states(states,zmq_state,3)
if(trim(zmq_state) == 'Stopped') then if(trim(zmq_state) == 'Stopped') then

View File

@ -359,6 +359,10 @@ BEGIN_TEMPLATE
integer :: err integer :: err
!DIR$ ATTRIBUTES ALIGN : 128 :: iorder1,iorder2, x2, x1 !DIR$ ATTRIBUTES ALIGN : 128 :: iorder1,iorder2, x2, x1
if (isize < 2) then
return
endif
if (iradix == -1) then ! Sort Positive and negative if (iradix == -1) then ! Sort Positive and negative
allocate(x1(isize),iorder1(isize), x2(isize),iorder2(isize),stat=err) allocate(x1(isize),iorder1(isize), x2(isize),iorder2(isize),stat=err)