10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-03 09:55: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]
FC : -traceback
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g
FCFLAGS : -xAVX -O2 -ip -ftz -g
# Profiling flags
#################

4
configure vendored
View File

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

View File

@ -208,7 +208,7 @@ let end_job msg program_state rep_socket pair_socket =
address_tcp = None;
address_inproc = None;
running = true;
accepting_clients = false;
accepting_clients = false;
data = StringHashtbl.create ();
}
@ -625,7 +625,7 @@ let get_data msg program_state rep_socket =
let value =
match StringHashtbl.find program_state.data key with
| Some value -> value
| None -> "\0"
| None -> "\000"
in
Message.GetDataReply (Message.GetDataReply_msg.create ~value)
|> Message.to_string_list

View File

@ -27,7 +27,6 @@ subroutine run
threshold_generators = 1.d0
relative_error = 1.d-3
absolute_error = 1.d-5
call ZMQ_pt2(E_CI_before, pt2, relative_error, absolute_error, eqt)
print *, 'Final step'
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
endif
!if(Nabove(1) < 5d0) cycle
E0 = sum(pt2_detail(pt2_stoch_istate,:first_det_of_teeth(tooth)-1))
if (tooth <= comb_teeth) then
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
endif
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
pt2(pt2_stoch_istate) = avg
error(pt2_stoch_istate) = eqt
@ -361,14 +359,13 @@ subroutine pt2_collector(zmq_socket_pull, E, b, tbc, comb, Ncomb, computed, pt2_
endif
else
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, ''
Nabove_old = Nabove(tooth)
endif
endif
end if
end do pullLoop
!<<<<<<< HEAD
if(tooth == comb_teeth+1) then
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, 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
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))
@ -67,23 +61,24 @@ subroutine run_pt2_slave(thread,iproc,energy)
read (task(k),*) subset(k), i_generator(k)
enddo
double precision :: time0, time1
call wall_time(time0)
! double precision :: time0, time1
! call wall_time(time0)
do k=1,n_tasks
pt2(:,k) = 0.d0
buf%cur = 0
call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k))
enddo
call wall_time(time1)
! call wall_time(time1)
!
integer, external :: tasks_done_to_taskserver
if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then
done = .true.
endif
call push_pt2_results(zmq_socket_push, i_generator, pt2, task_id, n_tasks)
! 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
! ! 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 = n_tasks+1
end do
integer, external :: disconnect_from_taskserver

View File

@ -97,8 +97,9 @@ subroutine run_selection_slave_new(thread,iproc,energy)
pt2(:,:) = 0d0
buf%cur = 0
! 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
! ! 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 = n_tasks+1
end do
integer, external :: disconnect_from_taskserver

View File

@ -60,7 +60,8 @@ subroutine ZMQ_selection(N_in, pt2)
task = ' '
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
ipos += 30
if (ipos > 63970) then
@ -69,18 +70,18 @@ subroutine ZMQ_selection(N_in, pt2)
endif
ipos=1
endif
else
do j=1,fragment_count
write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') j, i, N
ipos += 30
if (ipos > 63970) 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'
endif
ipos=1
endif
end do
endif
! else
! do j=1,fragment_count
! write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') j, i, N
! ipos += 30
! if (ipos > 63970) 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'
! endif
! ipos=1
! endif
! end do
! endif
enddo
if (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
do i=1,N_det
norm = norm + psi_average_norm_contrib_sorted(i)
if (norm > threshold_generators+1d-15) then
if (norm >= threshold_generators) then
N_det_generators = i
exit
endif
@ -47,9 +47,7 @@ END_PROVIDER
integer :: i, k
psi_det_sorted_gen = psi_det_sorted
psi_coef_sorted_gen = psi_coef_sorted
!do i=1,N_det_generators
psi_det_sorted_gen_order = psi_det_sorted_order
!end do
psi_det_sorted_gen_order = psi_det_sorted_order
END_PROVIDER

View File

@ -28,7 +28,7 @@ subroutine run_wf
double precision :: energy(N_states_diag)
character*(64) :: states(1)
integer :: rc, i
integer, external :: zmq_get_dvector, zmq_get_N_det_generators
integer, external :: zmq_get_dvector, zmq_get_N_det_generators
integer, external :: zmq_get_psi, zmq_get_N_det_selectors
integer, external :: zmq_get_N_states_diag
double precision :: tmp

View File

@ -194,7 +194,6 @@ subroutine copy_H_apply_buffer_to_wf
! logical :: found_duplicates
! call remove_duplicates_in_psi_det(found_duplicates)
end
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
do sh=1,shortcut(0,1)
!$OMP DO
!$OMP DO SCHEDULE(static,1)
do sh2=sh,shortcut(0,1)
exa = 0
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_ortho_canonical_num)
else
double precision, allocatable :: S(:,:)
@ -134,13 +135,6 @@ END_PROVIDER
S, size(S,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)
endif
END_PROVIDER

View File

@ -323,7 +323,7 @@ IRP_ENDIF
stop 'Unable to set ZMQ_LINGER on push socket'
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
stop 'Unable to set ZMQ_SNDHWM on push socket'
endif