mirror of
https://github.com/LCPQ/quantum_package
synced 2024-11-04 05:03:54 +01:00
Merge branch 'master' of github.com:scemama/quantum_package
This commit is contained in:
commit
fe0e5ae764
21
configure
vendored
21
configure
vendored
@ -2,7 +2,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""configure
|
||||
|
||||
Usage: configure <config_file> (--production | --development)
|
||||
Usage: configure <config_file>
|
||||
|
||||
|
||||
Options:
|
||||
@ -10,18 +10,10 @@ Options:
|
||||
config_file A config file with all the information for compiling.
|
||||
Example config_files are given in config/
|
||||
|
||||
--production You can only compile **all** the modules with this flag,
|
||||
but it will compile lighting fast.
|
||||
|
||||
--development this will create a build.ninja for each directory which
|
||||
contains a binary. In a second step you may compile them
|
||||
individually if you like.
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
./configure config/gfortran.cfg --production
|
||||
./configure config/ifort.cfg --development
|
||||
./configure config/gfortran.cfg
|
||||
./configure config/ifort.cfg
|
||||
|
||||
|
||||
"""
|
||||
@ -34,10 +26,7 @@ import sys
|
||||
|
||||
from os.path import join
|
||||
|
||||
if not any(i in ["--production", "--development"] for i in sys.argv):
|
||||
sys.argv += ["--development"]
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
if len(sys.argv) != 2:
|
||||
print __doc__
|
||||
sys.exit()
|
||||
|
||||
@ -528,7 +517,7 @@ def create_ninja_and_rc(l_installed):
|
||||
qp_create_ninja = os.path.join(QP_ROOT, "scripts", "compilation",
|
||||
"qp_create_ninja.py")
|
||||
|
||||
l = [qp_create_ninja, "create"] + sys.argv[1:]
|
||||
l = [qp_create_ninja, "create", "--development"] + sys.argv[1:]
|
||||
|
||||
try:
|
||||
with open('/dev/null', 'w') as dnull:
|
||||
|
@ -1,11 +1,12 @@
|
||||
program selection_slave
|
||||
program prog_selection_slave
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Helper program to compute the PT2 in distributed mode.
|
||||
END_DOC
|
||||
|
||||
read_wf = .False.
|
||||
SOFT_TOUCH read_wf
|
||||
distributed_davidson = .False.
|
||||
SOFT_TOUCH read_wf distributed_davidson
|
||||
call provide_everything
|
||||
call switch_qp_run_to_master
|
||||
call run_wf
|
||||
@ -23,19 +24,21 @@ subroutine run_wf
|
||||
integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket
|
||||
integer(ZMQ_PTR) :: zmq_to_qp_run_socket
|
||||
double precision :: energy(N_states)
|
||||
character*(64) :: states(1)
|
||||
character*(64) :: states(4)
|
||||
integer :: rc, i
|
||||
|
||||
call provide_everything
|
||||
|
||||
zmq_context = f77_zmq_ctx_new ()
|
||||
states(1) = 'selection'
|
||||
states(2) = 'davidson'
|
||||
states(3) = 'pt2'
|
||||
|
||||
zmq_to_qp_run_socket = new_zmq_to_qp_run_socket()
|
||||
|
||||
do
|
||||
|
||||
call wait_for_states(states,zmq_state,1)
|
||||
call wait_for_states(states,zmq_state,4)
|
||||
|
||||
if(trim(zmq_state) == 'Stopped') then
|
||||
|
||||
@ -51,43 +54,40 @@ subroutine run_wf
|
||||
|
||||
!$OMP PARALLEL PRIVATE(i)
|
||||
i = omp_get_thread_num()
|
||||
call selection_slave_tcp(i, energy)
|
||||
call run_selection_slave(0, i, energy)
|
||||
!$OMP END PARALLEL
|
||||
print *, 'Selection done'
|
||||
|
||||
endif
|
||||
else if (trim(zmq_state) == 'davidson') then
|
||||
|
||||
end do
|
||||
end
|
||||
! Davidson
|
||||
! --------
|
||||
|
||||
subroutine update_energy(energy)
|
||||
implicit none
|
||||
double precision, intent(in) :: energy(N_states)
|
||||
BEGIN_DOC
|
||||
! Update energy when it is received from ZMQ
|
||||
END_DOC
|
||||
integer :: j,k
|
||||
do j=1,N_states
|
||||
do k=1,N_det
|
||||
CI_eigenvectors(k,j) = psi_coef(k,j)
|
||||
enddo
|
||||
enddo
|
||||
call u_0_S2_u_0(CI_eigenvectors_s2,CI_eigenvectors,N_det,psi_det,N_int)
|
||||
if (.True.) then
|
||||
do k=1,N_states
|
||||
ci_electronic_energy(k) = energy(k)
|
||||
enddo
|
||||
TOUCH ci_electronic_energy CI_eigenvectors_s2 CI_eigenvectors
|
||||
endif
|
||||
print *, 'Davidson'
|
||||
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states)
|
||||
call omp_set_nested(.True.)
|
||||
call davidson_slave_tcp(0)
|
||||
call omp_set_nested(.False.)
|
||||
print *, 'Davidson done'
|
||||
|
||||
call write_double(6,ci_energy,'Energy')
|
||||
end
|
||||
else if (trim(zmq_state) == 'pt2') then
|
||||
|
||||
subroutine selection_slave_tcp(i,energy)
|
||||
implicit none
|
||||
double precision, intent(in) :: energy(N_states)
|
||||
integer, intent(in) :: i
|
||||
! PT2
|
||||
! ---
|
||||
|
||||
print *, 'PT2'
|
||||
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states)
|
||||
|
||||
!$OMP PARALLEL PRIVATE(i)
|
||||
i = omp_get_thread_num()
|
||||
call run_selection_slave(0, i, energy)
|
||||
!$OMP END PARALLEL
|
||||
print *, 'PT2 done'
|
||||
|
||||
endif
|
||||
|
||||
end do
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
@ -5,7 +5,8 @@ program selection_slave
|
||||
END_DOC
|
||||
|
||||
read_wf = .False.
|
||||
SOFT_TOUCH read_wf
|
||||
distributed_davidson = .False.
|
||||
SOFT_TOUCH read_wf distributed_davidson
|
||||
call provide_everything
|
||||
call switch_qp_run_to_master
|
||||
call run_wf
|
||||
@ -23,19 +24,21 @@ subroutine run_wf
|
||||
integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket
|
||||
integer(ZMQ_PTR) :: zmq_to_qp_run_socket
|
||||
double precision :: energy(N_states)
|
||||
character*(64) :: states(1)
|
||||
character*(64) :: states(4)
|
||||
integer :: rc, i
|
||||
|
||||
call provide_everything
|
||||
|
||||
zmq_context = f77_zmq_ctx_new ()
|
||||
states(1) = 'selection'
|
||||
states(2) = 'davidson'
|
||||
states(3) = 'pt2'
|
||||
|
||||
zmq_to_qp_run_socket = new_zmq_to_qp_run_socket()
|
||||
|
||||
do
|
||||
|
||||
call wait_for_states(states,zmq_state,1)
|
||||
call wait_for_states(states,zmq_state,3)
|
||||
|
||||
if(trim(zmq_state) == 'Stopped') then
|
||||
|
||||
@ -51,21 +54,30 @@ subroutine run_wf
|
||||
|
||||
!$OMP PARALLEL PRIVATE(i)
|
||||
i = omp_get_thread_num()
|
||||
call selection_slave_tcp(i, energy)
|
||||
call run_selection_slave(0,i,energy)
|
||||
!$OMP END PARALLEL
|
||||
print *, 'Selection done'
|
||||
|
||||
else if (trim(zmq_state) == 'pt2') then
|
||||
|
||||
! PT2
|
||||
! ---
|
||||
|
||||
print *, 'PT2'
|
||||
call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states)
|
||||
|
||||
logical :: lstop
|
||||
lstop = .False.
|
||||
!$OMP PARALLEL PRIVATE(i)
|
||||
i = omp_get_thread_num()
|
||||
call run_pt2_slave(0,i,energy,lstop)
|
||||
!$OMP END PARALLEL
|
||||
print *, 'PT2 done'
|
||||
|
||||
endif
|
||||
|
||||
end do
|
||||
end
|
||||
|
||||
|
||||
subroutine selection_slave_tcp(i,energy)
|
||||
implicit none
|
||||
double precision, intent(in) :: energy(N_states)
|
||||
integer, intent(in) :: i
|
||||
|
||||
call run_selection_slave(0,i,energy)
|
||||
end
|
||||
|
||||
|
@ -14,9 +14,9 @@ BEGIN_PROVIDER [ integer, N_det_generators ]
|
||||
good = .True.
|
||||
do k=1,N_int
|
||||
good = good .and. ( &
|
||||
iand(not(cas_bitmask(k,1,l)), psi_det(k,1,i)) == &
|
||||
iand(not(cas_bitmask(k,1,l)), psi_det_sorted(k,1,i)) == &
|
||||
iand(not(cas_bitmask(k,1,l)), HF_bitmask(k,1)) ) .and. ( &
|
||||
iand(not(cas_bitmask(k,2,l)), psi_det(k,2,i)) == &
|
||||
iand(not(cas_bitmask(k,2,l)), psi_det_sorted(k,2,i)) == &
|
||||
iand(not(cas_bitmask(k,2,l)), HF_bitmask(k,2)) )
|
||||
enddo
|
||||
if (good) then
|
||||
@ -46,9 +46,9 @@ END_PROVIDER
|
||||
good = .True.
|
||||
do k=1,N_int
|
||||
good = good .and. ( &
|
||||
iand(not(cas_bitmask(k,1,l)), psi_det(k,1,i)) == &
|
||||
iand(not(cas_bitmask(k,1,l)), psi_det_sorted(k,1,i)) == &
|
||||
iand(not(cas_bitmask(k,1,l)), HF_bitmask(k,1)) .and. ( &
|
||||
iand(not(cas_bitmask(k,2,l)), psi_det(k,2,i)) == &
|
||||
iand(not(cas_bitmask(k,2,l)), psi_det_sorted(k,2,i)) == &
|
||||
iand(not(cas_bitmask(k,2,l)), HF_bitmask(k,2) )) )
|
||||
enddo
|
||||
if (good) then
|
||||
@ -58,8 +58,8 @@ END_PROVIDER
|
||||
if (good) then
|
||||
m = m+1
|
||||
do k=1,N_int
|
||||
psi_det_generators(k,1,m) = psi_det(k,1,i)
|
||||
psi_det_generators(k,2,m) = psi_det(k,2,i)
|
||||
psi_det_generators(k,1,m) = psi_det_sorted(k,1,i)
|
||||
psi_det_generators(k,2,m) = psi_det_sorted(k,2,i)
|
||||
enddo
|
||||
psi_coef_generators(m,:) = psi_coef(m,:)
|
||||
endif
|
||||
|
@ -61,7 +61,10 @@ END_PROVIDER
|
||||
endif
|
||||
enddo
|
||||
if (N_det /= m) then
|
||||
print *, N_det, m
|
||||
print *, 'N_det = ', N_det
|
||||
print *, 'm = ', m
|
||||
print *, 'N_det_generators = ', N_det_generators
|
||||
print *, 'psi_det_size = ', psi_det_size
|
||||
stop 'N_det /= m'
|
||||
endif
|
||||
END_PROVIDER
|
||||
|
@ -84,23 +84,24 @@ subroutine zmq_get_psi(zmq_to_qp_run_socket, worker_id, energy, size_energy)
|
||||
N_states = N_states_read
|
||||
N_det = N_det_read
|
||||
psi_det_size = psi_det_size_read
|
||||
TOUCH psi_det_size N_det N_states
|
||||
|
||||
rc = f77_zmq_recv(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)
|
||||
rc = f77_zmq_recv(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,0)
|
||||
if (rc /= N_int*2*N_det*bit_kind) then
|
||||
print *, 'f77_zmq_recv(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
rc = f77_zmq_recv(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,ZMQ_SNDMORE)
|
||||
rc = f77_zmq_recv(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,0)
|
||||
if (rc /= psi_det_size*N_states*8) then
|
||||
print *, '77_zmq_recv(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
TOUCH psi_det_size N_det N_states psi_det psi_coef
|
||||
TOUCH psi_det psi_coef
|
||||
|
||||
rc = f77_zmq_recv(zmq_to_qp_run_socket,energy,size_energy*8,0)
|
||||
if (rc /= size_energy*8) then
|
||||
print *, 'f77_zmq_recv(zmq_to_qp_run_socket,energy,size_energy*8,0)'
|
||||
print *, '77_zmq_recv(zmq_to_qp_run_socket,energy,size_energy*8,0)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
|
@ -9,25 +9,26 @@ subroutine zmq_put_psi(zmq_to_qp_run_socket,worker_id, energy, size_energy)
|
||||
integer, intent(in) :: size_energy
|
||||
double precision, intent(out) :: energy(size_energy)
|
||||
integer :: rc
|
||||
integer*8 :: rc8
|
||||
character*(256) :: msg
|
||||
|
||||
write(msg,*) 'put_psi ', worker_id, N_states, N_det, psi_det_size, n_det_generators, n_det_selectors
|
||||
|
||||
rc = f77_zmq_send(zmq_to_qp_run_socket,trim(msg),len(trim(msg)),ZMQ_SNDMORE)
|
||||
if (rc /= len(trim(msg))) then
|
||||
print *, 'f77_zmq_send(zmq_to_qp_run_socket,trim(msg),len(trim(msg)),ZMQ_SNDMORE)'
|
||||
rc8 = f77_zmq_send8(zmq_to_qp_run_socket,trim(msg),int(len(trim(msg)),8),ZMQ_SNDMORE)
|
||||
if (rc8 /= len(trim(msg))) then
|
||||
print *, 'f77_zmq_send8(zmq_to_qp_run_socket,trim(msg),len(trim(msg)),ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
rc = f77_zmq_send(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)
|
||||
if (rc /= N_int*2*N_det*bit_kind) then
|
||||
print *, 'f77_zmq_send(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)'
|
||||
rc8 = f77_zmq_send8(zmq_to_qp_run_socket,psi_det,int(N_int*2_8*N_det*bit_kind,8),ZMQ_SNDMORE)
|
||||
if (rc8 /= N_int*2_8*N_det*bit_kind) then
|
||||
print *, 'f77_zmq_send8(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
rc = f77_zmq_send(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,ZMQ_SNDMORE)
|
||||
if (rc /= psi_det_size*N_states*8) then
|
||||
print *, 'f77_zmq_send(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,ZMQ_SNDMORE)'
|
||||
rc8 = f77_zmq_send8(zmq_to_qp_run_socket,psi_coef,int(psi_det_size*N_states*8,8),ZMQ_SNDMORE)
|
||||
if (rc8 /= psi_det_size*N_states*8_8) then
|
||||
print *, 'f77_zmq_send8(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
@ -59,6 +60,7 @@ subroutine zmq_get_psi(zmq_to_qp_run_socket, worker_id, energy, size_energy)
|
||||
integer, intent(in) :: size_energy
|
||||
double precision, intent(out) :: energy(size_energy)
|
||||
integer :: rc
|
||||
integer*8 :: rc8
|
||||
character*(64) :: msg
|
||||
|
||||
write(msg,*) 'get_psi ', worker_id
|
||||
@ -86,15 +88,15 @@ subroutine zmq_get_psi(zmq_to_qp_run_socket, worker_id, energy, size_energy)
|
||||
psi_det_size = psi_det_size_read
|
||||
TOUCH psi_det_size N_det N_states
|
||||
|
||||
rc = f77_zmq_recv(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,0)
|
||||
if (rc /= N_int*2*N_det*bit_kind) then
|
||||
print *, 'f77_zmq_recv(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)'
|
||||
rc8 = f77_zmq_recv8(zmq_to_qp_run_socket,psi_det,int(N_int*2_8*N_det*bit_kind,8),0)
|
||||
if (rc8 /= N_int*2_8*N_det*bit_kind) then
|
||||
print *, 'f77_zmq_recv8(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
rc = f77_zmq_recv(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,0)
|
||||
if (rc /= psi_det_size*N_states*8) then
|
||||
print *, '77_zmq_recv(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,ZMQ_SNDMORE)'
|
||||
rc8 = f77_zmq_recv8(zmq_to_qp_run_socket,psi_coef,int(psi_det_size*N_states*8_8,8),0)
|
||||
if (rc8 /= psi_det_size*N_states*8_8) then
|
||||
print *, '77_zmq_recv8(zmq_to_qp_run_socket,psi_coef,psi_det_size*N_states*8,ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
TOUCH psi_det psi_coef
|
||||
|
@ -3,7 +3,7 @@
|
||||
convert output of gamess/GAU$$IAN to ezfio
|
||||
|
||||
Usage:
|
||||
qp_convert_output_to_ezfio.py <file.out> [--ezfio=<folder.ezfio>]
|
||||
qp_convert_output_to_ezfio.py <file.out> [--ezfio=<ezfio_directory>]
|
||||
|
||||
Option:
|
||||
file.out is the file to check (like gamess.out)
|
||||
@ -20,18 +20,17 @@ from functools import reduce
|
||||
# Add to the path #
|
||||
# ~#~#~#~#~#~#~#~ #
|
||||
|
||||
|
||||
try:
|
||||
QP_ROOT = os.environ["QP_ROOT"]
|
||||
except:
|
||||
print "Error: QP_ROOT environment variable not found."
|
||||
sys.exit(1)
|
||||
else:
|
||||
|
||||
sys.path = [ QP_ROOT + "/install/EZFIO/Python",
|
||||
QP_ROOT + "/resultsFile",
|
||||
QP_ROOT + "/scripts"] + sys.path
|
||||
|
||||
|
||||
# ~#~#~#~#~#~ #
|
||||
# I m p o r t #
|
||||
# ~#~#~#~#~#~ #
|
||||
@ -280,12 +279,13 @@ def write_ezfio(res, filename):
|
||||
# {% for coef,n,zeta for l_param}
|
||||
# {coef,n, zeta}
|
||||
|
||||
|
||||
# OUTPUT
|
||||
|
||||
# Local are 1 array padded by max(n_max_block) when l == 0 (output:k_loc_max)
|
||||
# v_k[n-2][atom] = value
|
||||
|
||||
#No Local are 2 array padded with max of lmax_block when l!=0 (output:lmax+1) and max(n_max_block)whem l !=0 (kmax)
|
||||
#Non Local are 2 array padded with max of lmax_block when l!=0 (output:lmax+1) and max(n_max_block)whem l !=0 (kmax)
|
||||
# v_kl[l][n-2][atom] = value
|
||||
|
||||
def pad(array, size, value=0):
|
||||
@ -309,8 +309,16 @@ def write_ezfio(res, filename):
|
||||
array_l_max_block.append(l_max_block)
|
||||
array_z_remove.append(z_remove)
|
||||
|
||||
matrix.append([[coef_n_zeta.split()[1:] for coef_n_zeta in l.split('\n')] for l in array_party[1:]])
|
||||
|
||||
x = [[coef_n_zeta.split() for coef_n_zeta in l.split('\n')] \
|
||||
for l in array_party[1:] ]
|
||||
x = []
|
||||
for l in array_party[1:]:
|
||||
y = []
|
||||
for coef_n_zeta in l.split('\n'):
|
||||
z = coef_n_zeta.split()
|
||||
if z : y.append(z)
|
||||
x.append(y)
|
||||
matrix.append(x)
|
||||
return (matrix, array_l_max_block, array_z_remove)
|
||||
|
||||
def get_local_stuff(matrix):
|
||||
@ -319,7 +327,6 @@ def write_ezfio(res, filename):
|
||||
k_loc_max = max(len(i) for i in matrix_local_unpad)
|
||||
|
||||
matrix_local = [ pad(ll, k_loc_max, [0., 2, 0.]) for ll in matrix_local_unpad]
|
||||
|
||||
m_coef = [[float(i[0]) for i in atom] for atom in matrix_local]
|
||||
m_n = [[int(i[1]) - 2 for i in atom] for atom in matrix_local]
|
||||
m_zeta = [[float(i[2]) for i in atom] for atom in matrix_local]
|
||||
@ -343,9 +350,21 @@ def write_ezfio(res, filename):
|
||||
return (l_max_block, k_max, m_coef_noloc, m_n_noloc, m_zeta_noloc)
|
||||
|
||||
try:
|
||||
pseudo_str = res_file.get_pseudo()
|
||||
matrix, array_l_max_block, array_z_remove = parse_str(pseudo_str)
|
||||
pseudo_str = []
|
||||
label = ezfio.get_nuclei_nucl_label()
|
||||
for ecp in res.pseudo:
|
||||
pseudo_str += [ "%(label)s GEN %(zcore)d %(lmax)d" % { "label": label[ ecp["atom"]-1 ],
|
||||
"zcore": ecp["zcore"], "lmax": ecp["lmax"] } ]
|
||||
lmax = ecp["lmax"]
|
||||
for l in [lmax] + list(range(0,lmax)):
|
||||
pseudo_str += [ "%d"%len(ecp[str(l)]) ]
|
||||
for t in ecp[str(l)]:
|
||||
pseudo_str += [ "%f %d %f"%t ]
|
||||
pseudo_str += [""]
|
||||
pseudo_str = "\n".join(pseudo_str)
|
||||
|
||||
matrix, array_l_max_block, array_z_remove = parse_str(pseudo_str)
|
||||
array_z_remove = map(float,array_z_remove)
|
||||
except:
|
||||
ezfio.set_pseudo_do_pseudo(False)
|
||||
else:
|
||||
@ -355,14 +374,18 @@ def write_ezfio(res, filename):
|
||||
# Z _ e f f , a l p h a / b e t a _ e l e c #
|
||||
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #
|
||||
|
||||
ezfio.pseudo_charge_remove = array_z_remove
|
||||
ezfio.nuclei_nucl_charge = [i - j for i, j in zip(ezfio.nuclei_nucl_charge, array_z_remove)]
|
||||
ezfio.set_pseudo_nucl_charge_remove(array_z_remove)
|
||||
charge = ezfio.get_nuclei_nucl_charge()
|
||||
charge = [ i - j for i, j in zip(charge, array_z_remove) ]
|
||||
ezfio.set_nuclei_nucl_charge (charge)
|
||||
|
||||
import math
|
||||
num_elec = sum(ezfio.nuclei_nucl_charge)
|
||||
num_elec_diff = sum(array_z_remove)/2
|
||||
nalpha = ezfio.get_electrons_elec_alpha_num() - num_elec_diff
|
||||
nbeta = ezfio.get_electrons_elec_beta_num() - num_elec_diff
|
||||
|
||||
ezfio.electrons_elec_alpha_num = int(math.ceil(num_elec / 2.))
|
||||
ezfio.electrons_elec_beta_num = int(math.floor(num_elec / 2.))
|
||||
ezfio.set_electrons_elec_alpha_num(nalpha)
|
||||
ezfio.set_electrons_elec_beta_num( nbeta )
|
||||
|
||||
# Change all the array 'cause EZFIO
|
||||
# v_kl (v, l) => v_kl(l,v)
|
||||
@ -421,3 +444,4 @@ if __name__ == '__main__':
|
||||
print file_, 'recognized as', str(res_file).split('.')[-1].split()[0]
|
||||
|
||||
write_ezfio(res_file, ezfio_file)
|
||||
os.system("qp_run save_ortho_mos "+ezfio_file)
|
||||
|
@ -317,32 +317,33 @@ subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze)
|
||||
|
||||
character*(512) :: task
|
||||
integer :: rc
|
||||
integer*8 :: rc8
|
||||
double precision :: energy(N_st)
|
||||
energy = 0.d0
|
||||
|
||||
task = ' '
|
||||
write(task,*) 'put_psi ', 1, N_st, N_det, N_det
|
||||
rc = f77_zmq_send(zmq_to_qp_run_socket,trim(task),len(trim(task)),ZMQ_SNDMORE)
|
||||
rc8 = f77_zmq_send8(zmq_to_qp_run_socket,trim(task),int(len(trim(task)),8),ZMQ_SNDMORE)
|
||||
if (rc /= len(trim(task))) then
|
||||
print *, 'f77_zmq_send(zmq_to_qp_run_socket,trim(task),len(trim(task)),ZMQ_SNDMORE)'
|
||||
print *, 'f77_zmq_send8(zmq_to_qp_run_socket,trim(task),int(len(trim(task)),8),ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
rc = f77_zmq_send(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)
|
||||
rc8 = f77_zmq_send8(zmq_to_qp_run_socket,psi_det,int(N_int*2*N_det*bit_kind,8),ZMQ_SNDMORE)
|
||||
if (rc /= N_int*2*N_det*bit_kind) then
|
||||
print *, 'f77_zmq_send(zmq_to_qp_run_socket,psi_det,N_int*2*N_det*bit_kind,ZMQ_SNDMORE)'
|
||||
print *, 'f77_zmq_send8(zmq_to_qp_run_socket,psi_det,int(N_int*2*N_det*bit_kind,8),ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
rc = f77_zmq_send(zmq_to_qp_run_socket,u_t,size(u_t)*8,ZMQ_SNDMORE)
|
||||
rc8 = f77_zmq_send8(zmq_to_qp_run_socket,u_t,int(size(u_t)*8,8),ZMQ_SNDMORE)
|
||||
if (rc /= size(u_t)*8) then
|
||||
print *, 'f77_zmq_send(zmq_to_qp_run_socket,u_t,size(u_t)*8,ZMQ_SNDMORE)'
|
||||
print *, 'f77_zmq_send8(zmq_to_qp_run_socket,u_t,int(size(u_t)*8,8),ZMQ_SNDMORE)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
rc = f77_zmq_send(zmq_to_qp_run_socket,energy,N_st*8,0)
|
||||
rc8 = f77_zmq_send8(zmq_to_qp_run_socket,energy,int(N_st*8,8),0)
|
||||
if (rc /= N_st*8) then
|
||||
print *, 'f77_zmq_send(zmq_to_qp_run_socket,energy,size_energy*8,0)'
|
||||
print *, 'f77_zmq_send8(zmq_to_qp_run_socket,energy,int(size_energy*8,8),0)'
|
||||
stop 'error'
|
||||
endif
|
||||
|
||||
@ -410,3 +411,18 @@ subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze)
|
||||
enddo
|
||||
end
|
||||
|
||||
|
||||
BEGIN_PROVIDER [ integer, nthreads_davidson ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Number of threads for Davdison
|
||||
END_DOC
|
||||
nthreads_davidson = nproc
|
||||
character*(32) :: env
|
||||
call getenv('NTHREADS_DAVIDSON',env)
|
||||
if (trim(env) /= '') then
|
||||
read(env,*) nthreads_davidson
|
||||
endif
|
||||
call write_int(6,nthreads_davidson,'Number of threads for Diagonalization')
|
||||
END_PROVIDER
|
||||
|
||||
|
@ -134,8 +134,8 @@ subroutine H_S2_u_0_nstates_openmp_work_$N_int(v_t,s_t,u_t,N_st,sze,istart,iend,
|
||||
! Prepare the array of all alpha single excitations
|
||||
! -------------------------------------------------
|
||||
|
||||
PROVIDE N_int
|
||||
!$OMP PARALLEL DEFAULT(NONE) &
|
||||
PROVIDE N_int nthreads_davidson
|
||||
!$OMP PARALLEL DEFAULT(NONE) NUM_THREADS(nthreads_davidson) &
|
||||
!$OMP SHARED(psi_bilinear_matrix_rows, N_det, &
|
||||
!$OMP psi_bilinear_matrix_columns, &
|
||||
!$OMP psi_det_alpha_unique, psi_det_beta_unique, &
|
||||
|
Loading…
Reference in New Issue
Block a user