10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-25 22:52:15 +02:00

Prints in selection

This commit is contained in:
Anthony Scemama 2014-05-31 01:18:02 +02:00
parent 3360bdf993
commit 60faffaae5
4 changed files with 37 additions and 2 deletions

View File

@ -17,6 +17,8 @@ copy_buffer
finalization
generate_psi_guess
init_thread
printout_now
printout_always
deinit_thread
""".split()
@ -84,6 +86,8 @@ class H_apply(object):
s[k] = ""
s["size_max"] = str(1024*128)
s["copy_buffer"] = "call copy_h_apply_buffer_to_wf"
s["printout_now"] = """write(output_Dets,*) &
100.*float(i_generator)/float(N_det_generators), '% in ', wall_2-wall_1, 's'"""
self.data = s
def __setitem__(self,key,value):
@ -154,14 +158,38 @@ class H_apply(object):
double precision, intent(inout):: pt2(N_st)
double precision, intent(inout):: norm_pert(N_st)
double precision, intent(inout):: H_pert_diag(N_st)
double precision :: delta_pt2(N_st), norm_psi(N_st), pt2_old(N_st)
PROVIDE CI_electronic_energy N_det_generators key_pattern_not_in_ref
do k=1,N_st
pt2(k) = 0.d0
norm_pert(k) = 0.d0
H_pert_diag(k) = 0.d0
norm_psi(k) = 0.d0
delta_pt2(k) = 0.d0
pt2_old(k) = 0.d0
enddo
write(output_Dets,'(A12, X, A8, 3(2X, A9), 2X, A8, 2X, A8, 2X, A8)') &
'N_generators', 'Norm', 'Delta PT2', 'PT2', 'Est. PT2', 'secs'
write(output_Dets,'(A12, X, A8, 3(2X, A9), 2X, A8, 2X, A8, 2X, A8)') &
'============', '========', '=========', '=========', '=========', &
'========='
"""
self.data["printout_always"] = """
do k=1,N_st
norm_psi(k) = norm_psi(k) + psi_coef(i_generator,k)*psi_coef(i_generator,k)
delta_pt2(k) = pt2(k) - pt2_old(k)
enddo
"""
self.data["printout_now"] = """
do k=1,N_st
write(output_Dets,'(I10, 4(2X, F9.6), 2X, F8.1)') &
i_generator, norm_psi(k), delta_pt2(k), pt2(k), &
pt2(k)/norm_psi(k), &
wall_2-wall_1
pt2_old(k) = pt2(k)
enddo
"""
if self.openmp:
self.data["omp_parallel"] += """&
!$OMP SHARED(N_st) PRIVATE(e_2_pert_buffer,coef_pert_buffer) &

View File

@ -214,7 +214,6 @@ subroutine $subroutine_diexc(key_in, hole_1,particl_1, hole_2, particl_2, i_gene
occ_hole_tmp)
$omp_end_parallel
$finalization
abort_here = abort_all
end
subroutine $subroutine_monoexc(key_in, hole_1,particl_1,i_generator $parameters )
@ -344,7 +343,9 @@ subroutine $subroutine($params_main)
PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map N_det_reference psi_generators
integer :: i_generator, k
double precision :: wall_0, wall_1, wall_2
call wall_time(wall_1)
do i_generator=1,N_det_generators
call $subroutine_diexc(psi_generators(1,1,i_generator), &
generators_bitmask(1,1,d_hole1,i_bitmask_gen), &
@ -359,6 +360,12 @@ subroutine $subroutine($params_main)
if (abort_here) then
exit
endif
call wall_time(wall_2)
$printout_always
if (wall_2 - wall_0 > 2.d0) then
wall_0 = wall_2
$printout_now
endif
enddo
$copy_buffer

View File

@ -503,7 +503,7 @@ subroutine i_H_psi(key,keys,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array)
double precision :: hij
integer :: idx(0:Ndet)
BEGIN_DOC
! <key|H|psi> for the various Nstate
! <key|H|psi> for the various Nstates
END_DOC
ASSERT (Nint > 0)