10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 04:43:50 +01:00

Fixed pt2 stoch print

This commit is contained in:
Anthony Scemama 2017-03-13 00:30:14 +01:00
parent fce537fea9
commit abf9073a69
4 changed files with 14 additions and 11 deletions

View File

@ -63,7 +63,8 @@ subroutine pt2_slave_tcp(i,energy)
implicit none implicit none
double precision, intent(in) :: energy(N_states_diag) double precision, intent(in) :: energy(N_states_diag)
integer, intent(in) :: i integer, intent(in) :: i
logical :: lstop
call run_pt2_slave(0,i,energy) lstop = .False.
call run_pt2_slave(0,i,energy,lstop)
end end

View File

@ -27,7 +27,7 @@ subroutine ZMQ_pt2(pt2,relative_error)
double precision, external :: omp_get_wtime double precision, external :: omp_get_wtime
double precision :: time0, time double precision :: time0, time
allocate(pt2_detail(N_states, N_det_generators), comb(N_det_generators), computed(N_det_generators), tbc(0:size_tbc)) allocate(pt2_detail(N_states, N_det_generators), comb(N_det_generators/2), computed(N_det_generators), tbc(0:size_tbc))
sumabove = 0d0 sumabove = 0d0
sum2above = 0d0 sum2above = 0d0
Nabove = 0d0 Nabove = 0d0
@ -105,12 +105,12 @@ subroutine ZMQ_pt2(pt2,relative_error)
call pt2_slave_inproc(i) call pt2_slave_inproc(i)
endif endif
!$OMP END PARALLEL !$OMP END PARALLEL
call end_parallel_job(zmq_to_qp_run_socket, 'pt2')
else else
pt2(1) = sum(pt2_detail(1,:)) pt2(1) = sum(pt2_detail(1,:))
endif endif
call end_parallel_job(zmq_to_qp_run_socket, 'pt2')
tbc(0) = 0 tbc(0) = 0
if (pt2(1) /= 0.d0) then if (pt2(1) /= 0.d0) then
exit exit
@ -270,14 +270,14 @@ subroutine pt2_collector(b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, su
avg = E0 + (sumabove(tooth) / Nabove(tooth)) avg = E0 + (sumabove(tooth) / Nabove(tooth))
eqt = sqrt(1d0 / (Nabove(tooth)-1) * abs(sum2above(tooth) / Nabove(tooth) - (sumabove(tooth)/Nabove(tooth))**2)) eqt = sqrt(1d0 / (Nabove(tooth)-1) * abs(sum2above(tooth) / Nabove(tooth) - (sumabove(tooth)/Nabove(tooth))**2))
time = omp_get_wtime() time = omp_get_wtime()
print "(3(E22.13), 4(I9))", "PT2stoch ", 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 (dabs(eqt/avg) < relative_error) then if (dabs(eqt/avg) < relative_error) then
pt2(1) = avg pt2(1) = avg
exit pullLoop ! exit pullLoop
endif endif
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)
end if end if
end do pullLoop end do pullLoop
print "(3(E22.13), 4(I9))", "PT2stoch ", 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)
call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket)

View File

@ -75,15 +75,17 @@ subroutine run_wf
else if (trim(zmq_state) == 'pt2') then else if (trim(zmq_state) == 'pt2') then
! Selection ! PT2
! --------- ! ---
print *, 'PT2' print *, 'PT2'
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states)
logical :: lstop
lstop = .False.
!$OMP PARALLEL PRIVATE(i) !$OMP PARALLEL PRIVATE(i)
i = omp_get_thread_num() i = omp_get_thread_num()
call run_pt2_slave(0,i,energy) call run_pt2_slave(0,i,energy,lstop)
!$OMP END PARALLEL !$OMP END PARALLEL
print *, 'PT2 done' print *, 'PT2 done'