mirror of
https://github.com/LCPQ/quantum_package
synced 2024-11-03 12:43:52 +01:00
Improved parallel scaling
This commit is contained in:
parent
df7d5cd117
commit
f3e22a81f7
@ -332,7 +332,8 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d
|
|||||||
i = psi_bilinear_matrix_rows(l_a)
|
i = psi_bilinear_matrix_rows(l_a)
|
||||||
if (nt + exc_degree(i) <= 4) then
|
if (nt + exc_degree(i) <= 4) then
|
||||||
idx = psi_det_sorted_order(psi_bilinear_matrix_order(l_a))
|
idx = psi_det_sorted_order(psi_bilinear_matrix_order(l_a))
|
||||||
if (psi_average_norm_contrib_sorted(idx) < 1.d-12) cycle
|
! if (psi_average_norm_contrib_sorted(idx) < 1.d-12) cycle
|
||||||
|
if (idx > N_det_selectors) cycle
|
||||||
indices(k) = idx
|
indices(k) = idx
|
||||||
k=k+1
|
k=k+1
|
||||||
endif
|
endif
|
||||||
@ -355,7 +356,8 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d
|
|||||||
idx = psi_det_sorted_order( &
|
idx = psi_det_sorted_order( &
|
||||||
psi_bilinear_matrix_order( &
|
psi_bilinear_matrix_order( &
|
||||||
psi_bilinear_matrix_transp_order(l_a)))
|
psi_bilinear_matrix_transp_order(l_a)))
|
||||||
if (psi_average_norm_contrib_sorted(idx) < 1.d-12) cycle
|
! if (psi_average_norm_contrib_sorted(idx) < 1.d-12) cycle
|
||||||
|
if (idx > N_det_selectors) cycle
|
||||||
indices(k) = idx
|
indices(k) = idx
|
||||||
k=k+1
|
k=k+1
|
||||||
endif
|
endif
|
||||||
|
@ -50,7 +50,8 @@ subroutine run_wf
|
|||||||
|
|
||||||
PROVIDE psi_det psi_coef threshold_generators threshold_selectors state_average_weight mpi_master
|
PROVIDE psi_det psi_coef threshold_generators threshold_selectors state_average_weight mpi_master
|
||||||
PROVIDE zmq_state N_det_selectors pt2_stoch_istate N_det pt2_e0_denominator
|
PROVIDE zmq_state N_det_selectors pt2_stoch_istate N_det pt2_e0_denominator
|
||||||
PROVIDE N_det_generators N_states N_states_diag
|
PROVIDE N_det_generators N_states N_states_diag psi_energy
|
||||||
|
|
||||||
IRP_IF MPI
|
IRP_IF MPI
|
||||||
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
||||||
IRP_ENDIF
|
IRP_ENDIF
|
||||||
@ -155,6 +156,12 @@ subroutine run_wf
|
|||||||
! PT2
|
! PT2
|
||||||
! ---
|
! ---
|
||||||
|
|
||||||
|
IRP_IF MPI
|
||||||
|
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
||||||
|
if (ierr /= MPI_SUCCESS) then
|
||||||
|
print *, irp_here, 'error in barrier'
|
||||||
|
endif
|
||||||
|
IRP_ENDIF
|
||||||
call wall_time(t0)
|
call wall_time(t0)
|
||||||
if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle
|
if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle
|
||||||
if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle
|
if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle
|
||||||
@ -177,13 +184,19 @@ subroutine run_wf
|
|||||||
|
|
||||||
call wall_time(t1)
|
call wall_time(t1)
|
||||||
call write_double(6,(t1-t0),'Broadcast time')
|
call write_double(6,(t1-t0),'Broadcast time')
|
||||||
|
IRP_IF MPI
|
||||||
|
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
||||||
|
if (ierr /= MPI_SUCCESS) then
|
||||||
|
print *, irp_here, 'error in barrier'
|
||||||
|
endif
|
||||||
|
IRP_ENDIF
|
||||||
|
|
||||||
logical :: lstop
|
if (.true.) then
|
||||||
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,pt2_e0_denominator)
|
||||||
call run_pt2_slave(0,i,pt2_e0_denominator)
|
!$OMP END PARALLEL
|
||||||
!$OMP END PARALLEL
|
endif
|
||||||
print *, 'PT2 done'
|
print *, 'PT2 done'
|
||||||
FREE state_average_weight
|
FREE state_average_weight
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ]
|
|||||||
N_det_generators = N_det
|
N_det_generators = N_det
|
||||||
do i=1,N_det
|
do i=1,N_det
|
||||||
norm = norm - psi_average_norm_contrib_sorted(i)
|
norm = norm - psi_average_norm_contrib_sorted(i)
|
||||||
if (norm - 1.d-12 < 1.d0 - threshold_generators) then
|
if (norm - 1.d-10 < 1.d0 - threshold_generators) then
|
||||||
N_det_generators = i
|
N_det_generators = i
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
|
@ -13,7 +13,7 @@ BEGIN_PROVIDER [ integer, N_det_selectors]
|
|||||||
norm = 1.d0
|
norm = 1.d0
|
||||||
do i=1,N_det
|
do i=1,N_det
|
||||||
norm = norm - psi_average_norm_contrib_sorted(i)
|
norm = norm - psi_average_norm_contrib_sorted(i)
|
||||||
if (norm - 1.d-12 < 1.d0 - threshold_selectors) then
|
if (norm - 1.d-10 < 1.d0 - threshold_selectors) then
|
||||||
N_det_selectors = i
|
N_det_selectors = i
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user