10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-03 18:05:59 +02:00

Fixed selection

This commit is contained in:
Anthony Scemama 2018-06-25 14:18:46 +02:00
parent 7f1099f80f
commit ca263297bf
14 changed files with 37 additions and 53 deletions

View File

@ -32,7 +32,7 @@ OPENMP : 1 ; Append OpenMP flags
# #
[OPT] [OPT]
FC : -traceback FC : -traceback
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g FCFLAGS : -xAVX -O2 -ip -ftz -g
# Profiling flags # Profiling flags
################# #################

4
configure vendored
View File

@ -494,9 +494,9 @@ def create_ninja_and_rc(l_installed):
'function qp_prepend_export () {', 'function qp_prepend_export () {',
'eval "value_1="\${$1}""', 'eval "value_1="\${$1}""',
'if [[ -z $value_1 ]] ; then', 'if [[ -z $value_1 ]] ; then',
' echo "${1}=${2}:"', ' echo "${2}:"',
'else', 'else',
' echo "${1}=${2}:${value_1}"', ' echo "${2}:${value_1}"',
'fi', 'fi',
'}', '}',
'export PYTHONPATH=$(qp_prepend_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PYTHON}")', 'export PYTHONPATH=$(qp_prepend_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PYTHON}")',

View File

@ -625,7 +625,7 @@ let get_data msg program_state rep_socket =
let value = let value =
match StringHashtbl.find program_state.data key with match StringHashtbl.find program_state.data key with
| Some value -> value | Some value -> value
| None -> "\0" | None -> "\000"
in in
Message.GetDataReply (Message.GetDataReply_msg.create ~value) Message.GetDataReply (Message.GetDataReply_msg.create ~value)
|> Message.to_string_list |> Message.to_string_list

View File

@ -27,7 +27,6 @@ subroutine run
threshold_generators = 1.d0 threshold_generators = 1.d0
relative_error = 1.d-3 relative_error = 1.d-3
absolute_error = 1.d-5 absolute_error = 1.d-5
call ZMQ_pt2(E_CI_before, pt2, relative_error, absolute_error, eqt) call ZMQ_pt2(E_CI_before, pt2, relative_error, absolute_error, eqt)
print *, 'Final step' print *, 'Final step'
print *, 'N_det = ', N_det print *, 'N_det = ', N_det

View File

