10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-24 13:23:41 +01:00

Improved parallel scaling

This commit is contained in:
Anthony Scemama 2018-09-18 00:03:39 +02:00
parent df7d5cd117
commit f3e22a81f7
4 changed files with 26 additions and 11 deletions

View File

@ -332,7 +332,8 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d
i = psi_bilinear_matrix_rows(l_a)
if (nt + exc_degree(i) <= 4) then
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
k=k+1
endif
@ -355,7 +356,8 @@ subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_d
idx = psi_det_sorted_order( &
psi_bilinear_matrix_order( &
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
k=k+1
endif

View File

@ -50,7 +50,8 @@ subroutine run_wf
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 N_det_generators N_states N_states_diag
PROVIDE N_det_generators N_states N_states_diag psi_energy
IRP_IF MPI
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
IRP_ENDIF
@ -155,6 +156,12 @@ subroutine run_wf
! 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)
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
@ -177,13 +184,19 @@ subroutine run_wf
call wall_time(t1)
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
lstop = .False.
!$OMP PARALLEL PRIVATE(i)
i = omp_get_thread_num()
call run_pt2_slave(0,i,pt2_e0_denominator)
!$OMP END PARALLEL
if (.true.) then
!$OMP PARALLEL PRIVATE(i)
i = omp_get_thread_num()
call run_pt2_slave(0,i,pt2_e0_denominator)
!$OMP END PARALLEL
endif
print *, 'PT2 done'
FREE state_average_weight

View File

@ -13,7 +13,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ]
N_det_generators = N_det
do i=1,N_det
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
exit
endif

View File

@ -13,7 +13,7 @@ BEGIN_PROVIDER [ integer, N_det_selectors]
norm = 1.d0
do i=1,N_det
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
exit
endif