Commit 4b197b26 authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' of iffgit.fz-juelich.de:fleur/fleur into develop

parents f7713d61 cdcff7c9
......@@ -15,6 +15,7 @@ include("cmake/tests/test_Wannier5.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake")
include("cmake/tests/test_LibXC.cmake")
include("cmake/tests/test_ELPA_onenode.cmake")
if (FLEUR_USE_MPI)
include("cmake/tests/test_SCALAPACK.cmake")
include("cmake/tests/test_ELPA.cmake")
......
......@@ -15,29 +15,30 @@ message("${Green}Compiler ID: ${CReset} ${CMAKE_Fortran_COMPILER_ID}")
message("${Green}Flags : ${CReset} ${CMAKE_Fortran_FLAGS}")
message("${Green}Libraries : ${CReset} ${FLEUR_LIBRARIES}")
message("\n${Red}These Libraries are required:${CReset}")
message("${Green} XML Library found : ${CReset} ${FLEUR_USE_XML}")
message("${Green} LAPACK Library found : ${CReset} ${FLEUR_USE_LAPACK}")
message("${Green} XML Library found : ${CReset} ${FLEUR_USE_XML}")
message("${Green} LAPACK Library found : ${CReset} ${FLEUR_USE_LAPACK}")
message("${Red}These Libraries are optional:${CReset}")
message("${Green} FFT from MKL found : ${CReset} ${FLEUR_USE_FFTMKL}")
message("${Green} LibXC Library found : ${CReset} ${FLEUR_USE_LIBXC}")
message("${Green} HDF5 Library found : ${CReset} ${FLEUR_USE_HDF5}")
message("${Green} Wannier90 1.2 Library found : ${CReset} ${FLEUR_USE_WANN}")
message("${Green} Wannier90-4 Library found : ${CReset} ${FLEUR_USE_WANN4}")
message("${Green} Wannier90-5 Library found : ${CReset} ${FLEUR_USE_WANN5}")
message("${Green} MAGMA Library found : ${CReset} ${FLEUR_USE_MAGMA}")
message("${Green} MPI Library found : ${CReset} ${FLEUR_USE_MPI}")
message("${Green} ELPA (one node) Library found : ${CReset} ${FLEUR_USE_ELPA_ONENODE}")
message("${Green} FFT from MKL found : ${CReset} ${FLEUR_USE_FFTMKL}")
message("${Green} LibXC Library found : ${CReset} ${FLEUR_USE_LIBXC}")
message("${Green} HDF5 Library found : ${CReset} ${FLEUR_USE_HDF5}")
message("${Green} Wannier90 1.2 Library found : ${CReset} ${FLEUR_USE_WANN}")
message("${Green} Wannier90-4 Library found : ${CReset} ${FLEUR_USE_WANN4}")
message("${Green} Wannier90-5 Library found : ${CReset} ${FLEUR_USE_WANN5}")
message("${Green} MAGMA Library found : ${CReset} ${FLEUR_USE_MAGMA}")
message("${Green} MPI Library found : ${CReset} ${FLEUR_USE_MPI}")
if (FLEUR_USE_MPI)
message("${Green} SCALAPACK Library found : ${CReset} ${FLEUR_USE_SCALAPACK}")
message("${Green} ELPA Library found : ${CReset} ${FLEUR_USE_ELPA}")
message("${Green} ChASE Library found : ${CReset} ${FLEUR_USE_CHASE}")
message("${Green} SCALAPACK Library found : ${CReset} ${FLEUR_USE_SCALAPACK}")
message("${Green} ELPA Library found : ${CReset} ${FLEUR_USE_ELPA}")
message("${Green} ChASE Library found : ${CReset} ${FLEUR_USE_CHASE}")
else()
message("${Green} SCALAPACK Library found : ${CReset} ---")
message("${Green} ELPA Library found : ${CReset} ---")
message("${Green} ChASE Library found : ${CReset} ---")
message("${Green} SCALAPACK Library found : ${CReset} ---")
message("${Green} ELPA Library found : ${CReset} ---")
message("${Green} ChASE Library found : ${CReset} ---")
endif()
message("${Green} Compile GPU version : ${CReset} ${FLEUR_USE_GPU}")
message("${Green} Compile GPU version : ${CReset} ${FLEUR_USE_GPU}")
if (FLEUR_USE_GPU)
message("${Green} CuSolver Library found : ${CReset} ${FLEUR_USE_CUSOLVER}")
message("${Green} CuSolver Library found : ${CReset} ${FLEUR_USE_CUSOLVER}")
endif()
message("\n")
message("${Green}Compile serial version : ${CReset} ${FLEUR_USE_SERIAL}")
......
#First check if we can compile with ELPA
try_compile(FLEUR_USE_ELPA_ONENODE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})
if (NOT FLEUR_USE_ELPA_ONENODE)
if (DEFINED CLI_ELPA_OPENMP)
set(TEST_LIBRARIES "-lelpa_onenode_openmp;${FLEUR_LIBRARIES}")
#else()
# set(TEST_LIBRARIES "-lelpa;${FLEUR_LIBRARIES}")
endif()
try_compile(FLEUR_USE_ELPA_ONENODE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA.f90
LINK_LIBRARIES ${TEST_LIBRARIES})
if (FLEUR_USE_ELPA_ONENODE)
set(FLEUR_LIBRARIES "${TEST_LIBRARIES}")
endif()
endif()
message("ELPA (one node) Library found:${FLEUR_USE_ELPA_ONENODE}")
#Now check for version of elpa
if (FLEUR_USE_ELPA_ONENODE)
set(FLEUR_USE_ELPA_ONENODE false)
try_compile(FLEUR_USE_ELPA_ONENODE_20180525 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA_20180525.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})
message("Version check for ELPA:")
message("20180525 ELPA: ${FLEUR_USE_ELPA_ONENODE_20180525}")
if (FLEUR_USE_ELPA_ONENODE_20180525)
set(FLEUR_USE_ELPA_ONENODE TRUE)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_ELPA_ONENODE")
endif()
endif()
......@@ -8,8 +8,8 @@ diagonalization/scalapack.F90
diagonalization/chase_diag.F90
diagonalization/symmetrize_matrix.f90
diagonalization/cusolver_diag.F90
diagonalization/elemental.F90)
diagonalization/elemental.F90
diagonalization/elpa_20180525_onenode.F90)
if (FLEUR_USE_ELPA_20180525)
set(fleur_F90 ${fleur_F90}
diagonalization/elpa_20180525.F90
......
......@@ -41,6 +41,11 @@ MODULE m_eigen_diag
#endif
INTEGER,PARAMETER:: diag_lapack=4
#ifdef CPP_ELPA_ONENODE
INTEGER,PARAMETER:: diag_elpa_1node=14
#else
INTEGER,PARAMETER:: diag_elpa_1node=-14
#endif
INTEGER,PARAMETER:: diag_debugout=99
PUBLIC eigen_diag,parallel_solver_available
CONTAINS
......@@ -53,6 +58,7 @@ CONTAINS
USE m_lapack_diag
USE m_magma
USE m_elpa
USE m_elpa_onenode
USE m_scalapack
USE m_elemental
USE m_chase_diag
......@@ -105,6 +111,8 @@ CONTAINS
SELECT CASE (priv_select_solver(parallel))
CASE (diag_elpa)
CALL elpa_diag(hmat,smat,ne,eig,ev)
CASE (diag_elpa_1node)
CALL elpa_diag_onenode(hmat,smat,ne,eig,ev)
CASE (diag_elemental)
!CALL ELEMENTAL(hmat,smat,ne,eig,ev)
CASE (diag_scalapack)
......@@ -229,20 +237,22 @@ CONTAINS
ENDIF
!check if a special solver was requested
IF (TRIM(juDFT_string_for_argument("-diag"))=="elpa") diag_solver=diag_elpa
IF (trim(juDFT_string_for_argument("-diag"))=="scalapack") diag_solver=diag_scalapack
IF (trim(juDFT_string_for_argument("-diag"))=="elemental") diag_solver=diag_elemental
IF (trim(juDFT_string_for_argument("-diag"))=="lapack") diag_solver=diag_lapack
IF (trim(juDFT_string_for_argument("-diag"))=="magma") diag_solver=diag_magma
IF (trim(juDFT_string_for_argument("-diag"))=="chase") diag_solver=diag_chase
IF (trim(juDFT_string_for_argument("-diag"))=="cusolver") diag_solver=diag_cusolver
IF (trim(juDFT_string_for_argument("-diag"))=="debugout") diag_solver=diag_debugout
IF (TRIM(juDFT_string_for_argument("-diag"))=="elpa") diag_solver=diag_elpa
IF (TRIM(juDFT_string_for_argument("-diag"))=="elpa_1node") diag_solver=diag_elpa_1node
IF (trim(juDFT_string_for_argument("-diag"))=="scalapack") diag_solver=diag_scalapack
IF (trim(juDFT_string_for_argument("-diag"))=="elemental") diag_solver=diag_elemental
IF (trim(juDFT_string_for_argument("-diag"))=="lapack") diag_solver=diag_lapack
IF (trim(juDFT_string_for_argument("-diag"))=="magma") diag_solver=diag_magma
IF (trim(juDFT_string_for_argument("-diag"))=="chase") diag_solver=diag_chase
IF (trim(juDFT_string_for_argument("-diag"))=="cusolver") diag_solver=diag_cusolver
IF (trim(juDFT_string_for_argument("-diag"))=="debugout") diag_solver=diag_debugout
!Check if solver is possible
IF (diag_solver<0) CALL juDFT_error("You selected a solver for the eigenvalue problem that is not available",hint="You most probably did not provide the appropriate libraries for compilation/linking")
IF (ANY((/diag_lapack,diag_magma,diag_cusolver/)==diag_solver).AND.parallel) CALL judft_error("You selected an eigensolver that does not support distributed memory parallism",hint="Try scalapack,elpa or another supported solver for parallel matrices")
IF (ANY((/diag_elpa,diag_elemental,diag_scalapack/)==diag_solver).AND..NOT.parallel) CALL judft_error("You selected an eigensolver for matrices that are memory distributed",hint="Try lapack, cusolver or another supported solver for non-distributed matrices")
END FUNCTION priv_select_solver
......
!-------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_elpa_onenode
CONTAINS
SUBROUTINE elpa_diag_onenode(hmat,smat,ne,eig,ev)
!
!----------------------------------------------------
! Sigensystem solver
! Uses the ELPA (1 node version)
!
!
! hmat ..... Hamiltonian matrix
! smat ..... overlap matrix
! ne ....... number of ev's searched (and found) on this node
! On input, overall number of ev's searched,
! On output, local number of ev's found
! eig ...... eigenvalues, output
! ev ....... eigenvectors, output
!
! U.Alekseeva Nov. 2018
!----------------------------------------------------
USE m_juDFT
USE m_types_mat
USE m_types
#ifdef CPP_ELPA_ONENODE
USE elpa
#endif
IMPLICIT NONE
CLASS(t_mat),INTENT(INOUT) :: hmat,smat
CLASS(t_mat),ALLOCATABLE,INTENT(OUT)::ev
REAL,INTENT(OUT) :: eig(:)
INTEGER,INTENT(INOUT) :: ne
#ifdef CPP_ELPA_ONENODE
!... Local variables
!
INTEGER :: err
REAL,ALLOCATABLE :: eig2(:)
TYPE(t_mat) :: ev_dist
INTEGER :: kernel
CLASS(elpa_t),pointer :: elpa_obj
err = elpa_init(20180525)
elpa_obj => elpa_allocate()
ALLOCATE ( eig2(hmat%matsize1), stat=err ) ! The eigenvalue array
IF (err.NE.0) CALL juDFT_error('Failed to allocated "eig2"', calledby ='elpa')
CALL ev_dist%init(hmat)! Eigenvectors
IF (err.NE.0) CALL juDFT_error('Failed to allocated "ev_dist"',calledby ='elpa')
CALL elpa_obj%set("na", hmat%matsize1, err)
CALL elpa_obj%set("nev", ne, err)
CALL elpa_obj%set("local_nrows", hmat%matsize1, err)
CALL elpa_obj%set("local_ncols", hmat%matsize2, err)
CALL elpa_obj%set("nblk",hmat%matsize1, err)
CALL elpa_obj%set("blacs_context", -1, err)
err = elpa_obj%setup()
CALL hmat%add_transpose(hmat)
CALL smat%add_transpose(smat)
IF (hmat%l_real) THEN
CALL elpa_obj%generalized_eigenvectors(hmat%data_r,smat%data_r,eig2, ev_dist%data_r, .FALSE.,err)
ELSE
CALL elpa_obj%generalized_eigenvectors(hmat%data_c,smat%data_c,eig2, ev_dist%data_c, .FALSE., err)
ENDIF
CALL elpa_deallocate(elpa_obj)
CALL elpa_uninit()
! END of ELPA stuff
eig(1:ne) = eig2(1:ne)
DEALLOCATE(eig2)
ALLOCATE(t_mat::ev)
CALL ev%alloc(hmat%l_real,hmat%matsize1,ne)
CALL ev%copy(ev_dist,1,1)
#endif
END SUBROUTINE elpa_diag_onenode
END MODULE m_elpa_onenode
......@@ -150,6 +150,9 @@ CONTAINS
WRITE(1233,'(2i7,2f15.8)') i, j, hmat%data_r(i,j), hmat%data_r(j,i)
END IF
ELSE
IF ((i.LE.5).AND.(j.LE.5)) THEN
WRITE(1233,'(2i7,4f15.8)') i, j, hmat%data_c(i,j), hmat%data_c(j,i)
END IF
ENDIF
END DO
END DO
......@@ -170,6 +173,8 @@ CONTAINS
l_wu=.FALSE.
ne_all=DIMENSION%neigd
IF(ne_all < 0) ne_all = lapw%nmat
IF(ne_all > lapw%nmat) ne_all = lapw%nmat
!Try to symmetrize matrix
CALL symmetrize_matrix(mpi,noco,kpts,nk,hmat,smat)
......
libxml2_version=2.7.2
if [ ! -r libxml2-${libxml2_version} ]
then
#Get the file with the code
curl -LO "ftp://xmlsoft.org/libxml2/libxml2-${libxml2_version}.tar.gz"
tar xzf libxml2-${libxml2_version}.tar.gz
cd libxml2-${libxml2_version}
#Compile&test (This will take a while)
./configure --disable-shared
make
else
cd libxml2-${libxml2_version}
fi
#Store the installation location
FLEUR_LIBDIR="$PWD/.libs $FLEUR_LIBDIR"
FLEUR_INCLUDEDIR="$PWD/include $FLEUR_INCLUDEDIR"
This diff is collapsed.
......@@ -35,20 +35,20 @@ contains
END IF
END IF
IF (.NOT.l_kpts) THEN
IF (.NOT.l_kpts) THEN
IF (.NOT.oneD%odd%d1) THEN
IF (input%l_wann) THEN
sym_hlp=sym
sym_hlp%nop=1
sym_hlp%nop2=1
CALL kptgen_hybrid(kpts,sym_hlp%invs,noco%l_soc,sym_hlp%nop,sym_hlp%mrot,sym_hlp%tau)
CALL kptgen_hybrid(input,cell,sym_hlp,kpts,noco%l_soc)
ELSE IF (.FALSE.) THEN !this was used to generate q-points in jij case
sym_hlp=sym
sym_hlp%nop=1
sym_hlp%nop2=1
CALL julia(sym_hlp,cell,input,noco,banddos,kpts,.FALSE.,.TRUE.)
ELSE IF (kpts%l_gamma.and.(banddos%ndir.eq.0)) THEN
CALL kptgen_hybrid(kpts,sym%invs,noco%l_soc,sym%nop,sym%mrot,sym%tau)
CALL kptgen_hybrid(input,cell,sym,kpts,noco%l_soc)
ELSE
IF (banddos%unfoldband) THEN
CALL unfold_band_kpts(banddos,p_cell,cell,p_kpts,kpts)
......@@ -64,19 +64,19 @@ contains
CALL od_kptsgen (kpts%nkpt)
END IF
!Rescale weights and kpoints
IF (.not.banddos%unfoldband) THEN
kpts%wtkpt(:) = kpts%wtkpt(:) / sum(kpts%wtkpt)
!Rescale weights and kpoints
IF (.not.banddos%unfoldband) THEN
kpts%wtkpt(:) = kpts%wtkpt(:) / sum(kpts%wtkpt)
END IF
kpts%bk(:,:) = kpts%bk(:,:) / kpts%posScale
kpts%posScale = 1.0
IF (kpts%nkpt3(3).EQ.0) kpts%nkpt3(3) = 1
ELSE
IF (banddos%unfoldband) THEN
CALL unfold_band_kpts(banddos,p_cell,cell,p_kpts,kpts)
CALL find_supercell_kpts(banddos,p_cell,cell,p_kpts,kpts)
END IF
END IF
kpts%bk(:,:) = kpts%bk(:,:) / kpts%posScale
kpts%posScale = 1.0
IF (kpts%nkpt3(3).EQ.0) kpts%nkpt3(3) = 1
ELSE
IF (banddos%unfoldband) THEN
CALL unfold_band_kpts(banddos,p_cell,cell,p_kpts,kpts)
CALL find_supercell_kpts(banddos,p_cell,cell,p_kpts,kpts)
END IF
END IF
end subroutine kpoints
end module m_kpoints
......@@ -16,18 +16,19 @@
!Modified for types D.W.
SUBROUTINE kptgen_hybrid(kpts,invs,l_soc,nop,mrot,tau)
SUBROUTINE kptgen_hybrid(input,cell,sym,kpts,l_soc)
USE m_types
USE m_divi
IMPLICIT NONE
TYPE(t_kpts),INTENT(INOUT)::kpts
TYPE(t_input), INTENT(IN) :: input
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_kpts), INTENT(INOUT) :: kpts
! - scalars -
INTEGER, INTENT(IN) :: nop
LOGICAL, INTENT(IN) :: invs
LOGICAL, INTENT(IN) :: l_soc
! - local arrays -
INTEGER, INTENT(IN) :: mrot(3,3,nop)
REAL , INTENT(IN) :: tau(3,nop)
! - local scalars -
INTEGER :: i,j,k,nkpt
INTEGER :: ikpt,ikpt0,nkpti
......@@ -43,6 +44,11 @@
REAL,ALLOCATABLE :: rarr(:)
LOGICAL :: ldum
IF (sum(kpts%nkpt3).EQ.0) THEN
CALL divi(kpts%nkpt,cell%bmat,input%film,sym%nop,
& sym%nop2,kpts%nkpt3)
END IF
nkpt=kpts%nkpt3(1)*kpts%nkpt3(2)*kpts%nkpt3(3)
ALLOCATE( bk(3,nkpt),bkhlp(3,nkpt) )
......@@ -59,22 +65,22 @@
IF( ikpt .ne. nkpt) STOP 'failure: number of k-points'
IF( invs .or. l_soc ) THEN
nsym = nop
IF( sym%invs .or. l_soc ) THEN
nsym = sym%nop
ELSE
nsym = 2*nop
nsym = 2*sym%nop
END IF
ALLOCATE( rot(3,3,nsym),rtau(3,nsym) )
DO i=1,nop
rot(:,:,i) = mrot(:,:,i)
rtau( :,i) = tau(:,i)
DO i=1,sym%nop
rot(:,:,i) = sym%mrot(:,:,i)
rtau( :,i) = sym%tau(:,i)
END DO
DO i = nop+1,nsym
rot(:,:,i) = rot(:,:,i-nop)
rtau( :,i) = rtau( :,i-nop)
DO i = sym%nop+1,nsym
rot(:,:,i) = rot(:,:,i-sym%nop)
rtau( :,i) = rtau( :,i-sym%nop)
END DO
IF(any(rot(:,:,1)-reshape((/1,0,0,0,1,0,0,0,1/),(/3,3/)).ne.0))
......@@ -84,8 +90,8 @@
invtab = 0
DO i = 1,nop
DO j = 1,nop
DO i = 1,sym%nop
DO j = 1,sym%nop
IF( all( matmul(rot(:,:,i),rot(:,:,j))
& .eq.reshape((/1,0,0,0,1,0,0,0,1/),(/3,3/)))
......@@ -102,8 +108,8 @@
END DO
DO i = nop+1,nsym
rrot(:,:,i) = - rrot(:,:,i-nop)
DO i = sym%nop+1,nsym
rrot(:,:,i) = - rrot(:,:,i-sym%nop)
END DO
ALLOCATE ( kptp(nkpt),symkpt(nkpt),rarr(3),iarr2(3),iarr(nkpt) )
......
......@@ -401,7 +401,7 @@ CONTAINS
CALL forcetheo%postprocess()
IF ((input%gw.GT.0).AND.(mpi%irank.EQ.0)) THEN
CALL writeBasis(input,noco,kpts,atoms,sym,cell,enpara,vTot,mpi,DIMENSION,results,eig_id,oneD,sphhar,stars,vacuum)
CALL writeBasis(input,noco,kpts,atoms,sym,cell,enpara,vTot,vCoul,vx,mpi,DIMENSION,results,eig_id,oneD,sphhar,stars,vacuum)
END IF
CALL enpara%mix(mpi,atoms,vacuum,input,vTot%mt(:,0,:,:),vtot%vacz)
......
......@@ -29,6 +29,9 @@ MODULE m_fleur_arguments
#ifdef CPP_SCALAPACK
//",scalapack"&
#endif
#ifdef CPP_ELPA_ONENODE
//",elpa_1node"&
#endif
#ifdef CPP_ELPA
//",elpa"&
#endif
......
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