@ -335,8 +335,6 @@ subroutine pt2_collector(zmq_socket_pull, E, b, tbc, comb, Ncomb, computed, pt2_
exit pullLoop exit pullLoop
endif endif
!if(Nabove(1) < 5d0) cycle
E0 = sum(pt2_detail(pt2_stoch_istate,:first_det_of_teeth(tooth)-1)) E0 = sum(pt2_detail(pt2_stoch_istate,:first_det_of_teeth(tooth)-1))
if (tooth <= comb_teeth) then if (tooth <= comb_teeth) then
prop = ((1d0 - dfloat(comb_teeth - tooth + 1) * comb_step) - pt2_cweight(first_det_of_teeth(tooth)-1)) prop = ((1d0 - dfloat(comb_teeth - tooth + 1) * comb_step) - pt2_cweight(first_det_of_teeth(tooth)-1))
@ -348,7 +346,7 @@ subroutine pt2_collector(zmq_socket_pull, E, b, tbc, comb, Ncomb, computed, pt2_
eqt = 0.d0 eqt = 0.d0
endif endif
call wall_time(time) call wall_time(time)
if ( ((dabs(eqt/avg) < relative_error) .or. (dabs(eqt) < absolute_error)) .and. Nabove(tooth) >= 30) then if ( ((dabs(eqt/avg) < relative_error) .or. (dabs(eqt) < absolute_error)) .and. Nabove(tooth) >= 10) then
! Termination ! Termination
pt2(pt2_stoch_istate) = avg pt2(pt2_stoch_istate) = avg
error(pt2_stoch_istate) = eqt error(pt2_stoch_istate) = eqt
@ -361,14 +359,13 @@ subroutine pt2_collector(zmq_socket_pull, E, b, tbc, comb, Ncomb, computed, pt2_
endif endif
else else
if (Nabove(tooth) > Nabove_old) then if (Nabove(tooth) > Nabove_old) then
print *, loop
print '(G10.3, 2X, F16.10, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, '' print '(G10.3, 2X, F16.10, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, ''
Nabove_old = Nabove(tooth) Nabove_old = Nabove(tooth)
endif endif
endif endif
end if end if
end do pullLoop end do pullLoop
!<<<<<<< HEAD
if(tooth == comb_teeth+1) then if(tooth == comb_teeth+1) then
pt2(pt2_stoch_istate) = sum(pt2_detail(pt2_stoch_istate,:)) pt2(pt2_stoch_istate) = sum(pt2_detail(pt2_stoch_istate,:))

View File

@ -25,12 +25,6 @@ subroutine run_pt2_slave(thread,iproc,energy)
integer :: n_tasks, k, n_tasks_max integer :: n_tasks, k, n_tasks_max
integer, allocatable :: i_generator(:), subset(:) integer, allocatable :: i_generator(:), subset(:)
!if (mpi_master) then
! do i=1,N_det_generators
! print '(I6,X,100(I10,X))' ,i, psi_det_generators(:,:,i)
! enddo
!endif
n_tasks_max = N_det_generators/100+1 n_tasks_max = N_det_generators/100+1
allocate(task_id(n_tasks_max), task(n_tasks_max)) allocate(task_id(n_tasks_max), task(n_tasks_max))
allocate(pt2(N_states,n_tasks_max), i_generator(n_tasks_max), subset(n_tasks_max)) allocate(pt2(N_states,n_tasks_max), i_generator(n_tasks_max), subset(n_tasks_max))
@ -67,23 +61,24 @@ subroutine run_pt2_slave(thread,iproc,energy)
read (task(k),*) subset(k), i_generator(k) read (task(k),*) subset(k), i_generator(k)
enddo enddo
double precision :: time0, time1 ! double precision :: time0, time1
call wall_time(time0) ! call wall_time(time0)
do k=1,n_tasks do k=1,n_tasks
pt2(:,k) = 0.d0 pt2(:,k) = 0.d0
buf%cur = 0 buf%cur = 0
call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k)) call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k))
enddo enddo
call wall_time(time1) ! call wall_time(time1)
!
integer, external :: tasks_done_to_taskserver integer, external :: tasks_done_to_taskserver
if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then
done = .true. done = .true.
endif endif
call push_pt2_results(zmq_socket_push, i_generator, pt2, task_id, n_tasks) call push_pt2_results(zmq_socket_push, i_generator, pt2, task_id, n_tasks)
! Try to adjust n_tasks around 5 second per job ! ! Try to adjust n_tasks around 5 second per job
n_tasks = min(n_tasks,int( 5.d0*dble(n_tasks) / (time1 - time0 + 1.d-9)))+1 ! n_tasks = min(n_tasks,int( 5.d0*dble(n_tasks) / (time1 - time0 + 1.d-9)))+1
n_tasks = n_tasks+1
end do end do
integer, external :: disconnect_from_taskserver integer, external :: disconnect_from_taskserver

View File

@ -97,8 +97,9 @@ subroutine run_selection_slave_new(thread,iproc,energy)
pt2(:,:) = 0d0 pt2(:,:) = 0d0
buf%cur = 0 buf%cur = 0
! Try to adjust n_tasks around 5 second per job ! ! Try to adjust n_tasks around 5 second per job
n_tasks = min(n_tasks,int( 5.d0 * dble(n_tasks) / (time1 - time0 + 1.d-9)))+1 ! n_tasks = min(n_tasks,int( 5.d0 * dble(n_tasks) / (time1 - time0 + 1.d-9)))+1
n_tasks = n_tasks+1
end do end do
integer, external :: disconnect_from_taskserver integer, external :: disconnect_from_taskserver

View File

