From 83ecf1ee2eb2f469563c6248fd7150aa57743320 Mon Sep 17 00:00:00 2001 From: Kevin Gasperich Date: Mon, 22 Jun 2020 10:51:33 -0500 Subject: [PATCH] modifications for kpts {ao,mo}_num_per_kpt were being set as floats in python now imported explicitly as ints no default (could maybe fix with // ?) --- src/ao_basis/EZFIO.cfg | 5 +-- src/ao_basis/aos_cplx.irp.f | 14 +++---- src/determinants/density_matrix_cplx.irp.f | 4 +- src/mo_basis/EZFIO.cfg | 1 - src/mo_basis/mos.irp.f | 41 +++++++++++++++++++ src/mo_basis/mos_cplx.irp.f | 14 +++---- .../create_ezfio_complex_3idx.py | 2 + 7 files changed, 61 insertions(+), 20 deletions(-) diff --git a/src/ao_basis/EZFIO.cfg b/src/ao_basis/EZFIO.cfg index 5f7e3bf7..2d9dd2fb 100644 --- a/src/ao_basis/EZFIO.cfg +++ b/src/ao_basis/EZFIO.cfg @@ -69,7 +69,6 @@ default: true [ao_num_per_kpt] type: integer -doc: Number of |AOs| per kpt -default: =(ao_basis.ao_num/nuclei.kpt_num) -interface: ezfio +doc: Max number of |AOs| per kpt +interface: ezfio, provider diff --git a/src/ao_basis/aos_cplx.irp.f b/src/ao_basis/aos_cplx.irp.f index afec0548..f571b28d 100644 --- a/src/ao_basis/aos_cplx.irp.f +++ b/src/ao_basis/aos_cplx.irp.f @@ -1,7 +1,7 @@ -BEGIN_PROVIDER [ integer, ao_num_per_kpt ] - implicit none - BEGIN_DOC - ! number of aos per kpt. - END_DOC - ao_num_per_kpt = ao_num/kpt_num -END_PROVIDER +!BEGIN_PROVIDER [ integer, ao_num_per_kpt ] +! implicit none +! BEGIN_DOC +! ! number of aos per kpt. +! END_DOC +! ao_num_per_kpt = ao_num/kpt_num +!END_PROVIDER diff --git a/src/determinants/density_matrix_cplx.irp.f b/src/determinants/density_matrix_cplx.irp.f index d7281e76..882b73ee 100644 --- a/src/determinants/density_matrix_cplx.irp.f +++ b/src/determinants/density_matrix_cplx.irp.f @@ -441,8 +441,8 @@ END_PROVIDER !$OMP PRIVATE(j,k,k_a,k_b,l,m,occ,ck, cl, ckl,phase,h1,h2,p1,p2,s1,s2, degree,exc,& !$OMP tmp_a, tmp_b, n_occ, krow, kcol, lrow, lcol, tmp_det, tmp_det2,ih1,ip1,kh1,kp1,kk,& !$OMP tmp_det_kpts,k_shft,ii)& - !$OMP SHARED(psi_det,psi_coef_complex,N_int,N_states,elec_alpha_num_kpts, & - !$OMP elec_beta_num_kpts,one_e_dm_mo_alpha_kpts,one_e_dm_mo_beta_kpts,N_det,& + !$OMP SHARED(psi_det,psi_coef_complex,N_int,N_states, & + !$OMP one_e_dm_mo_alpha_kpts,one_e_dm_mo_beta_kpts,N_det,& !$OMP mo_num_per_kpt,psi_bilinear_matrix_rows,psi_bilinear_matrix_columns,& !$OMP psi_bilinear_matrix_transp_rows, psi_bilinear_matrix_transp_columns,& !$OMP psi_bilinear_matrix_order_reverse, psi_det_alpha_unique, psi_det_beta_unique,& diff --git a/src/mo_basis/EZFIO.cfg b/src/mo_basis/EZFIO.cfg index 76ee15e9..762eb268 100644 --- a/src/mo_basis/EZFIO.cfg +++ b/src/mo_basis/EZFIO.cfg @@ -52,6 +52,5 @@ interface: ezfio [mo_num_per_kpt] type: integer doc: Number of |MOs| per kpt -default: =(mo_basis.mo_num/nuclei.kpt_num) interface: ezfio diff --git a/src/mo_basis/mos.irp.f b/src/mo_basis/mos.irp.f index d8ff9cde..440d1703 100644 --- a/src/mo_basis/mos.irp.f +++ b/src/mo_basis/mos.irp.f @@ -39,6 +39,47 @@ BEGIN_PROVIDER [ integer, mo_num ] END_PROVIDER +BEGIN_PROVIDER [ integer, mo_num_per_kpt ] + implicit none + BEGIN_DOC + ! Number of MOs per kpt + END_DOC + + logical :: has + PROVIDE ezfio_filename + if (mpi_master) then + call ezfio_has_mo_basis_mo_num_per_kpt(has) + endif + IRP_IF MPI_DEBUG + print *, irp_here, mpi_rank + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + IRP_ENDIF + IRP_IF MPI + include 'mpif.h' + integer :: ierr + call MPI_BCAST( has, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + stop 'Unable to read mo_num_per_kpt with MPI' + endif + IRP_ENDIF + if (.not.has) then + mo_num_per_kpt = ao_ortho_canonical_num_per_kpt_max + else + if (mpi_master) then + call ezfio_get_mo_basis_mo_num_per_kpt(mo_num_per_kpt) + endif + IRP_IF MPI + call MPI_BCAST( mo_num_per_kpt, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + stop 'Unable to read mo_num_per_kpt with MPI' + endif + IRP_ENDIF + endif + call write_int(6,mo_num_per_kpt,'mo_num_per_kpt') + ASSERT (mo_num_per_kpt > 0) + +END_PROVIDER + BEGIN_PROVIDER [ double precision, mo_coef, (ao_num,mo_num) ] implicit none diff --git a/src/mo_basis/mos_cplx.irp.f b/src/mo_basis/mos_cplx.irp.f index fb90d807..19abe30e 100644 --- a/src/mo_basis/mos_cplx.irp.f +++ b/src/mo_basis/mos_cplx.irp.f @@ -1,10 +1,10 @@ -BEGIN_PROVIDER [ integer, mo_num_per_kpt ] - implicit none - BEGIN_DOC - ! number of mos per kpt. - END_DOC - mo_num_per_kpt = mo_num/kpt_num -END_PROVIDER +!BEGIN_PROVIDER [ integer, mo_num_per_kpt ] +! implicit none +! BEGIN_DOC +! ! number of mos per kpt. +! END_DOC +! mo_num_per_kpt = mo_num/kpt_num +!END_PROVIDER BEGIN_PROVIDER [ complex*16, mo_coef_complex, (ao_num,mo_num) ] implicit none diff --git a/src/utils_complex/create_ezfio_complex_3idx.py b/src/utils_complex/create_ezfio_complex_3idx.py index 3fef73d2..05399a7b 100755 --- a/src/utils_complex/create_ezfio_complex_3idx.py +++ b/src/utils_complex/create_ezfio_complex_3idx.py @@ -34,6 +34,8 @@ def convert_kpts(filename,qph5path): # need to change if we want to truncate orbital space within pyscf ezfio.set_ao_basis_ao_num(ao_num) ezfio.set_mo_basis_mo_num(mo_num) + ezfio.set_ao_basis_ao_num_per_kpt(ao_num//kpt_num) + ezfio.set_mo_basis_mo_num_per_kpt(mo_num//kpt_num) ezfio.electrons_elec_alpha_num = elec_alpha_num ezfio.electrons_elec_beta_num = elec_beta_num