Commit 387cb7b9 authored by Gregor Michalicek's avatar Gregor Michalicek

Remove w_iks storage

Note: The MPI_BARRIER below the write_eig call in fermi/fermie.F90
was also removed. I hope that is save.
parent 510c823c
......@@ -268,19 +268,7 @@ CONTAINS
WRITE(attributes(1),'(f20.10)') results%ef
WRITE(attributes(2),'(a)') 'Htr'
IF (fmpi%irank.EQ.0) CALL writeXMLElement('FermiEnergy',(/'value','units'/),attributes(1:2))
ENDIF
!IF(.not.input%eig66(1))THEN
!Put w_iks into eig-file
DO jsp = 1,nspins
DO k = 1,kpts%nkpt
IF (fmpi%irank == 0) CALL write_eig(eig_id,k,jsp,w_iks=results%w_iks(:,k,jsp))
#ifdef CPP_MPI
CALL MPI_BARRIER(fmpi%mpi_comm,ierr)
#endif
ENDDO
ENDDO
!ENDIF
ENDIF
RETURN
8020 FORMAT (/,'FERMIE:',/,&
......
......@@ -117,11 +117,11 @@ CONTAINS
d%fname = "eig"
CALL eig66_remove_data(id)
END SUBROUTINE close_eig
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zmat, smat)
SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zmat, smat)
IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), OPTIONAL :: zmat, smat
......@@ -142,11 +142,6 @@ CONTAINS
nrec = nk + (jspin - 1)*d%nkpts
IF (PRESENT(w_iks)) THEN
print *, "R:w_iks:", nrec
read (d%file_io_id_wiks, REC=nrec) w_iks
ENDIF
IF (.NOT. (PRESENT(eig) .OR. PRESENT(neig) .OR. PRESENT(zmat))) RETURN
READ (d%file_io_id_vec, REC=nrec) neig_s
IF (PRESENT(neig)) THEN
......@@ -177,11 +172,11 @@ CONTAINS
END SUBROUTINE read_eig
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_size, n_rank, zmat, smat)
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_size, n_rank, zmat, smat)
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat
INTEGER:: nrec, r_len
......@@ -209,9 +204,6 @@ CONTAINS
CALL juDFT_error("Neig and neig_total have to be equal in DA mode", calledby="eig66_da")
ENDIF
ENDIF
IF (PRESENT(w_iks)) THEN
write (d%file_io_id_wiks, REC=nrec) w_iks
ENDIF
IF (.NOT. PRESENT(eig) .OR. .NOT. PRESENT(neig)) RETURN
!Now the IO of the eigenvalues/vectors
......
......@@ -26,13 +26,13 @@ module m_eig66_data
TYPE, extends(t_data):: t_data_MPI
INTEGER :: n_size = 1
INTEGER :: size_k, size_eig
INTEGER :: eig_handle, zr_handle, zc_handle, neig_handle, w_iks_handle, olap_r_handle, olap_c_handle
INTEGER :: eig_handle, zr_handle, zc_handle, neig_handle, olap_r_handle, olap_c_handle
INTEGER, ALLOCATABLE :: pe_basis(:, :), slot_basis(:, :)
INTEGER, ALLOCATABLE :: pe_ev(:, :, :), slot_ev(:, :, :)
integer, allocatable :: pe_olap(:,:,:), slot_olap(:,:,:)
INTEGER :: irank
INTEGER, POINTER :: neig_data(:)
REAL, POINTER :: eig_data(:), zr_data(:), w_iks_data(:), olap_r_data(:)
REAL, POINTER :: eig_data(:), zr_data(:), olap_r_data(:)
COMPLEX, POINTER :: zc_data(:), olap_c_data(:)
END TYPE
TYPE, EXTENDS(t_data):: t_data_hdf
......@@ -46,7 +46,7 @@ module m_eig66_data
TYPE, EXTENDS(t_data):: t_data_mem
INTEGER, ALLOCATABLE :: eig_int(:)
REAL, ALLOCATABLE :: eig_eig(:, :, :)
REAL, ALLOCATABLE :: eig_eig(:, :)
REAL, ALLOCATABLE :: eig_vecr(:, :)
COMPLEX, ALLOCATABLE :: eig_vecc(:, :)
REAL, ALLOCATABLE :: olap_r(:, :)
......
......@@ -123,11 +123,6 @@ CONTAINS
CALL h5screate_simple_f(3, dims(:3), spaceid, hdferr)
CALL h5dcreate_f(d%fid, "energy", H5T_NATIVE_DOUBLE, spaceid, d%energysetid, hdferr)
CALL h5sclose_f(spaceid, hdferr)
! w_iks
dims(:3) = (/neig, nkpts, jspins/)
CALL h5screate_simple_f(3, dims(:3), spaceid, hdferr)
CALL h5dcreate_f(d%fid, "w_iks", H5T_NATIVE_DOUBLE, spaceid, d%wikssetid, hdferr)
CALL h5sclose_f(spaceid, hdferr)
! ev
if (l_real .and. .not. l_soc) THEN
dims(:5) = (/one, nmat, neig, nkpts, jspins/)
......@@ -141,7 +136,6 @@ CONTAINS
CALL h5fopen_f(TRIM(d%fname)//'.hdf', access_Mode, d%fid, hdferr, access_prp)
!get dataset-ids
CALL h5dopen_f(d%fid, 'energy', d%energysetid, hdferr)
CALL h5dopen_f(d%fid, 'w_iks', d%wikssetid, hdferr)
CALL h5dopen_f(d%fid, 'neig', d%neigsetid, hdferr)
CALL h5dopen_f(d%fid, 'ev', d%evsetid, hdferr)
endif
......@@ -215,7 +209,7 @@ CONTAINS
#endif
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_size, n_rank, zmat, smat)
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_size, n_rank, zmat, smat)
!*****************************************************************
! writes all eignevecs for the nk-th kpoint
......@@ -225,7 +219,7 @@ CONTAINS
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat
INTEGER i, j, k, nv_local, n1, n2, ne
......@@ -242,9 +236,6 @@ CONTAINS
!
!write eigenvalues
!
IF (PRESENT(w_iks)) THEN
CALL io_write_real1s(d%wikssetid, (/1, nk, jspin/), (/size(w_iks), 1, 1/), w_iks, (/1, 1, 1/))
ENDIF
IF (PRESENT(neig_total)) THEN
CALL io_write_integer0(d%neigsetid, (/nk, jspin/), (/1, 1/), neig_total)
......@@ -329,11 +320,11 @@ CONTAINS
#endif
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zMat, smat)
SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zMat, smat)
IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), OPTIONAL :: zmat, smat
......@@ -354,9 +345,6 @@ CONTAINS
CALL io_read_real1(d%energysetid, (/1, nk, jspin/), (/neig, 1, 1/),&
& eig(:neig))
ENDIF
IF (PRESENT(w_iks)) THEN
CALL io_read_real1(d%wikssetid, (/1, nk, jspin/), (/size(w_iks), 1, 1/), w_iks)
ENDIF
ENDIF
IF (PRESENT(zMat)) THEN
......
......@@ -114,7 +114,7 @@ CONTAINS
END SUBROUTINE close_eig
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zmat, smat)
SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zmat, smat)
USE m_eig66_hdf, ONLY: read_eig_hdf => read_eig
USE m_eig66_DA, ONLY: read_eig_DA => read_eig
USE m_eig66_mem, ONLY: read_eig_mem => read_eig
......@@ -122,27 +122,27 @@ CONTAINS
IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), INTENT(INOUT), OPTIONAL :: zmat, smat
INTEGER::n
CALL timestart("IO (read)")
SELECT CASE (eig66_data_mode(id))
CASE (DA_mode)
CALL read_eig_DA(id, nk, jspin, neig, eig, w_iks, list, zmat, smat)
CALL read_eig_DA(id, nk, jspin, neig, eig, list, zmat, smat)
CASE (hdf_mode)
CALL read_eig_hdf(id, nk, jspin, neig, eig, w_iks, list, zmat, smat)
CALL read_eig_hdf(id, nk, jspin, neig, eig, list, zmat, smat)
CASE (mem_mode)
CALL read_eig_mem(id, nk, jspin, neig, eig, w_iks, list, zmat, smat)
CALL read_eig_mem(id, nk, jspin, neig, eig, list, zmat, smat)
CASE (mpi_mode)
CALL read_eig_mpi(id, nk, jspin, neig, eig, w_iks, list, zmat, smat)
CALL read_eig_mpi(id, nk, jspin, neig, eig, list, zmat, smat)
CASE (-1)
CALL juDFT_error("Could not read eig-file before opening", calledby="eig66_io")
END SELECT
CALL timestop("IO (read)")
END SUBROUTINE read_eig
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat)
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
USE m_eig66_hdf, ONLY: write_eig_hdf => write_eig
USE m_eig66_DA, ONLY: write_eig_DA => write_eig
USE m_eig66_mem, ONLY: write_eig_MEM => write_eig
......@@ -150,18 +150,18 @@ CONTAINS
IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total, n_start, n_end
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_Mat), INTENT(IN), OPTIONAL :: zmat, smat
CALL timestart("IO (write)")
SELECT CASE (eig66_data_mode(id))
CASE (da_mode)
CALL write_eig_DA(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat)
CALL write_eig_DA(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
CASE (hdf_mode)
CALL write_eig_HDF(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat)
CALL write_eig_HDF(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
CASE (mem_mode)
CALL write_eig_Mem(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat)
CALL write_eig_Mem(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
CASE (MPI_mode)
CALL write_eig_MPI(id, nk, jspin, neig, neig_total, eig, w_iks, n_start, n_end, zmat, smat)
CALL write_eig_MPI(id, nk, jspin, neig, neig_total, eig, n_start, n_end, zmat, smat)
CASE (-1)
CALL juDFT_error("Could not write eig-file before opening", calledby="eig66_io")
END SELECT
......
......@@ -51,7 +51,7 @@ CONTAINS
!d%eig_eig
length = jspins
IF (l_noco) length = 1
ALLOCATE (d%eig_eig(neig, 2, jspins*nkpts)) !additional dimension for w_iks
ALLOCATE (d%eig_eig(neig, jspins*nkpts))
!d%eig_vec
if (l_real .and. .not. l_soc) THEN
ALLOCATE (d%eig_vecr(nmat*neig, length*nkpts))
......@@ -74,7 +74,7 @@ CONTAINS
USE m_eig66_da, ONLY: open_eig_IO => open_eig, read_eig_IO => read_eig, close_eig_IO => close_eig
INTEGER:: jspin, nk, i, ii, iii, nv, tmp_id
REAL :: wk, bk3(3), evac(2)
REAL :: eig(neig), w_iks(neig)
REAL :: eig(neig)
TYPE(t_mat):: zmat
zmat%l_real = l_real
......@@ -86,8 +86,8 @@ CONTAINS
CALL open_eig_IO(tmp_id, nmat, neig, nkpts, jspins, .FALSE., l_real, l_soc, .false., filename)
DO jspin = 1, jspins
DO nk = 1, nkpts
CALL read_eig_IO(tmp_id, nk, jspin, i, eig, w_iks, zmat=zmat)
!CALL write_eig(id,nk,jspin,i,i,eig,w_iks,zmat=zmat)
CALL read_eig_IO(tmp_id, nk, jspin, i, eig, zmat=zmat)
!CALL write_eig(id,nk,jspin,i,i,eig,zmat=zmat)
ENDDO
ENDDO
CALL close_eig_IO(tmp_id)
......@@ -121,7 +121,7 @@ CONTAINS
INTEGER:: nk, jspin, nv, i, ii, tmp_id
REAL :: wk, bk3(3), evac(2)
REAL :: eig(SIZE(d%eig_eig, 1)), w_iks(SIZE(d%eig_eig, 1))
REAL :: eig(SIZE(d%eig_eig, 1))
TYPE(t_mat)::zmat
zmat%l_real = d%l_real
zmat%matsize1 = d%nmat
......@@ -133,8 +133,8 @@ CONTAINS
DO nk = 1, d%nkpts
!TODO this code is no longer working
STOP "BUG"
!CALL read_eig(id,nk,jspin,nv,i,bk3,wk,ii,eig,w_iks,el,ello,evac,zmat=zmat)
!CALL write_eig_DA(tmp_id,nk,jspin,ii,ii,nv,i,bk3,wk,eig,w_iks,el,ello,evac,nlotot,zmat=zmat)
!CALL read_eig(id,nk,jspin,nv,i,bk3,wk,ii,eig,el,ello,evac,zmat=zmat)
!CALL write_eig_DA(tmp_id,nk,jspin,ii,ii,nv,i,bk3,wk,eig,el,ello,evac,nlotot,zmat=zmat)
ENDDO
ENDDO
CALL close_eig_DA(tmp_id)
......@@ -142,11 +142,11 @@ CONTAINS
END SUBROUTINE priv_writetofile
END SUBROUTINE close_eig
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zmat, smat)
SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zmat, smat)
IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), OPTIONAL :: zmat, smat
......@@ -164,11 +164,7 @@ CONTAINS
!data from d%eig_eig
IF (PRESENT(eig)) THEN
eig = 0.0
eig = d%eig_eig(:SIZE(eig), 1, nrec)
ENDIF
IF (PRESENT(w_iks)) THEN
w_iks = 0.0
w_iks = d%eig_eig(:SIZE(w_iks), 2, nrec)
eig = d%eig_eig(:SIZE(eig), nrec)
ENDIF
!data from d%eig_vec
......@@ -240,11 +236,11 @@ CONTAINS
ENDIF
END SUBROUTINE read_eig
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_size, n_rank, zmat, smat)
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_size, n_rank, zmat, smat)
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat
INTEGER::nrec
TYPE(t_data_mem), POINTER:: d
......@@ -263,10 +259,7 @@ CONTAINS
!data from d%eig_eig
IF (PRESENT(eig)) THEN
d%eig_eig(:SIZE(eig), 1, nrec) = eig
ENDIF
IF (PRESENT(w_iks)) THEN
d%eig_eig(:SIZE(w_iks), 2, nrec) = w_iks
d%eig_eig(:SIZE(eig), nrec) = eig
ENDIF
!data from d%eig_vec
IF (PRESENT(zmat)) THEN
......
......@@ -64,9 +64,6 @@ CONTAINS
d%size_eig = neig
CALL priv_create_memory(d%size_eig, local_slots, d%eig_handle, real_data_ptr=d%eig_data)
d%eig_data = 1E99
!The w_iks
CALL priv_create_memory(d%size_eig, local_slots, d%w_iks_handle, real_data_ptr=d%w_iks_data)
d%w_iks_data = 1E99
!The eigenvectors
local_slots = COUNT(d%pe_ev == d%irank)
......@@ -165,11 +162,11 @@ CONTAINS
IF (PRESENT(filename)) CALL judft_error("Storing of data not implemented for MPI case", calledby="eig66_mpi.F")
END SUBROUTINE close_eig
SUBROUTINE read_eig(id, nk, jspin, neig, eig, w_iks, list, zmat, smat)
SUBROUTINE read_eig(id, nk, jspin, neig, eig, list, zmat, smat)
IMPLICIT NONE
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(OUT), OPTIONAL :: neig
REAL, INTENT(OUT), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(OUT), OPTIONAL :: eig(:)
INTEGER, INTENT(IN), OPTIONAL :: list(:)
TYPE(t_mat), OPTIONAL :: zmat, smat
......@@ -190,7 +187,7 @@ CONTAINS
CALL MPI_GET(neig, 1, MPI_INTEGER, pe, slot, 1, MPI_INTEGER, d%neig_handle, e)
CALL MPI_WIN_UNLOCK(pe, d%neig_handle, e)
ENDIF
IF (PRESENT(eig) .OR. PRESENT(w_iks)) THEN
IF (PRESENT(eig)) THEN
ALLOCATE (tmp_real(MIN(SIZE(eig), d%size_eig)))
IF (PRESENT(eig)) THEN
CALL MPI_WIN_LOCK(MPI_LOCK_SHARED, pe, 0, d%eig_handle, e)
......@@ -198,12 +195,6 @@ CONTAINS
CALL MPI_WIN_UNLOCK(pe, d%eig_handle, e)
eig(:SIZE(tmp_real)) = tmp_real
END IF
IF (PRESENT(w_iks)) THEN
CALL MPI_WIN_LOCK(MPI_LOCK_SHARED, pe, 0, d%w_iks_handle, e)
CALL MPI_GET(tmp_real, SIZE(tmp_real), MPI_DOUBLE_PRECISION, pe, slot, SIZE(tmp_real), MPI_DOUBLE_PRECISION, d%w_iks_handle, e)
CALL MPI_WIN_UNLOCK(pe, d%w_iks_handle, e)
w_iks(:SIZE(tmp_real)) = tmp_real
END IF
DEALLOCATE (tmp_real)
ENDIF
......@@ -289,11 +280,11 @@ CONTAINS
#endif
END SUBROUTINE read_eig
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, w_iks, n_size, n_rank, zmat, smat)
SUBROUTINE write_eig(id, nk, jspin, neig, neig_total, eig, n_size, n_rank, zmat, smat)
INTEGER, INTENT(IN) :: id, nk, jspin
INTEGER, INTENT(IN), OPTIONAL :: n_size, n_rank
INTEGER, INTENT(IN), OPTIONAL :: neig, neig_total
REAL, INTENT(IN), OPTIONAL :: eig(:), w_iks(:)
REAL, INTENT(IN), OPTIONAL :: eig(:)
TYPE(t_mat), INTENT(IN), OPTIONAL :: zmat, smat
#ifdef CPP_MPI
......@@ -327,7 +318,7 @@ CONTAINS
!write the eigenvalues
!only one process needs to do it
IF (PRESENT(eig) .OR. PRESENT(w_iks)) THEN
IF (PRESENT(eig)) THEN
ALLOCATE (tmp_real(d%size_eig))
tmp_real = 1E99
IF (PRESENT(EIG)) THEN
......@@ -336,12 +327,6 @@ CONTAINS
CALL MPI_PUT(tmp_real, d%size_eig, MPI_DOUBLE_PRECISION, pe, slot, d%size_eig, MPI_DOUBLE_PRECISION, d%eig_handle, e)
CALL MPI_WIN_UNLOCK(pe, d%eig_handle, e)
END IF
IF (PRESENT(w_iks)) THEN
tmp_real(:SIZE(w_iks)) = w_iks
CALL MPI_WIN_LOCK(MPI_LOCK_EXCLUSIVE, pe, 0, d%w_iks_handle, e)
CALL MPI_PUT(tmp_real, d%size_eig, MPI_DOUBLE_PRECISION, pe, slot, d%size_eig, MPI_DOUBLE_PRECISION, d%w_iks_handle, e)
CALL MPI_WIN_UNLOCK(pe, d%w_iks_handle, e)
END IF
DEALLOCATE (tmp_real)
ENDIF
......@@ -429,7 +414,6 @@ CONTAINS
d%neig_data = 0
d%eig_data = 1E99
d%w_iks_data = 1E99
IF (d%l_real .AND. .NOT. l_soc) THEN
d%zr_data = 0.0
ELSE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment