Commit b40a5b91 authored by Daniel Wortmann's avatar Daniel Wortmann
Browse files

Simplest possible manual merge with develop branch. Most likely does not even compile!

parent 8da2a9c4
stages:
- build
- test
- deploy
- build-pgi
- test-pgi
- build-intel
- test-intel
build-gfortran:
image: ubuntu:16.10
image: iffregistry.fz-juelich.de/fleur/fleur:latest
stage: build
cache:
paths:
- build
script:
- apt-get update -qq && apt-get install -y -qq build-essential gfortran gfortran-6 g++-6 gcc-6 binutils-gold git cmake libxml2-dev liblapack-dev libblas-dev doxygen libopenmpi-dev libscalapack-mpi-dev
- cd /builds/fleur/fleur; ./configure.sh GITLAB; cd build; make
only:
- schedules
- triggers
- web
test-gfortran:
image: ubuntu:16.10
image: iffregistry.fz-juelich.de/fleur/fleur:latest
stage: test
cache:
paths:
- build
script:
- apt-get update -qq && apt-get install -y -qq build-essential gfortran gfortran-6 g++-6 gcc-6 binutils-gold git cmake libxml2-dev liblapack-dev libblas-dev libopenmpi-dev libscalapack-mpi-dev
- ulimit -s unlimited ;export juDFT_MPI="mpirun -n 2 --allow-run-as-root ";cd /builds/fleur/fleur/build;ctest
only:
- schedules
- triggers
- web
pages:
image: iffregistry.fz-juelich.de/fleur/fleur:latest
stage: deploy
cache:
paths:
- build
script:
- cd /builds/fleur/fleur/build ; make doc
- mv docs/html/ ../public/
artifacts:
paths:
- public
- build/fleur
- build/fleur_MPI
- build/inpgen
only:
- schedules
- triggers
- web
#build-pgi:
# image: hopobcn/pgi-ce
# stage: build
# image: iffregistry.fz-juelich.de/fleur/fleur:pgi
# stage: build-pgi
# cache:
# paths:
# - build.debug
# script:
# - apt-get update -qq && apt-get install -y -qq cmake libxml2-dev
# - cd /builds/fleur/fleur; ./configure.sh AUTO debug; cd build.debug; make
# - cd /builds/fleur/fleur; ./configure.sh -d AUTO ; cd build.debug; make
# only:
# - schedules
# - triggers
# - web
#test-pgi:
# image: hopobcn/pgi-ce
# stage: test
# image: iffregistry.fz-juelich.de/fleur/fleur:pgi
# stage: test-pgi
# cache:
# paths:
# - build.debug
# script:
# - apt-get update -qq && apt-get install -y -qq cmake libxml2-dev
# - cd /builds/fleur/fleur/build.debug;ctest
# only:
# - schedules
# - web
# - triggers
build-intel:
image: iffregistry.fz-juelich.de/docker-images/centos7-intel-compilers/extended
stage: build-intel
cache:
paths:
- build.intel
script:
- set +e && source compilervars.sh intel64 && set -e
- cd /builds/fleur/fleur; FC=mpiifort FLEUR_LIBRARIES="-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64" ./configure.sh -l intel AUTO ; cd build.intel; make
# only:
# - schedules
# - triggers
# - web
test-intel:
image: iffregistry.fz-juelich.de/docker-images/centos7-intel-compilers/extended
stage: test-intel
cache:
paths:
- build.intel
script:
- set +e && source compilervars.sh intel64 && set -e
- cd /builds/fleur/fleur/build.intel;ctest
# only:
# - schedules
# - web
# - triggers
......@@ -2,7 +2,7 @@ MODULE m_cdnval
use m_juDFT
CONTAINS
SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,sliceplot,noco, input,banddos,cell,atoms,enpara,stars,&
vacuum,dimension, sphhar, sym,obsolete, igq_fft,vr, vz, oneD, n_mmp,results, qpw,rhtxy,&
vacuum,dimension,sphhar,sym,obsolete,igq_fft,vr,vz,oneD,coreSpecInput,n_mmp,results, qpw,rhtxy,&
rho,rht,cdom,cdomvz,cdomvxy,qvac,qvlay,qa21, chmom,clmom)
!
! ***********************************************************
......@@ -110,6 +110,8 @@ CONTAINS
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_coreSpecInput),INTENT(IN) :: coreSpecInput
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: eig_id,jspin
......@@ -132,6 +134,7 @@ CONTAINS
#ifdef CPP_MPI
INCLUDE 'mpif.h'
logical :: mpi_flag, mpi_status
#endif
! .. Local Scalars ..
TYPE(t_lapw):: lapw
......@@ -197,6 +200,7 @@ CONTAINS
TYPE (t_lo21), ALLOCATABLE :: lo21(:,:)
TYPE (t_usdus) :: usdus
TYPE (t_zMat) :: zMat
INTEGER :: nkpt_extended
zmat%l_real=sym%invs.AND.(.NOT.noco%l_soc).AND.(.NOT.noco%l_noco)
! ..
......@@ -327,11 +331,13 @@ CONTAINS
ENDIF
! calculation of core spectra (EELS) initializations -start-
CALL corespec_init(atoms)
CALL corespec_init(input,atoms,coreSpecInput)
IF(l_cs.AND.(mpi%isize.NE.1)) CALL juDFT_error('EELS + MPI not implemented', calledby = 'cdnval')
IF(l_cs.AND.jspin.EQ.1) CALL corespec_gaunt()
! calculation of core spectra (EELS) initializations -end-
ALLOCATE ( kveclo(atoms%nlotot) )
IF (mpi%irank==0) THEN
WRITE (6,FMT=8000) jspin
......@@ -345,6 +351,10 @@ CONTAINS
mpi%irank,mpi%isize,jspin,dimension%jspd,&
noco%l_noco,&
ello,evac,epar,wk,n_bands,n_size)
#ifdef CPP_MPI
! Sinchronizes the RMA operations
CALL MPI_BARRIER(mpi%mpi_comm,ie)
#endif
!+lo
!---> if local orbitals are used, the eigenvector has a higher
......@@ -371,7 +381,7 @@ CONTAINS
DO n = 1,atoms%ntype
IF (input%cdinf.AND.mpi%irank==0) WRITE (6,FMT=8001) n
DO l = 0,atoms%lmax(n)
DO ispin = jsp_start,jsp_end
DO ispin =jsp_start,jsp_end
CALL radfun(&
l,n,ispin,epar(l,n,ispin),vr(1,0,n,ispin),atoms,&
f(1,1,l,ispin),g(1,1,l,ispin),usdus,&
......@@ -471,9 +481,18 @@ CONTAINS
END IF
ALLOCATE ( we(dimension%neigd) )
i_rec = 0 ; n_rank = 0
DO ikpt = 1,kpts%nkpt
! For k-point paralelization:
! the number of iterations is adjusted to the number of MPI processes to synchronize RMA operations
if (l_evp) then
nkpt_extended = kpts%nkpt
else
nkpt_extended = (kpts%nkpt / mpi%isize + 1) * mpi%isize
endif
DO ikpt = 1,nkpt_extended
i_rec = i_rec + 1
IF ((mod(i_rec-1,mpi%isize).EQ.mpi%irank).OR.l_evp) THEN
IF ( ikpt < kpts%nkpt + 1) THEN
!-t3e
we=0.0
!---> determine number of occupied bands and set weights (we)
......@@ -870,6 +889,12 @@ CONTAINS
ELSE
DEALLOCATE (zMat%z_c)
END IF
ELSE !(ikpt < nkpt + 1)
#ifdef CPP_MPI
! Synchronizes the RMA operations
CALL MPI_BARRIER(mpi%mpi_comm,ie)
#endif
END IF
END IF ! --> end "IF ((mod(i_rec-1,mpi%isize).EQ.mpi%irank).OR.l_evp) THEN"
END DO !---> end of k-point loop
DEALLOCATE (we,f,g,usdus%us,usdus%dus,usdus%duds,usdus%uds,usdus%ddn)
......@@ -997,7 +1022,7 @@ CONTAINS
!---> forces of equ. A8 of Yu et al.
IF ((input%l_f)) THEN
CALL timestart("cdnval: force_a8")
CALL force_a8(input,atoms,sphhar, ispin, vr,rho,&
CALL force_a8(input,atoms,sphhar, ispin, vr(:,:,:,ispin),rho,&
f_a12,f_a21,f_b4,f_b8,results%force)
CALL timestop("cdnval: force_a8")
END IF
......
......@@ -38,7 +38,7 @@ include(wannier/CMakeLists.txt)
include(wannier/uhu/CMakeLists.txt)
set(inpgen_F77
global/constants.f inpgen/element.f inpgen/atom_input.f inpgen/crystal.f inpgen/lattice2.f inpgen/setab.f inpgen/super_check.f
inpgen/element.f inpgen/atom_input.f inpgen/crystal.f inpgen/lattice2.f inpgen/setab.f inpgen/super_check.f
inpgen/atom_sym.f inpgen/generator.f inpgen/read_record.f inpgen/soc_or_ssdw.f inpgen/symproperties.f
inpgen/bravais_symm.f inpgen/set_atom_core.f inpgen/spg_gen.f global/triang.f
inpgen/closure.f inpgen/lapw_input.f inpgen/struct_input.f inpgen/write_struct.f
......
......@@ -21,4 +21,4 @@ string(STRIP ${git_hash} git_hash)
string(STRIP ${git_describe} git_describe)
string(STRIP ${git_branch} git_branch)
file(GENERATE OUTPUT ${CMAKE_SOURCE_DIR}/init/compileinfo.h CONTENT "gitdesc=\"${git_describe}\"\ncompile_date=\"${compile_time}\"\ncompile_user=\"${compile_user}\"\ncompile_host=\"${compile_host}\"\ngitbranch=\"${git_branch}\"\ngithash=\"${git_hash}\"\n")
file(GENERATE OUTPUT ${CMAKE_SOURCE_DIR}/init/compileinfo.h CONTENT "gitdesc=\"${git_describe}\"\ncompile_date=\"${compile_time}\"\ncompile_user=\"${compile_user}\"\ncompile_host=\"${compile_host}\"\ngitbranch=\"${git_branch}\"\ngithash=\"${git_hash}\"\ncompile_flags=\"${CMAKE_Fortran_FLAGS}\"\nlink_flags=\"${FLEUR_LIBRARIES}\"\n")
......@@ -2,11 +2,11 @@
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
message("Intel Fortran detected")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "14.1.0.0")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -openmp")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -openmp -assume byterecl")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -qopenmp")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -qopenmp -assume byterecl")
endif()
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -xHost -O4")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -xHost -O2")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -CB ")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
message("PGI Fortran detected")
......
......@@ -5,15 +5,12 @@
#to overwrite previous settings
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set_source_files_properties(io/eig66_mpi.F90 PROPERTIES COMPILE_FLAGS -O0)
set_source_files_properties(cdn/pwden.F90 PROPERTIES COMPILE_FLAGS -O0)
set_source_files_properties(eigen/apws.F90 PROPERTIES COMPILE_FLAGS -O0)
set_source_files_properties(init/lhcal.f PROPERTIES COMPILE_FLAGS -O0)
#set_source_files_properties(io/eig66_mpi.F90 PROPERTIES COMPILE_FLAGS -O0)
#set_source_files_properties(cdn/pwden.F90 PROPERTIES COMPILE_FLAGS -O0)
#set_source_files_properties(eigen/apws.F90 PROPERTIES COMPILE_FLAGS -O0)
#set_source_files_properties(init/lhcal.f PROPERTIES COMPILE_FLAGS -O0)
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "14.1.0.0")
set_source_files_properties(vgen/vmtxcg.F90 PROPERTIES COMPILE_FLAGS -no-openmp)
endif()
endif()
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set_source_files_properties(vgen/vmts.F90 -O0)
endif()
......@@ -32,12 +32,15 @@ LINK_LIBRARIES ${FLEUR_LIBRARIES})
try_compile(FLEUR_USE_ELPA_201605003 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA_201605003.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})
try_compile(FLEUR_USE_ELPA_201605004 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA_201605004.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})
try_compile(FLEUR_USE_ELPA_201705003 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_ELPA_201705003.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES})
message("Version check for ELPA:")
message("OLD ELPA : ${FLEUR_USE_ELPA_OLD}")
message("NEW ELPA : ${FLEUR_USE_ELPA_NEW}")
message("201605003 ELPA: ${FLEUR_USE_ELPA_201605003}")
message("201605004 ELPA: ${FLEUR_USE_ELPA_201605004}")
message("201705003 ELPA: ${FLEUR_USE_ELPA_201705003}")
#Set preprocessor switches
if (FLEUR_USE_ELPA_OLD)
set(FLEUR_USE_ELPA TRUE)
......@@ -55,4 +58,8 @@ LINK_LIBRARIES ${FLEUR_LIBRARIES})
set(FLEUR_USE_ELPA TRUE)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_ELPA" "CPP_ELPA2" "CPP_ELPA_201605004")
endif()
if (FLEUR_USE_ELPA_201705003)
set(FLEUR_USE_ELPA TRUE)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_ELPA" "CPP_ELPA2" "CPP_ELPA_201705003")
endif()
endif()
program test
use elpa
implicit none
class(elpa_t),pointer :: elpa1
integer :: success,na
call elpa1%set("na",na,success)
end
......@@ -4,7 +4,18 @@ try_compile(FLEUR_USE_WANN4 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/
)
message("Wannier90-4 1.2 Library found:${FLEUR_USE_WANN4}")
if (DEFINED ENV{FLEUR_USE_WANNIER})
if (ENV{FLEUR_USE_WANNIER})
if (NOT FLEUR_USE_WANN4)
message(FATAL_ERROR "You asked for Wannier90 but cmake couldn't find it. Please check your Fortran compiler settings")
endif()
else()
if (FLEUR_USE_WANN4)
message("Wannier library found, but you explicitely asked not to use it")
set(FLEUR_USE_WANN4 FALSE)
endif()
endif()
endif()
if (FLEUR_USE_WANN4)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_WANN4")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_WANN4")
......
......@@ -4,7 +4,18 @@ try_compile(FLEUR_USE_WANN5 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/
)
message("Wannier90-5 1.2 Library found:${FLEUR_USE_WANN5}")
if (DEFINED ENV{FLEUR_USE_WANNIER})
if (ENV{FLEUR_USE_WANNIER})
if (NOT FLEUR_USE_WANN5)
message(FATAL_ERROR "You asked for Wannier90 but cmake couldn't find it. Please check your Fortran compiler settings")
endif()
else()
if (FLEUR_USE_WANN5)
message("Wannier library found, but you explicitely asked not to use it")
set(FLEUR_USE_WANN5 FALSE)
endif()
endif()
endif()
if (FLEUR_USE_WANN5)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_WANN5")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_WANN5")
......
......@@ -5,6 +5,19 @@ try_compile(FLEUR_USE_WANN ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/t
message("Wannier90 1.2 Library found:${FLEUR_USE_WANN}")
if (DEFINED ENV{FLEUR_USE_WANNIER})
if (ENV{FLEUR_USE_WANNIER})
if (NOT FLEUR_USE_WANN)
message(FATAL_ERROR "You asked for Wannier90 but cmake couldn't find it. Please check your Fortran compiler settings")
endif()
else()
if (FLEUR_USE_WANN)
message("Wannier library found, but you explicitely asked not to use it")
set(FLEUR_USE_WANN FALSE)
endif()
endif()
endif()
if (FLEUR_USE_WANN)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_WANN")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_WANN")
......
......@@ -55,9 +55,6 @@ CONTAINS
RETURN
ENDIF
IF (atoms%zatom(itype)>92.01e0) CALL juDFT_error(" z > 92",calledby ="setcor"&
& )
jz0 = atoms%zatom(itype) + 0.01e0
jz = jz0
k = 0
......@@ -238,6 +235,9 @@ CONTAINS
occ(n,2) = atoms%coreStateOccs(n,2,itype)
END IF
END DO
ELSE
IF (atoms%zatom(itype)>92.01e0) CALL juDFT_error(" z > 92",calledby ="setcor")
END IF
END SUBROUTINE setcor
......
......@@ -5,6 +5,10 @@
!--------------------------------------------------------------------------------
MODULE m_elpa
PRIVATE
#ifdef CPP_ELPA
interface elpa_diag
module procedure elpa_r,elpa_c
end interface elpa_diag
!Module to call elpa library for parallel diagonalization
!uses ssubredist1/2 for redistribution
......@@ -12,7 +16,6 @@ MODULE m_elpa
PUBLIC elpa_diag
CONTAINS
#ifdef CPP_ELPA
! First the real version of the code
#define CPP_CHOLESKY cholesky_real
#define CPP_invert_trm invert_trm_real
......@@ -125,9 +128,9 @@ CONTAINS
!print *,"priv_create_blacsgrid"
! determine block size
!
nb = 20
IF (m.GT.2048) nb = 30 !2
IF (m.GT.8*2048) nb = 60 !4
nb = 64
!IF (m.GT.2048) nb = 30 !2
!IF (m.GT.8*2048) nb = 60 !4
! compute processor grid, as square as possible
! If not square with more rows than columns
......@@ -197,7 +200,10 @@ CONTAINS
!Create communicators for ELPA
!print *,"creating ELPA comms"
#if defined (CPP_ELPA_201605004) || defined (CPP_ELPA_201605003)||defined(CPP_ELPA_NEW)
#if defined (CPP_ELPA_201705003)
mpi_comm_rows = -1
mpi_comm_cols = -1
#elif defined (CPP_ELPA_201605004) || defined (CPP_ELPA_201605003)||defined(CPP_ELPA_NEW)
ierr=get_elpa_row_col_comms(mpi_subcom, myrowblacs, mycolblacs,mpi_comm_rows, mpi_comm_cols)
#else
CALL get_elpa_row_col_comms(mpi_subcom, myrowblacs, mycolblacs,mpi_comm_rows, mpi_comm_cols)
......@@ -209,6 +215,8 @@ CONTAINS
IF (ierr /=0 ) CALL juDFT_error('descinit1 failed',calledby='elpa')
END SUBROUTINE priv_create_blacsgrid
#else
LOGICAL :: elpa_used=.false.
#endif
end MODULE m_elpa
......@@ -10,7 +10,10 @@
#ifdef CPP_ELPA2
USE elpa2
#endif
IMPLICIT NONE
#ifdef CPP_ELPA_201705003
USE elpa
#endif
IMPLICIT NONE
INCLUDE 'mpif.h'
INTEGER, INTENT (IN) :: m
......@@ -37,10 +40,38 @@
CPP_REALCOMPLEX, ALLOCATABLE :: asca(:,:), bsca(:,:),tmp2(:,:)
CPP_REALCOMPLEX, ALLOCATABLE :: eigvec(:,:)
INTEGER, EXTERNAL :: numroc, indxl2g !SCALAPACK functions
#ifdef CPP_ELPA_201705003
INTEGER :: kernel
CLASS(elpa_t),pointer :: elpa_obj
err = elpa_init(20170403)
elpa_obj => elpa_allocate()
#endif
num2=num
CALL priv_create_blacsgrid(sub_comm,m, np,nb,myid,npcol,nprow,mycol,myrow,myrowssca,mycolssca,&
ictextblacs,sc_desc,mpi_comm_rows,mpi_comm_cols)
#ifdef CPP_ELPA_201705003
CALL elpa_obj%set("na", m, err)
CALL elpa_obj%set("nev", num2, err)
CALL elpa_obj%set("local_nrows", myrowssca, err)
CALL elpa_obj%set("local_ncols", mycolssca, err)
CALL elpa_obj%set("nblk", nb, err)
CALL elpa_obj%set("mpi_comm_parent", sub_comm, err)
CALL elpa_obj%set("process_row", myrow, err)
CALL elpa_obj%set("process_col", mycol, err)
#ifdef CPP_ELPA2
CALL elpa_obj%set("solver", ELPA_SOLVER_2STAGE)
#else
CALL elpa_obj%set("solver", ELPA_SOLVER_1STAGE)
#endif
err = elpa_obj%setup()
if (myid == 0) then
call elpa_obj%get("complex_kernel", kernel)
print *, "elpa uses " // elpa_int_value_to_string("complex_kernel", kernel) // " kernel"
endif
#endif
! Number of columns the local process gets in ScaLAPACK distribution
ALLOCATE ( asca(myrowssca,mycolssca), stat=err )
......@@ -84,7 +115,11 @@
! Please note: cholesky_complex/invert_trm_complex are not trimmed for speed.
! The only reason having them is that the Scalapack counterpart
! PDPOTRF very often fails on higher processor numbers for unknown reasons!
#if defined(CPP_ELPA_201605003) || defined(CPP_ELPA_201605004)
#if defined(CPP_ELPA_201705003)
CALL elpa_obj%cholesky(bsca, err)
CALL elpa_obj%invert_triangular(bsca, err)
#elif defined(CPP_ELPA_201605003) || defined(CPP_ELPA_201605004)
ok=CPP_CHOLESKY (m,bsca,SIZE(bsca,1),nb,mycolssca,mpi_comm_rows,mpi_comm_cols,.false.)
ok=CPP_invert_trm(m,bsca,SIZE(bsca,1),nb,mycolssca,mpi_comm_rows,mpi_comm_cols,.false.)
#elif defined CPP_ELPA_NEW
......@@ -109,22 +144,28 @@
n_row = numroc (n_col, nb, myrow, 0, nprow)
asca(n_row+1:myrowssca,i) = eigvec(n_row+1:myrowssca,i)
ENDDO
#ifdef CPP_ELPA_201605004
#if defined (CPP_ELPA_201705003)
CALL elpa_obj%hermitian_multiply('U','L', m, bsca, asca, myrowssca, mycolssca, eigvec, myrowssca, mycolssca, err)
#elif defined (CPP_ELPA_201605004)
ok=CPP_mult ('U', 'L',m, m,bsca,myrowssca,mycolssca,asca,SIZE(asca,1),SIZE(asca,2),nb,&
mpi_comm_rows, mpi_comm_cols,eigvec,myrowssca,mycolssca)
#elif CPP_ELPA_201605003
#elif defined (CPP_ELPA_201605003)
ok=CPP_mult ('U', 'L',m, m,bsca,myrowssca,asca,SIZE(asca,1),nb, mpi_comm_rows, mpi_comm_cols,eigvec,myrowssca)
#else
CALL CPP_mult ('U', 'L',m, m,bsca,myrowssca,asca,SIZE(asca,1),nb, mpi_comm_rows, mpi_comm_cols,eigvec,myrowssca)
#endif
! 2b. tmp2 = eigvec**T
CALL CPP_transpose(m,m,CPP_ONE,eigvec,1,1,sc_desc,CPP_ZERO,tmp2,1,1,sc_desc)
! 2c. A = U**-T * tmp2 ( = U**-T * Aorig * U**-1 )
#ifdef CPP_ELPA_201605004
#if defined (CPP_ELPA_201705003)
CALL elpa_obj%hermitian_multiply('U','U', m, bsca, tmp2, myrowssca, mycolssca, asca, myrowssca, mycolssca, err)
#elif defined (CPP_ELPA_201605004)
ok=CPP_mult ('U', 'U', m, m, bsca, SIZE(bsca,1),SIZE(bsca,2), tmp2,&
SIZE(tmp2,1),SIZE(tmp2,2),nb, mpi_comm_rows, mpi_comm_cols, asca, SIZE(asca,1),SIZE(asca,2))
#elif CPP_ELPA_201605003
#elif defined (CPP_ELPA_201605003)
ok=CPP_mult ('U', 'U', m, m, bsca, SIZE(bsca,1), tmp2,&
SIZE(tmp2,1),nb, mpi_comm_rows, mpi_comm_cols, asca, SIZE(asca,1))
#else
......@@ -132,7 +173,6 @@
SIZE(tmp2,1),nb, mpi_comm_rows, mpi_comm_cols, asca, SIZE(asca,1))
#endif
! A is only set in the upper half, solve_evp_real needs a full matrix
! Set lower half from upper half
......@@ -149,8 +189,9 @@
! 3. Calculate eigenvalues/eigenvectors of U**-T * A * U**-1
! Eigenvectors go to eigvec
num2=num
#if defined(CPP_ELPA_201605003) || defined(CPP_ELPA_201605004)
#if defined (CPP_ELPA_201705003)
CALL elpa_obj%eigenvectors(asca, eig2, eigvec, err)
#elif defined(CPP_ELPA_201605003) || defined(CPP_ELPA_201605004)
#ifdef CPP_ELPA2
ok=CPP_solve_evp_2stage(m,num2,asca,SIZE(asca,1),&
eig2,eigvec,SIZE(asca,1), nb,mycolssca, mpi_comm_rows, mpi_comm_cols,sub_comm)
......@@ -181,7 +222,9 @@
! mult_ah_b_complex needs the transpose of U**-1, thus tmp2 = (U**-1)**T
CALL CPP_transpose(m,m,CPP_ONE,bsca,1,1,sc_desc,CPP_ZERO,tmp2,1,1,sc_desc)
#ifdef CPP_ELPA_201605004
#if defined (CPP_ELPA_201705003)
CALL elpa_obj%hermitian_multiply('L','N', num2, tmp2, eigvec, myrowssca, mycolssca, asca, myrowssca, mycolssca, err)
#elif defined (CPP_ELPA_201605004)
ok= CPP_mult ('L', 'N',m, num2, tmp2, SIZE(asca,1),SIZE(asca,2),&
eigvec, SIZE(asca,1),SIZE(asca,2),nb,mpi_comm_rows, mpi_comm_cols, asca, SIZE(asca,1),SIZE(asca,2))
#elif CPP_ELPA_201605003
......@@ -191,10 +234,17 @@
CALL CPP_mult ('L', 'N',m, num2, tmp2, SIZE(asca,1),&
eigvec, SIZE(asca,1),nb,mpi_comm_rows, mpi_comm_cols, asca, SIZE(asca,1))
#endif
#if defined (CPP_ELPA_201705003)
CALL elpa_deallocate(elpa_obj)
CALL elpa_uninit()
#endif
! END of ELPA stuff
CALL BLACS_GRIDEXIT(ictextblacs,ierr)
#if ( !defined (CPP_ELPA_201705003))
CALL MPI_COMM_FREE(mpi_comm_rows,ierr)
CALL MPI_COMM_FREE(mpi_comm_cols,ierr)
#endif
!print *,"elpa done"
!
......@@ -226,4 +276,4 @@
DEALLOCATE ( asca )
DEALLOCATE ( bsca )
DEALLOCATE (eigvec, tmp2, eig2)
/*
Copyright (c) 2014, Daniel Wortmann
All rights reserved.