mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-21 11:03:29 +01:00
Optimized get_all_spin_doubles_1
This commit is contained in:
parent
882d8ee350
commit
697fbddde6
@ -438,7 +438,7 @@ subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze)
|
|||||||
ipos=1
|
ipos=1
|
||||||
do imin=1,N_det,tasksize
|
do imin=1,N_det,tasksize
|
||||||
imax = min(N_det,imin-1+tasksize)
|
imax = min(N_det,imin-1+tasksize)
|
||||||
if (imin==1) then
|
if (imin<=N_det/2) then
|
||||||
istep = 2
|
istep = 2
|
||||||
else
|
else
|
||||||
istep = 1
|
istep = 1
|
||||||
@ -505,7 +505,9 @@ subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze)
|
|||||||
print *, irp_here, ': Failed in zmq_set_running'
|
print *, irp_here, ': Failed in zmq_set_running'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call omp_set_max_active_levels(4)
|
|
||||||
|
call omp_set_max_active_levels(5)
|
||||||
|
|
||||||
!$OMP PARALLEL DEFAULT(shared) NUM_THREADS(2) PRIVATE(ithread)
|
!$OMP PARALLEL DEFAULT(shared) NUM_THREADS(2) PRIVATE(ithread)
|
||||||
ithread = omp_get_thread_num()
|
ithread = omp_get_thread_num()
|
||||||
if (ithread == 0 ) then
|
if (ithread == 0 ) then
|
||||||
|
@ -1075,19 +1075,17 @@ subroutine get_all_spin_singles_and_doubles_1(buffer, idx, spindet, size_buffer,
|
|||||||
integer :: i
|
integer :: i
|
||||||
include 'utils/constants.include.F'
|
include 'utils/constants.include.F'
|
||||||
integer :: degree
|
integer :: degree
|
||||||
|
integer :: add_double(0:64) = (/ 0, 0, 0, 0, 1, (0, i=1,60) /)
|
||||||
|
integer :: add_single(0:64) = (/ 0, 0, 1, 0, 0, (0, i=1,60) /)
|
||||||
|
|
||||||
n_singles = 1
|
n_singles = 1
|
||||||
n_doubles = 1
|
n_doubles = 1
|
||||||
do i=1,size_buffer
|
do i=1,size_buffer
|
||||||
degree = popcnt( xor( spindet, buffer(i) ) )
|
degree = popcnt( xor( spindet, buffer(i) ) )
|
||||||
if ( degree == 4 ) then
|
doubles(n_doubles) = idx(i)
|
||||||
doubles(n_doubles) = idx(i)
|
singles(n_singles) = idx(i)
|
||||||
n_doubles = n_doubles+1
|
n_doubles = n_doubles+add_double(degree)
|
||||||
else if ( degree == 2 ) then
|
n_singles = n_singles+add_single(degree)
|
||||||
singles(n_singles) = idx(i)
|
|
||||||
n_singles = n_singles+1
|
|
||||||
endif
|
|
||||||
enddo
|
enddo
|
||||||
n_singles = n_singles-1
|
n_singles = n_singles-1
|
||||||
n_doubles = n_doubles-1
|
n_doubles = n_doubles-1
|
||||||
@ -1113,15 +1111,14 @@ subroutine get_all_spin_singles_1(buffer, idx, spindet, size_buffer, singles, n_
|
|||||||
integer :: i
|
integer :: i
|
||||||
integer(bit_kind) :: v
|
integer(bit_kind) :: v
|
||||||
integer :: degree
|
integer :: degree
|
||||||
|
integer :: add_single(0:64) = (/ 0, 0, 1, 0, 0, (0, i=1,60) /)
|
||||||
include 'utils/constants.include.F'
|
include 'utils/constants.include.F'
|
||||||
|
|
||||||
n_singles = 1
|
n_singles = 1
|
||||||
do i=1,size_buffer
|
do i=1,size_buffer
|
||||||
degree = popcnt(xor( spindet, buffer(i) ))
|
degree = popcnt(xor( spindet, buffer(i) ))
|
||||||
if (degree == 2) then
|
singles(n_singles) = idx(i)
|
||||||
singles(n_singles) = idx(i)
|
n_singles = n_singles+add_single(degree)
|
||||||
n_singles = n_singles+1
|
|
||||||
endif
|
|
||||||
enddo
|
enddo
|
||||||
n_singles = n_singles-1
|
n_singles = n_singles-1
|
||||||
|
|
||||||
@ -1145,14 +1142,13 @@ subroutine get_all_spin_doubles_1(buffer, idx, spindet, size_buffer, doubles, n_
|
|||||||
integer :: i
|
integer :: i
|
||||||
include 'utils/constants.include.F'
|
include 'utils/constants.include.F'
|
||||||
integer :: degree
|
integer :: degree
|
||||||
|
integer :: add_double(0:64) = (/ 0, 0, 0, 0, 1, (0, i=1,60) /)
|
||||||
|
|
||||||
n_doubles = 1
|
n_doubles = 1
|
||||||
do i=1,size_buffer
|
do i=1,size_buffer
|
||||||
degree = popcnt(xor( spindet, buffer(i) ))
|
degree = popcnt(xor( spindet, buffer(i) ))
|
||||||
if ( degree == 4 ) then
|
doubles(n_doubles) = idx(i)
|
||||||
doubles(n_doubles) = idx(i)
|
n_doubles = n_doubles+add_double(degree)
|
||||||
n_doubles = n_doubles+1
|
|
||||||
endif
|
|
||||||
enddo
|
enddo
|
||||||
n_doubles = n_doubles-1
|
n_doubles = n_doubles-1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user