mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 10:05:57 +01:00
MPI broadcast works
This commit is contained in:
parent
5469ba87ea
commit
e111130454
@ -6,7 +6,7 @@
|
||||
# --align=32 : Align all provided arrays on a 32-byte boundary
|
||||
#
|
||||
[COMMON]
|
||||
FC : mpif90
|
||||
FC : mpiifort
|
||||
LAPACK_LIB : -mkl=parallel
|
||||
IRPF90 : irpf90
|
||||
IRPF90_FLAGS : --ninja --align=32 -DMPI
|
||||
@ -51,13 +51,12 @@ FCFLAGS : -xSSE4.2 -O2 -ip -ftz
|
||||
#
|
||||
[DEBUG]
|
||||
FC : -g -traceback
|
||||
FCFLAGS : -xSSE2 -C -fpe0
|
||||
IRPF90_FLAGS : --openmp
|
||||
FCFLAGS : -xSSE2 -C -fpe0
|
||||
|
||||
# OpenMP flags
|
||||
#################
|
||||
#
|
||||
[OPENMP]
|
||||
FC : -openmp
|
||||
FC : -qopenmp
|
||||
IRPF90_FLAGS : --openmp
|
||||
|
||||
|
3
configure
vendored
3
configure
vendored
@ -525,11 +525,12 @@ def create_ninja_and_rc(l_installed):
|
||||
|
||||
try:
|
||||
with open('/dev/null', 'w') as dnull:
|
||||
subprocess.check_call(" ".join(l), shell=True,stderr=dnull)
|
||||
subprocess.check_call(" ".join(l), shell=True, stderr=dnull)
|
||||
except:
|
||||
print "[ FAIL ]"
|
||||
print "Check the validity of the config file provided ({0})".format(sys.argv[1])
|
||||
print "Exit..."
|
||||
raise
|
||||
sys.exit(1)
|
||||
|
||||
else:
|
||||
|
@ -90,32 +90,29 @@ program fci_zmq
|
||||
call write_double(6,correlation_energy_ratio, 'Correlation ratio')
|
||||
print *, ''
|
||||
|
||||
print *, ''
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=========================''))'
|
||||
write(*,fmt)
|
||||
write(fmt,*) '(12X,', N_states_p, '(6X,A5,1X,I6,8X))'
|
||||
write(*,fmt) ('State',k, k=1,N_states_p)
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=========================''))'
|
||||
write(*,fmt)
|
||||
write(fmt,*) '(A12,', N_states_p, '(1X,F12.8,13X))'
|
||||
write(*,fmt) '# E ', CI_energy(1:N_states_p)
|
||||
if (N_states_p > 1) then
|
||||
write(*,fmt) '# Excit. (au)', CI_energy(1:N_states_p)-CI_energy(1)
|
||||
write(*,fmt) '# Excit. (eV)', (CI_energy(1:N_states_p)-CI_energy(1))*27.211396641308d0
|
||||
endif
|
||||
write(fmt,*) '(A12,', 2*N_states_p, '(1X,F12.8))'
|
||||
write(*,fmt) '# PT2'//pt2_string, (pt2(k), error(k), k=1,N_states_p)
|
||||
write(*,'(A)') '#'
|
||||
write(*,fmt) '# E+PT2 ', (CI_energy(k)+pt2(k),error(k), k=1,N_states_p)
|
||||
if (N_states_p > 1) then
|
||||
write(*,fmt) '# Excit. (au)', ( (CI_energy(k)+pt2(k)-CI_energy(1)-pt2(1)), &
|
||||
dsqrt(error(k)*error(k)+error(1)*error(1)), k=1,N_states_p)
|
||||
write(*,fmt) '# Excit. (eV)', ( (CI_energy(k)+pt2(k)-CI_energy(1)-pt2(1))*27.211396641308d0, &
|
||||
dsqrt(error(k)*error(k)+error(1)*error(1))*27.211396641308d0, k=1,N_states_p)
|
||||
endif
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=========================''))'
|
||||
write(*,fmt)
|
||||
print *, ''
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))'
|
||||
write(*,fmt)
|
||||
write(fmt,*) '(12X,', N_states_p, '(6X,A7,1X,I6,10X))'
|
||||
write(*,fmt) ('State',k, k=1,N_states_p)
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))'
|
||||
write(*,fmt)
|
||||
write(fmt,*) '(A12,', N_states_p, '(1X,F14.8,15X))'
|
||||
write(*,fmt) '# E ', CI_energy(1:N_states_p)
|
||||
if (N_states_p > 1) then
|
||||
write(*,fmt) '# Excit. (au)', CI_energy(1:N_states_p)-CI_energy(1)
|
||||
write(*,fmt) '# Excit. (eV)', (CI_energy(1:N_states_p)-CI_energy(1))*27.211396641308d0
|
||||
endif
|
||||
write(fmt,*) '(A12,', 2*N_states_p, '(1X,F14.8))'
|
||||
write(*,fmt) '# PT2'//pt2_string, (pt2(k), error(k), k=1,N_states_p)
|
||||
write(*,'(A)') '#'
|
||||
write(*,fmt) '# E+PT2 ', (CI_energy(k)+pt2(k),error(k), k=1,N_states_p)
|
||||
if (N_states_p > 1) then
|
||||
write(*,fmt) '# Excit. (au)', ( (CI_energy(k)+pt2(k)-CI_energy(1)-pt2(1)), &
|
||||
dsqrt(error(k)*error(k)+error(1)*error(1)), k=1,N_states_p)
|
||||
write(*,fmt) '# Excit. (eV)', ( (CI_energy(k)+pt2(k)-CI_energy(1)-pt2(1))*27.211396641308d0, &
|
||||
dsqrt(error(k)*error(k)+error(1)*error(1))*27.211396641308d0, k=1,N_states_p)
|
||||
endif
|
||||
print *, ''
|
||||
|
||||
print *, 'N_det = ', N_det
|
||||
print *, 'N_states = ', N_states
|
||||
@ -207,19 +204,19 @@ program fci_zmq
|
||||
|
||||
N_states_p = min(N_det,N_states)
|
||||
print *, ''
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=========================''))'
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))'
|
||||
write(*,fmt)
|
||||
write(fmt,*) '(12X,', N_states_p, '(6X,A5,1X,I6,8X))'
|
||||
write(fmt,*) '(12X,', N_states_p, '(6X,A7,1X,I6,10X))'
|
||||
write(*,fmt) ('State',k, k=1,N_states_p)
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=========================''))'
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))'
|
||||
write(*,fmt)
|
||||
write(fmt,*) '(A12,', N_states_p, '(1X,F12.8,13X))'
|
||||
write(fmt,*) '(A12,', N_states_p, '(1X,F14.8,15X))'
|
||||
write(*,fmt) '# E ', CI_energy(1:N_states_p)
|
||||
if (N_states_p > 1) then
|
||||
write(*,fmt) '# Excit. (au)', CI_energy(1:N_states_p)-CI_energy(1)
|
||||
write(*,fmt) '# Excit. (eV)', (CI_energy(1:N_states_p)-CI_energy(1))*27.211396641308d0
|
||||
endif
|
||||
write(fmt,*) '(A12,', 2*N_states_p, '(1X,F12.8))'
|
||||
write(fmt,*) '(A12,', 2*N_states_p, '(1X,F14.8))'
|
||||
write(*,fmt) '# PT2'//pt2_string, (pt2(k), error(k), k=1,N_states_p)
|
||||
write(*,'(A)') '#'
|
||||
write(*,fmt) '# E+PT2 ', (CI_energy(k)+pt2(k),error(k), k=1,N_states_p)
|
||||
@ -229,7 +226,7 @@ program fci_zmq
|
||||
write(*,fmt) '# Excit. (eV)', ( (CI_energy(k)+pt2(k)-CI_energy(1)-pt2(1))*27.211396641308d0, &
|
||||
dsqrt(error(k)*error(k)+error(1)*error(1))*27.211396641308d0, k=1,N_states_p)
|
||||
endif
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=========================''))'
|
||||
write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))'
|
||||
write(*,fmt)
|
||||
print *, ''
|
||||
|
||||
|
@ -13,6 +13,7 @@ program selection_slave
|
||||
end
|
||||
|
||||
subroutine provide_everything
|
||||
PROVIDE mpi_master
|
||||
PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context
|
||||
PROVIDE pt2_e0_denominator mo_tot_num N_int fragment_count
|
||||
end
|
||||
@ -100,6 +101,9 @@ subroutine run_wf
|
||||
endif
|
||||
|
||||
end do
|
||||
IRP_IF MPI
|
||||
call MPI_finalize(i)
|
||||
IRP_ENDIF
|
||||
end
|
||||
|
||||
|
||||
|
@ -1,3 +1,23 @@
|
||||
BEGIN_PROVIDER [ integer, mpi_bit_kind ]
|
||||
use bitmasks
|
||||
include 'mpif.h'
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! MPI bit kind type
|
||||
END_DOC
|
||||
IRP_IF MPI
|
||||
if (bit_kind == 4) then
|
||||
mpi_bit_kind = MPI_INTEGER4
|
||||
else if (bit_kind == 8) then
|
||||
mpi_bit_kind = MPI_INTEGER8
|
||||
else
|
||||
stop 'Wrong bit kind in mpi_bit_kind'
|
||||
endif
|
||||
IRP_ELSE
|
||||
mpi_bit_kind = -1
|
||||
IRP_ENDIF
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ logical, mpi_initialized ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
@ -32,12 +52,14 @@ END_PROVIDER
|
||||
print *, 'ierr = ', ierr
|
||||
stop 'Unable to get MPI rank'
|
||||
endif
|
||||
call write_int(6,mpi_rank,'MPI rank')
|
||||
|
||||
call MPI_COMM_SIZE (MPI_COMM_WORLD, mpi_size, ierr)
|
||||
if (ierr /= 0) then
|
||||
print *, 'ierr = ', ierr
|
||||
stop 'Unable to get MPI size'
|
||||
endif
|
||||
call write_int(6,mpi_size,'MPI size')
|
||||
|
||||
IRP_ELSE
|
||||
mpi_rank = 0
|
||||
|
@ -25,6 +25,7 @@ except ImportError:
|
||||
"quantum_package.rc"))
|
||||
|
||||
print "\n".join(["", "Error:", "source %s" % f, ""])
|
||||
raise
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
@ -825,6 +826,7 @@ if __name__ == "__main__":
|
||||
arguments = pickle.load(handle)
|
||||
except IOError:
|
||||
print "You need to create first my friend"
|
||||
raise
|
||||
sys.exit(1)
|
||||
|
||||
elif arguments["create"]:
|
||||
@ -927,6 +929,7 @@ if __name__ == "__main__":
|
||||
"- Or install a module that needs {0} with a main "]
|
||||
|
||||
print "\n".join(l_msg).format(module.rel)
|
||||
raise
|
||||
sys.exit(1)
|
||||
|
||||
# ~#~#~#~#~#~#~#~#~#~#~#~ #
|
||||
|
@ -2,7 +2,6 @@ module bitmasks
|
||||
integer, parameter :: bit_kind_shift = 6 ! 5: 32 bits, 6: 64 bits
|
||||
integer, parameter :: bit_kind_size = 64
|
||||
integer, parameter :: bit_kind = 8
|
||||
integer, parameter :: mpi_bit_kind = 8
|
||||
integer, parameter :: d_hole1 = 1
|
||||
integer, parameter :: d_part1 = 2
|
||||
integer, parameter :: d_hole2 = 3
|
||||
|
@ -132,7 +132,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_
|
||||
+ 4.d0*(N_st_diag*itermax)+nproc*(4.d0*N_det_alpha_unique+2.d0*N_st_diag*sze)))/(1024.d0**3)
|
||||
call write_double(iunit, r1, 'Memory(Gb)')
|
||||
write(iunit,'(A)') ''
|
||||
write_buffer = '===='
|
||||
write_buffer = '====='
|
||||
do i=1,N_st
|
||||
write_buffer = trim(write_buffer)//' ================ =========== ==========='
|
||||
enddo
|
||||
@ -142,7 +142,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_
|
||||
write_buffer = trim(write_buffer)//' Energy S^2 Residual '
|
||||
enddo
|
||||
write(iunit,'(A)') write_buffer(1:6+41*N_states)
|
||||
write_buffer = '===='
|
||||
write_buffer = '====='
|
||||
do i=1,N_st
|
||||
write_buffer = trim(write_buffer)//' ================ =========== ==========='
|
||||
enddo
|
||||
@ -426,7 +426,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_
|
||||
energies(k) = lambda(k)
|
||||
s2_out(k) = s2(k)
|
||||
enddo
|
||||
write_buffer = '===== '
|
||||
write_buffer = '======'
|
||||
do i=1,N_st
|
||||
write_buffer = trim(write_buffer)//' ================ =========== ==========='
|
||||
enddo
|
||||
|
Loading…
Reference in New Issue
Block a user