@ -60,7 +60,8 @@ subroutine ZMQ_selection(N_in, pt2)
task = ' ' task = ' '
do i= 1, N_det_generators do i= 1, N_det_generators
if (i>ishft(N_det_generators,-2)) then ! /!\ Fragments don't work
! if (i>-ishft(N_det_generators,-2)) then
write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') 0, i, N write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') 0, i, N
ipos += 30 ipos += 30
if (ipos > 63970) then if (ipos > 63970) then
@ -69,18 +70,18 @@ subroutine ZMQ_selection(N_in, pt2)
endif endif
ipos=1 ipos=1
endif endif
else ! else
do j=1,fragment_count ! do j=1,fragment_count
write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') j, i, N ! write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') j, i, N
ipos += 30 ! ipos += 30
if (ipos > 63970) then ! if (ipos > 63970) then
if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then ! if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then
stop 'Unable to add task to task server' ! stop 'Unable to add task to task server'
endif ! endif
ipos=1 ! ipos=1
endif ! endif
end do ! end do
endif ! endif
enddo enddo
if (ipos > 1) then if (ipos > 1) then
if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then

View File

@ -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 > threshold_generators+1d-15) then if (norm >= threshold_generators) then
N_det_generators = i N_det_generators = i
exit exit
endif endif
@ -47,9 +47,7 @@ END_PROVIDER
integer :: i, k integer :: i, k
psi_det_sorted_gen = psi_det_sorted psi_det_sorted_gen = psi_det_sorted
psi_coef_sorted_gen = psi_coef_sorted psi_coef_sorted_gen = psi_coef_sorted
!do i=1,N_det_generators
psi_det_sorted_gen_order = psi_det_sorted_order psi_det_sorted_gen_order = psi_det_sorted_order
!end do
END_PROVIDER END_PROVIDER

View File

@ -194,7 +194,6 @@ subroutine copy_H_apply_buffer_to_wf
! logical :: found_duplicates ! logical :: found_duplicates
! call remove_duplicates_in_psi_det(found_duplicates) ! call remove_duplicates_in_psi_det(found_duplicates)
end end
subroutine remove_duplicates_in_psi_det(found_duplicates) subroutine remove_duplicates_in_psi_det(found_duplicates)

View File

@ -190,7 +190,7 @@ subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8)
vt = 0.d0 vt = 0.d0
do sh=1,shortcut(0,1) do sh=1,shortcut(0,1)
!$OMP DO !$OMP DO SCHEDULE(static,1)
do sh2=sh,shortcut(0,1) do sh2=sh,shortcut(0,1)
exa = 0 exa = 0
do ni=1,Nint do ni=1,Nint

View File

@ -115,6 +115,7 @@ END_PROVIDER
ao_num,ao_ortho_canonical_coef,size(ao_ortho_canonical_coef,1), & ao_num,ao_ortho_canonical_coef,size(ao_ortho_canonical_coef,1), &
ao_ortho_canonical_num) ao_ortho_canonical_num)
else else
double precision, allocatable :: S(:,:) double precision, allocatable :: S(:,:)
@ -134,13 +135,6 @@ END_PROVIDER
S, size(S,1), & S, size(S,1), &
0.d0, ao_ortho_canonical_coef, size(ao_ortho_canonical_coef,1)) 0.d0, ao_ortho_canonical_coef, size(ao_ortho_canonical_coef,1))
!integer :: j
!do i=1,ao_num
! do j=1,ao_num
! print *, i,j, ao_ortho_canonical_coef(i,j)
! enddo
!enddo
!stop
deallocate(S) deallocate(S)
endif endif
END_PROVIDER END_PROVIDER

View File

@ -323,7 +323,7 @@ IRP_ENDIF
stop 'Unable to set ZMQ_LINGER on push socket' stop 'Unable to set ZMQ_LINGER on push socket'
endif endif
rc = f77_zmq_setsockopt(new_zmq_push_socket,ZMQ_SNDHWM,3,4) rc = f77_zmq_setsockopt(new_zmq_push_socket,ZMQ_SNDHWM,5,4)
if (rc /= 0) then if (rc /= 0) then
stop 'Unable to set ZMQ_SNDHWM on push socket' stop 'Unable to set ZMQ_SNDHWM on push socket'
endif endif