mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 18:16:12 +01:00
selection_slave does parallel davidson - unstable on fast iterations
This commit is contained in:
parent
c5ad63ac0f
commit
1b63438d68
@ -32,7 +32,7 @@ OPENMP : 1 ; Append OpenMP flags
|
|||||||
#
|
#
|
||||||
[OPT]
|
[OPT]
|
||||||
FC : -traceback
|
FC : -traceback
|
||||||
FCFLAGS : -xHost -O2 -ip -ftz -g
|
FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g
|
||||||
|
|
||||||
# Profiling flags
|
# Profiling flags
|
||||||
#################
|
#################
|
||||||
|
@ -28,26 +28,37 @@ subroutine run_wf
|
|||||||
call provide_everything
|
call provide_everything
|
||||||
|
|
||||||
zmq_context = f77_zmq_ctx_new ()
|
zmq_context = f77_zmq_ctx_new ()
|
||||||
zmq_state = 'selection'
|
|
||||||
state = 'Waiting'
|
state = 'Waiting'
|
||||||
|
|
||||||
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_state(zmq_state,state)
|
call wait_for_next_state(state)
|
||||||
if(trim(state) /= 'selection') exit
|
print *, "STATE ", trim(state)
|
||||||
print *, 'Getting wave function'
|
if(trim(state) == "Stopped") exit
|
||||||
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states_diag)
|
if(trim(state) == 'selection') then
|
||||||
|
zmq_state = 'selection'
|
||||||
|
print *, 'Getting wave function'
|
||||||
|
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states_diag)
|
||||||
|
|
||||||
|
|
||||||
integer :: rc, i
|
integer :: rc, i
|
||||||
|
|
||||||
print *, 'Selection slave running'
|
print *, 'Selection slave running'
|
||||||
|
|
||||||
!$OMP PARALLEL PRIVATE(i)
|
!$OMP PARALLEL PRIVATE(i)
|
||||||
i = omp_get_thread_num()
|
i = omp_get_thread_num()
|
||||||
call selection_dressing_slave_tcp(i, energy)
|
call selection_dressing_slave_tcp(i, energy)
|
||||||
!$OMP END PARALLEL
|
!$OMP END PARALLEL
|
||||||
|
else if(trim(state) == "davidson") then
|
||||||
|
zmq_state = 'davidson'
|
||||||
|
call davidson_miniserver_get()
|
||||||
|
print *, "Davidson slave running"
|
||||||
|
!$OMP PARALLEL PRIVATE(i)
|
||||||
|
i = omp_get_thread_num()
|
||||||
|
call davidson_slave_tcp(i)
|
||||||
|
!$OMP END PARALLEL
|
||||||
|
end if
|
||||||
end do
|
end do
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -854,6 +854,31 @@ subroutine zmq_delete_task(zmq_to_qp_run_socket,zmq_socket_pull,task_id,more)
|
|||||||
endif
|
endif
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
subroutine wait_for_next_state(state)
|
||||||
|
use f77_zmq
|
||||||
|
implicit none
|
||||||
|
|
||||||
|
character*(64), intent(out) :: state
|
||||||
|
integer(ZMQ_PTR) :: zmq_socket_sub
|
||||||
|
integer(ZMQ_PTR), external :: new_zmq_sub_socket
|
||||||
|
integer :: rc
|
||||||
|
|
||||||
|
zmq_socket_sub = new_zmq_sub_socket()
|
||||||
|
state = 'Waiting'
|
||||||
|
do while(state == "Waiting")
|
||||||
|
rc = f77_zmq_recv( zmq_socket_sub, state, 64, 0)
|
||||||
|
if (rc > 0) then
|
||||||
|
state = trim(state(1:rc))
|
||||||
|
else
|
||||||
|
print *, 'Timeout reached. Stopping'
|
||||||
|
state = "Stopped"
|
||||||
|
end if
|
||||||
|
end do
|
||||||
|
call end_zmq_sub_socket(zmq_socket_sub)
|
||||||
|
end subroutine
|
||||||
|
|
||||||
|
|
||||||
subroutine wait_for_state(state_wait,state)
|
subroutine wait_for_state(state_wait,state)
|
||||||
use f77_zmq
|
use f77_zmq
|
||||||
implicit none
|
implicit none
|
||||||
|
Loading…
Reference in New Issue
Block a user