mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-26 14:31:44 +02:00
Merge branch 'master' into garniron-alpha_factory
This commit is contained in:
commit
72b0c84cb6
2
configure
vendored
2
configure
vendored
@ -138,7 +138,7 @@ zeromq = Info(
|
|||||||
default_path=join(QP_ROOT_LIB, "libzmq.a"))
|
default_path=join(QP_ROOT_LIB, "libzmq.a"))
|
||||||
|
|
||||||
gmp= Info(
|
gmp= Info(
|
||||||
url='https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2',
|
url='ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2',
|
||||||
description=' The GNU Multiple Precision Arithmetic Library',
|
description=' The GNU Multiple Precision Arithmetic Library',
|
||||||
default_path=join(QP_ROOT_LIB, "libgmp.a"))
|
default_path=join(QP_ROOT_LIB, "libgmp.a"))
|
||||||
|
|
||||||
|
@ -57,6 +57,8 @@ subroutine run_wf
|
|||||||
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
||||||
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
||||||
PROVIDE psi_bilinear_matrix_transp_order
|
PROVIDE psi_bilinear_matrix_transp_order
|
||||||
|
psi_energy(1:N_states) = energy(1:N_states)
|
||||||
|
TOUCH psi_energy
|
||||||
|
|
||||||
!$OMP PARALLEL PRIVATE(i)
|
!$OMP PARALLEL PRIVATE(i)
|
||||||
i = omp_get_thread_num()
|
i = omp_get_thread_num()
|
||||||
|
@ -65,6 +65,8 @@ subroutine run_wf
|
|||||||
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
|
||||||
if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle
|
if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle
|
||||||
if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle
|
if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle
|
||||||
|
psi_energy(1:N_states) = energy(1:N_states)
|
||||||
|
TOUCH psi_energy
|
||||||
|
|
||||||
call wall_time(t1)
|
call wall_time(t1)
|
||||||
call write_double(6,(t1-t0),'Broadcast time')
|
call write_double(6,(t1-t0),'Broadcast time')
|
||||||
@ -105,6 +107,8 @@ subroutine run_wf
|
|||||||
if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle
|
if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -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
|
||||||
if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle
|
if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle
|
||||||
|
psi_energy(1:N_states) = energy(1:N_states)
|
||||||
|
TOUCH psi_energy
|
||||||
|
|
||||||
call wall_time(t1)
|
call wall_time(t1)
|
||||||
call write_double(6,(t1-t0),'Broadcast time')
|
call write_double(6,(t1-t0),'Broadcast time')
|
||||||
|
@ -13,64 +13,81 @@ program selection_slave
|
|||||||
end
|
end
|
||||||
|
|
||||||
subroutine provide_everything
|
subroutine provide_everything
|
||||||
PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context
|
PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context n_states_diag
|
||||||
PROVIDE pt2_e0_denominator mo_tot_num N_int fragment_count
|
PROVIDE pt2_e0_denominator mo_tot_num N_int fragment_count ci_energy mpi_master zmq_state zmq_context
|
||||||
|
PROVIDE psi_det psi_coef
|
||||||
end
|
end
|
||||||
|
|
||||||
subroutine run_wf
|
subroutine run_wf
|
||||||
use f77_zmq
|
use f77_zmq
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
|
IRP_IF MPI
|
||||||
|
include 'mpif.h'
|
||||||
|
IRP_ENDIF
|
||||||
|
|
||||||
integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket
|
integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket
|
||||||
integer(ZMQ_PTR) :: zmq_to_qp_run_socket
|
integer(ZMQ_PTR) :: zmq_to_qp_run_socket
|
||||||
double precision :: energy(N_states)
|
double precision :: energy(N_states)
|
||||||
character*(64) :: states(4)
|
character*(64) :: states(2)
|
||||||
integer :: rc, i, ierr
|
integer :: rc, i, ierr
|
||||||
|
double precision :: t0, t1
|
||||||
|
|
||||||
integer, external :: zmq_get_dvector
|
integer, external :: zmq_get_dvector, zmq_get_N_det_generators
|
||||||
integer, external :: zmq_get_psi
|
integer, external :: zmq_get_psi, zmq_get_N_det_selectors
|
||||||
|
integer, external :: zmq_get_N_states_diag
|
||||||
|
|
||||||
call provide_everything
|
call provide_everything
|
||||||
|
|
||||||
zmq_context = f77_zmq_ctx_new ()
|
zmq_context = f77_zmq_ctx_new ()
|
||||||
states(1) = 'selection'
|
states(1) = 'selection'
|
||||||
states(2) = 'davidson'
|
states(2) = 'pt2'
|
||||||
states(3) = 'pt2'
|
|
||||||
|
|
||||||
zmq_to_qp_run_socket = new_zmq_to_qp_run_socket()
|
zmq_to_qp_run_socket = new_zmq_to_qp_run_socket()
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
call wait_for_states(states,zmq_state,3)
|
call wait_for_states(states,zmq_state,size(states))
|
||||||
|
print *, trim(zmq_state)
|
||||||
|
|
||||||
if(trim(zmq_state) == 'Stopped') then
|
if(zmq_state(1:7) == 'Stopped') then
|
||||||
|
|
||||||
exit
|
exit
|
||||||
|
|
||||||
else if (trim(zmq_state) == 'selection') then
|
else if (zmq_state(1:9) == 'selection') then
|
||||||
|
|
||||||
! Selection
|
! Selection
|
||||||
! ---------
|
! ---------
|
||||||
|
|
||||||
print *, 'Selection'
|
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_selectors(zmq_to_qp_run_socket, 1) == -1) cycle
|
||||||
if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle
|
if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle
|
||||||
|
|
||||||
|
call wall_time(t1)
|
||||||
|
call write_double(6,(t1-t0),'Broadcast time')
|
||||||
|
|
||||||
!$OMP PARALLEL PRIVATE(i)
|
!$OMP PARALLEL PRIVATE(i)
|
||||||
i = omp_get_thread_num()
|
i = omp_get_thread_num()
|
||||||
call run_selection_slave(0,i,energy)
|
call run_selection_slave(0,i,energy)
|
||||||
!$OMP END PARALLEL
|
!$OMP END PARALLEL
|
||||||
print *, 'Selection done'
|
print *, 'Selection done'
|
||||||
|
|
||||||
else if (trim(zmq_state) == 'pt2') then
|
else if (zmq_state(1:3) == 'pt2') then
|
||||||
|
|
||||||
! PT2
|
! PT2
|
||||||
! ---
|
! ---
|
||||||
|
|
||||||
print *, 'PT2'
|
print *, 'PT2'
|
||||||
|
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_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle
|
if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle
|
||||||
|
if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle
|
||||||
|
if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle
|
||||||
|
|
||||||
|
call wall_time(t1)
|
||||||
|
call write_double(6,(t1-t0),'Broadcast time')
|
||||||
|
|
||||||
logical :: lstop
|
logical :: lstop
|
||||||
lstop = .False.
|
lstop = .False.
|
||||||
@ -82,7 +99,17 @@ subroutine run_wf
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
IRP_IF MPI
|
||||||
|
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
||||||
|
if (ierr /= MPI_SUCCESS) then
|
||||||
|
print *, irp_here, 'error in barrier'
|
||||||
|
endif
|
||||||
|
IRP_ENDIF
|
||||||
|
|
||||||
end do
|
end do
|
||||||
|
IRP_IF MPI
|
||||||
|
call MPI_finalize(i)
|
||||||
|
IRP_ENDIF
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ integer function zmq_get_psi_det(zmq_to_qp_run_socket, worker_id)
|
|||||||
if (ierr /= MPI_SUCCESS) then
|
if (ierr /= MPI_SUCCESS) then
|
||||||
stop 'Unable to broadcast zmq_get_psi_det'
|
stop 'Unable to broadcast zmq_get_psi_det'
|
||||||
endif
|
endif
|
||||||
call broadcast_chunks_bit_kind(psi_det,N_det*N_int*2)
|
call broadcast_chunks_bit_kind(psi_det,size(psi_det))
|
||||||
IRP_ENDIF
|
IRP_ENDIF
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -353,7 +353,7 @@ integer function zmq_get_psi_coef(zmq_to_qp_run_socket, worker_id)
|
|||||||
if (ierr /= MPI_SUCCESS) then
|
if (ierr /= MPI_SUCCESS) then
|
||||||
stop 'Unable to broadcast zmq_get_psi_coef'
|
stop 'Unable to broadcast zmq_get_psi_coef'
|
||||||
endif
|
endif
|
||||||
call broadcast_chunks_double(psi_coef,N_states*N_det)
|
call broadcast_chunks_double(psi_coef,size(psi_coef))
|
||||||
IRP_ENDIF
|
IRP_ENDIF
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -100,7 +100,7 @@ subroutine bielec_integrals_index_reverse(i,j,k,l,i1)
|
|||||||
call bielec_integrals_index(i(ii),j(ii),k(ii),l(ii),i2)
|
call bielec_integrals_index(i(ii),j(ii),k(ii),l(ii),i2)
|
||||||
if (i1 /= i2) then
|
if (i1 /= i2) then
|
||||||
print *, i1, i2
|
print *, i1, i2
|
||||||
print *, i(ii), j(jj), k(jj), l(jj)
|
print *, i(ii), j(ii), k(ii), l(ii)
|
||||||
stop 'bielec_integrals_index_reverse failed'
|
stop 'bielec_integrals_index_reverse failed'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user