mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-24 13:23:41 +01:00
simpler purge
This commit is contained in:
parent
168ca2f2e2
commit
6a7f04cb79
@ -406,7 +406,7 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2,
|
|||||||
time = omp_get_wtime()
|
time = omp_get_wtime()
|
||||||
print '(G10.3, 2X, F16.10, 2X, G16.3, 2X, F16.4, A20)', c, avg+E0+E(dress_stoch_istate), eqt, time-time0, ''
|
print '(G10.3, 2X, F16.10, 2X, G16.3, 2X, F16.4, A20)', c, avg+E0+E(dress_stoch_istate), eqt, time-time0, ''
|
||||||
m += 1
|
m += 1
|
||||||
if(eqt <= 1d0*relative_error) then
|
if(eqt <= 0d0*relative_error) then
|
||||||
found = .true.
|
found = .true.
|
||||||
end if
|
end if
|
||||||
else
|
else
|
||||||
@ -417,7 +417,8 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2,
|
|||||||
stop 'Unable to delete tasks'
|
stop 'Unable to delete tasks'
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
i= zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,1,more)
|
if(task_id /= 0) stop "TASKID"
|
||||||
|
!i= zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,1,more)
|
||||||
exit
|
exit
|
||||||
end if
|
end if
|
||||||
end do
|
end do
|
||||||
@ -439,6 +440,7 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2,
|
|||||||
|
|
||||||
do while(more /= 0)
|
do while(more /= 0)
|
||||||
call pull_dress_results(zmq_socket_pull, m_task, f, edI_task, edI_index, breve_delta_m, task_id, n_tasks)
|
call pull_dress_results(zmq_socket_pull, m_task, f, edI_task, edI_index, breve_delta_m, task_id, n_tasks)
|
||||||
|
if(task_id == 0) cycle
|
||||||
if(m_task == 0) then
|
if(m_task == 0) then
|
||||||
i = zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more)
|
i = zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more)
|
||||||
else
|
else
|
||||||
|
@ -31,7 +31,7 @@ subroutine run_dress_slave(thread,iproce,energy)
|
|||||||
integer, allocatable :: f(:)
|
integer, allocatable :: f(:)
|
||||||
integer :: cp_sent, cp_done
|
integer :: cp_sent, cp_done
|
||||||
integer :: cp_max(Nproc)
|
integer :: cp_max(Nproc)
|
||||||
integer :: will_send, task_id, purge_task_id(dress_N_cp+1)
|
integer :: will_send, task_id, purge_task_id
|
||||||
integer(kind=OMP_LOCK_KIND) :: lck_det(0:pt2_N_teeth+1)
|
integer(kind=OMP_LOCK_KIND) :: lck_det(0:pt2_N_teeth+1)
|
||||||
integer(kind=OMP_LOCK_KIND) :: lck_sto(0:dress_N_cp+1), sending
|
integer(kind=OMP_LOCK_KIND) :: lck_sto(0:dress_N_cp+1), sending
|
||||||
double precision :: fac
|
double precision :: fac
|
||||||
@ -103,8 +103,8 @@ subroutine run_dress_slave(thread,iproce,energy)
|
|||||||
will_send = cp_sent + 1
|
will_send = cp_sent + 1
|
||||||
cp_sent = will_send
|
cp_sent = will_send
|
||||||
end if
|
end if
|
||||||
if(purge_task_id(m) == 0) then
|
if(purge_task_id == 0) then
|
||||||
purge_task_id(m) = task_id
|
purge_task_id = task_id
|
||||||
task_id = 0
|
task_id = 0
|
||||||
end if
|
end if
|
||||||
!$OMP END CRITICAL
|
!$OMP END CRITICAL
|
||||||
@ -135,11 +135,8 @@ subroutine run_dress_slave(thread,iproce,energy)
|
|||||||
sum_f += f(i)
|
sum_f += f(i)
|
||||||
end if
|
end if
|
||||||
end do
|
end do
|
||||||
if(purge_task_id(will_send) /= 0) then
|
call push_dress_results(zmq_socket_push, will_send, sum_f, edI_task, edI_index, breve_delta_m, 0, n_tasks)
|
||||||
call push_dress_results(zmq_socket_push, will_send, sum_f, edI_task, edI_index, breve_delta_m, purge_task_id(will_send), n_tasks)
|
|
||||||
!call task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,purge_task_id(will_send))
|
!call task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,purge_task_id(will_send))
|
||||||
end if
|
|
||||||
purge_task_id(will_send) = 0
|
|
||||||
call omp_unset_lock(sending)
|
call omp_unset_lock(sending)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@ -185,12 +182,12 @@ subroutine run_dress_slave(thread,iproce,energy)
|
|||||||
end do
|
end do
|
||||||
!$OMP BARRIER
|
!$OMP BARRIER
|
||||||
!$OMP SINGLE
|
!$OMP SINGLE
|
||||||
do m=1,dress_N_cp
|
!do m=1,dress_N_cp
|
||||||
if(purge_task_id(m) /= 0) then
|
if(purge_task_id /= 0) then
|
||||||
!call task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,purge_task_id(m))
|
!call task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,purge_task_id(m))
|
||||||
call push_dress_results(zmq_socket_push, 0, 0, edI_task, edI_index, breve_delta_m, purge_task_id(m), 1)
|
call push_dress_results(zmq_socket_push, 0, 0, edI_task, edI_index, breve_delta_m, purge_task_id, 1)
|
||||||
end if
|
end if
|
||||||
end do
|
!end do
|
||||||
!$OMP END SINGLE
|
!$OMP END SINGLE
|
||||||
|
|
||||||
call disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id)
|
call disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user