mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 04:13:55 +01:00
pass is_complex as argument to pt2_type_size
This commit is contained in:
parent
d705956969
commit
43c7696001
@ -266,8 +266,8 @@ subroutine ZMQ_pt2(E, pt2_data, pt2_data_err, relative_error, N_in)
|
|||||||
mem_collector = 8.d0 * & ! bytes
|
mem_collector = 8.d0 * & ! bytes
|
||||||
( 1.d0*pt2_n_tasks_max & ! task_id, index
|
( 1.d0*pt2_n_tasks_max & ! task_id, index
|
||||||
+ 0.635d0*N_det_generators & ! f,d
|
+ 0.635d0*N_det_generators & ! f,d
|
||||||
+ pt2_n_tasks_max*pt2_type_size(N_states) & ! pt2_data_task
|
+ pt2_n_tasks_max*pt2_type_size(N_states,is_complex) & ! pt2_data_task
|
||||||
+ N_det_generators*pt2_type_size(N_states) & ! pt2_data_I
|
+ N_det_generators*pt2_type_size(N_states,is_complex) & ! pt2_data_I
|
||||||
+ 4.d0*(pt2_N_teeth+1) & ! S, S2, T2, T3
|
+ 4.d0*(pt2_N_teeth+1) & ! S, S2, T2, T3
|
||||||
+ 1.d0*(N_int*2.d0*N + N) & ! selection buffer
|
+ 1.d0*(N_int*2.d0*N + N) & ! selection buffer
|
||||||
+ 1.d0*(N_int*2.d0*N + N) & ! sort selection buffer
|
+ 1.d0*(N_int*2.d0*N + N) & ! sort selection buffer
|
||||||
@ -282,7 +282,7 @@ subroutine ZMQ_pt2(E, pt2_data, pt2_data_err, relative_error, N_in)
|
|||||||
nproc_target * 8.d0 * & ! bytes
|
nproc_target * 8.d0 * & ! bytes
|
||||||
( 0.5d0*pt2_n_tasks_max & ! task_id
|
( 0.5d0*pt2_n_tasks_max & ! task_id
|
||||||
+ 64.d0*pt2_n_tasks_max & ! task
|
+ 64.d0*pt2_n_tasks_max & ! task
|
||||||
+ pt2_type_size(N_states)*pt2_n_tasks_max*N_states & ! pt2, variance, overlap
|
+ pt2_type_size(N_states,is_complex)*pt2_n_tasks_max*N_states & ! pt2, variance, overlap
|
||||||
+ 1.d0*pt2_n_tasks_max & ! i_generator, subset
|
+ 1.d0*pt2_n_tasks_max & ! i_generator, subset
|
||||||
+ 1.d0*(N_int*2.d0*ii+ ii) & ! selection buffer
|
+ 1.d0*(N_int*2.d0*ii+ ii) & ! selection buffer
|
||||||
+ 1.d0*(N_int*2.d0*ii+ ii) & ! sort selection buffer
|
+ 1.d0*(N_int*2.d0*ii+ ii) & ! sort selection buffer
|
||||||
|
@ -339,7 +339,7 @@ subroutine push_pt2_results_async_send(zmq_socket_push, index, pt2_data, b, task
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
allocate(pt2_serialized (pt2_type_size(N_states),n_tasks) )
|
allocate(pt2_serialized (pt2_type_size(N_states,is_complex),n_tasks) )
|
||||||
do i=1,n_tasks
|
do i=1,n_tasks
|
||||||
call pt2_serialize(pt2_data(i),N_states,pt2_serialized(1,i))
|
call pt2_serialize(pt2_data(i),N_states,pt2_serialized(1,i))
|
||||||
enddo
|
enddo
|
||||||
@ -480,7 +480,7 @@ subroutine pull_pt2_results(zmq_socket_pull, index, pt2_data, task_id, n_tasks,
|
|||||||
stop 'pull'
|
stop 'pull'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
allocate(pt2_serialized (pt2_type_size(N_states),n_tasks) )
|
allocate(pt2_serialized (pt2_type_size(N_states,is_complex),n_tasks) )
|
||||||
rc = f77_zmq_recv( zmq_socket_pull, pt2_serialized, 8*size(pt2_serialized)*n_tasks, 0)
|
rc = f77_zmq_recv( zmq_socket_pull, pt2_serialized, 8*size(pt2_serialized)*n_tasks, 0)
|
||||||
if (rc == -1) then
|
if (rc == -1) then
|
||||||
n_tasks = 1
|
n_tasks = 1
|
||||||
|
@ -145,7 +145,7 @@ subroutine push_selection_results(zmq_socket_push, pt2_data, b, task_id, ntasks)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
allocate(pt2_serialized (pt2_type_size(N_states)) )
|
allocate(pt2_serialized (pt2_type_size(N_states,is_complex)) )
|
||||||
call pt2_serialize(pt2_data,N_states,pt2_serialized)
|
call pt2_serialize(pt2_data,N_states,pt2_serialized)
|
||||||
|
|
||||||
rc = f77_zmq_send( zmq_socket_push, pt2_serialized, size(pt2_serialized)*8, ZMQ_SNDMORE)
|
rc = f77_zmq_send( zmq_socket_push, pt2_serialized, size(pt2_serialized)*8, ZMQ_SNDMORE)
|
||||||
@ -213,7 +213,7 @@ subroutine pull_selection_results(zmq_socket_pull, pt2_data, val, det, N, task_i
|
|||||||
print *, 'f77_zmq_recv( zmq_socket_pull, N, 4, 0)'
|
print *, 'f77_zmq_recv( zmq_socket_pull, N, 4, 0)'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
allocate(pt2_serialized (pt2_type_size(N_states)) )
|
allocate(pt2_serialized (pt2_type_size(N_states,is_complex)) )
|
||||||
rc = f77_zmq_recv( zmq_socket_pull, pt2_serialized, 8*size(pt2_serialized), 0)
|
rc = f77_zmq_recv( zmq_socket_pull, pt2_serialized, 8*size(pt2_serialized), 0)
|
||||||
if (rc == -1) then
|
if (rc == -1) then
|
||||||
ntasks = 1
|
ntasks = 1
|
||||||
|
@ -2096,7 +2096,7 @@ subroutine fill_buffer_double_complex(i_generator, sp, h1, h2, bannedOrb, banned
|
|||||||
logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num)
|
logical, intent(in) :: bannedOrb(mo_num, 2), banned(mo_num, mo_num)
|
||||||
double precision, intent(in) :: fock_diag_tmp(mo_num)
|
double precision, intent(in) :: fock_diag_tmp(mo_num)
|
||||||
double precision, intent(in) :: E0(N_states)
|
double precision, intent(in) :: E0(N_states)
|
||||||
type(pt2_type), intent(inout) :: pt2_date
|
type(pt2_type), intent(inout) :: pt2_data
|
||||||
type(selection_buffer), intent(inout) :: buf
|
type(selection_buffer), intent(inout) :: buf
|
||||||
logical :: ok
|
logical :: ok
|
||||||
integer :: s1, s2, p1, p2, ib, j, istate, jstate
|
integer :: s1, s2, p1, p2, ib, j, istate, jstate
|
||||||
@ -2209,7 +2209,7 @@ subroutine fill_buffer_double_complex(i_generator, sp, h1, h2, bannedOrb, banned
|
|||||||
e_pert(istate) = 0.5d0 * (tmp - delta_E)
|
e_pert(istate) = 0.5d0 * (tmp - delta_E)
|
||||||
!TODO: check conjugate for coef
|
!TODO: check conjugate for coef
|
||||||
if (cdabs(alpha_h_psi) > 1.d-4) then
|
if (cdabs(alpha_h_psi) > 1.d-4) then
|
||||||
coef(istate) = e_pert / alpha_h_psi
|
coef(istate) = e_pert(istate) / alpha_h_psi
|
||||||
else
|
else
|
||||||
coef(istate) = alpha_h_psi / delta_E
|
coef(istate) = alpha_h_psi / delta_E
|
||||||
endif
|
endif
|
||||||
|
@ -11,14 +11,23 @@ module selection_types
|
|||||||
double precision, allocatable :: rpt2(:)
|
double precision, allocatable :: rpt2(:)
|
||||||
double precision, allocatable :: variance(:)
|
double precision, allocatable :: variance(:)
|
||||||
double precision, allocatable :: overlap(:,:)
|
double precision, allocatable :: overlap(:,:)
|
||||||
|
double precision, allocatable :: overlap_imag(:,:)
|
||||||
endtype
|
endtype
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
integer function pt2_type_size(N)
|
integer function pt2_type_size(N,has_imag)
|
||||||
implicit none
|
implicit none
|
||||||
integer, intent(in) :: N
|
integer, intent(in) :: N
|
||||||
if (is_complex) then
|
logical, intent(in), optional :: has_imag
|
||||||
|
logical :: has_imag_tmp
|
||||||
|
if(present(has_imag)) then
|
||||||
|
has_imag_tmp = has_imag
|
||||||
|
else
|
||||||
|
has_imag_tmp = .False.
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (has_imag_tmp) then
|
||||||
pt2_type_size = (3*n + 2*n*n)
|
pt2_type_size = (3*n + 2*n*n)
|
||||||
else
|
else
|
||||||
pt2_type_size = (3*n + n*n)
|
pt2_type_size = (3*n + n*n)
|
||||||
|
@ -105,12 +105,6 @@ subroutine ZMQ_selection(N_in, pt2_data)
|
|||||||
|
|
||||||
f(:) = 1.d0
|
f(:) = 1.d0
|
||||||
if (.not.do_pt2) then
|
if (.not.do_pt2) then
|
||||||
<<<<<<< HEAD
|
|
||||||
double precision :: f(N_states), u_dot_u
|
|
||||||
do k=1,min(N_det,N_states)
|
|
||||||
f(k) = 1.d0 / u_dot_u(psi_selectors_coef(1,k), N_det_selectors)
|
|
||||||
enddo
|
|
||||||
=======
|
|
||||||
double precision :: f(N_states), u_dot_u
|
double precision :: f(N_states), u_dot_u
|
||||||
if (is_complex) then
|
if (is_complex) then
|
||||||
double precision :: u_dot_u_complex
|
double precision :: u_dot_u_complex
|
||||||
@ -122,7 +116,6 @@ subroutine ZMQ_selection(N_in, pt2_data)
|
|||||||
f(k) = 1.d0 / u_dot_u(psi_selectors_coef(1,k), N_det_selectors)
|
f(k) = 1.d0 / u_dot_u(psi_selectors_coef(1,k), N_det_selectors)
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
>>>>>>> origin/cleaning_kpts
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
!$OMP PARALLEL DEFAULT(shared) SHARED(b, pt2_data) PRIVATE(i) NUM_THREADS(nproc_target+1)
|
!$OMP PARALLEL DEFAULT(shared) SHARED(b, pt2_data) PRIVATE(i) NUM_THREADS(nproc_target+1)
|
||||||
|
Loading…
Reference in New Issue
Block a user