Commit 1d2fa7e7 authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' into relaxation

Conflicts:
	main/totale.f90
	tests/tests/GaAsMultiUForceXML/test.run3
	types/types_setup.F90
parents 8cdb3813 6f03ad1e
......@@ -6,7 +6,6 @@ Testing/*
build
build.*
*.o
*.mod
*.x
*.swp
tags
......@@ -5,6 +5,7 @@ stages:
- deploy
- build-pgi
- test-pgi
- build-intel-static
- build-intel
- test-intel
......@@ -65,42 +66,64 @@ pages:
- triggers
- web
#build-pgi:
# image: iffregistry.fz-juelich.de/fleur/fleur:pgi
# stage: build-pgi
# cache:
# paths:
# - build.debug
# script:
# - cd /builds/fleur/fleur; ./configure.sh -d AUTO ; cd build.debug; make
# only:
# - schedules
# - triggers
# - web
build-pgi:
image: iffregistry.fz-juelich.de/fleur/fleur:pgi
stage: build-pgi
cache:
paths:
- build.pgi
script:
- cd /builds/fleur/fleur; ./configure.sh -l pgi ; cd build.pgi; make
only:
- schedules
- triggers
- web
#test-pgi:
# image: iffregistry.fz-juelich.de/fleur/fleur:pgi
# stage: test-pgi
# cache:
# paths:
# - build.debug
# script:
# - cd /builds/fleur/fleur/build.debug;ctest
# only:
# - schedules
# - web
# - triggers
test-pgi:
image: iffregistry.fz-juelich.de/fleur/fleur:pgi
stage: test-pgi
cache:
paths:
- build.pgi
script:
- cd /builds/fleur/fleur/build.pgi;ctest
only:
- schedules
- web
- triggers
build-intel-static:
image: iffregistry.fz-juelich.de/fleur/fleur:intel-static
stage: build-intel-static
cache:
paths:
- build.intel-static
script:
- set +e && source compilervars.sh intel64 && set -e ; ulimit -s unlimited
- cd /builds/fleur/fleur; ./configure.sh -l intel-static INTEL_DOCKER_STATIC ; cd build.intel-static; make -j 4
artifacts:
when: on_success
paths:
- build.intel-static/fleur
- build.intel-static/fleur_MPI
- build.intel-static/inpgen
only:
- schedules
- triggers
- web
build-intel:
image: iffregistry.fz-juelich.de/docker-images/centos7-intel-compilers/extended
image: iffregistry.fz-juelich.de/fleur/fleur:intel-static
stage: build-intel
cache:
paths:
- build.intel
- build.intel.debug
script:
- set +e && source compilervars.sh intel64 && set -e ; ulimit -s unlimited
- cd /builds/fleur/fleur; FC=mpiifort FLEUR_LIBRARIES="-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64" ./configure.sh -t -l intel INTEL_MPI ; cd build.intel; make -j 4
- cd /builds/fleur/fleur; CC=gcc FC=mpiifort FLEUR_LIBRARIES="-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64" ./configure.sh -t -d -l intel INTEL_MPI ; cd build.intel.debug; make -j 4
only:
- schedules
- triggers
......@@ -108,19 +131,19 @@ build-intel:
test-intel:
image: iffregistry.fz-juelich.de/docker-images/centos7-intel-compilers/extended
image: iffregistry.fz-juelich.de/fleur/fleur:intel-static
stage: test-intel
cache:
paths:
- build.intel
- build.intel.debug
script:
- set +e && source compilervars.sh intel64 && set -e; ulimit -s unlimited
- cd /builds/fleur/fleur/build.intel;ctest
- cd /builds/fleur/fleur/build.intel.debug;ctest
artifacts:
when: on_failure
paths:
- build/Testing/failed
- build/Testing/test.oldlogs
- build.intel.debug/Testing/failed
- build.intel.debug/Testing/test.oldlogs
only:
- schedules
- web
......
[submodule "external/hdf5-git"]
path = external/hdf5-git
url = https://bitbucket.hdfgroup.org/scm/hdffv/hdf5.git
[submodule "external/libxc-git"]
path = external/libxc-git
url = https://gitlab.com/libxc/libxc.git
......@@ -10,12 +10,17 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${tmp}")
include("cmake/CompilerConfig.txt")
include("cmake/ReportConfig.txt")
include("cmake/Generate_Schema.cmake")
include("cmake/Files_and_Targets.txt")
include("cmake/filespecific.cmake")
include("cmake/ReportConfig.txt")
#install(TARGETS fleur inpgen DESTINATION bin)
install(PROGRAMS ${CMAKE_BINARY_DIR}/fleur
CONFIGURATIONS Debug
......
......@@ -4,7 +4,78 @@ MODULE m_cdntot
! vacuum, and mt regions c.l.fu
! ********************************************************
CONTAINS
SUBROUTINE cdntot(mpi,stars,atoms,sym,vacuum,input,cell,oneD,&
SUBROUTINE cdntot_integrate(stars,atoms,sym,vacuum,input,cell,oneD, integrand, &
q, qis, qmt, qvac, qtot, qistot)
USE m_intgr, ONLY : intgr3
USE m_constants
USE m_qsf
USE m_pwint
USE m_types
USE m_juDFT
USE m_convol
IMPLICIT NONE
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_input),INTENT(IN) :: input
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_potden),INTENT(IN) :: integrand
REAL, INTENT(out) :: q(input%jspins), qis(input%jspins), qmt(atoms%ntype,input%jspins),&
qvac(2,input%jspins), qtot, qistot
INTEGER :: jsp, j, ivac, nz, n
REAL :: q2(vacuum%nmz), w, rht1(vacuum%nmzd,2,input%jspins)
COMPLEX :: x(stars%ng3)
CALL timestart("cdntot")
qtot = 0.0
qistot = 0.0
DO jsp = 1,input%jspins
q(jsp) = 0.0
! -----mt charge
CALL timestart("MT")
DO n = 1,atoms%ntype
CALL intgr3(integrand%mt(:,0,n,jsp),atoms%rmsh(:,n),atoms%dx(n),atoms%jri(n),w)
qmt(n, jsp) = w*sfp_const
q(jsp) = q(jsp) + atoms%neq(n)*qmt(n,jsp)
ENDDO
CALL timestop("MT")
! -----vacuum region
IF (input%film) THEN
DO ivac = 1,vacuum%nvac
DO nz = 1,vacuum%nmz
IF (oneD%odi%d1) THEN
rht1(nz,ivac,jsp) = (cell%z1+(nz-1)*vacuum%delz)*&
integrand%vacz(nz,ivac,jsp)
ELSE
rht1(nz,ivac,jsp) = integrand%vacz(nz,ivac,jsp)
END IF
END DO
CALL qsf(vacuum%delz,rht1(1,ivac,jsp),q2,vacuum%nmz,0)
qvac(ivac,jsp) = q2(1)*cell%area
IF (.NOT.oneD%odi%d1) THEN
q(jsp) = q(jsp) + qvac(ivac,jsp)*2./real(vacuum%nvac)
ELSE
q(jsp) = q(jsp) + cell%area*q2(1)
END IF
ENDDO
END IF
! -----is region
qis(jsp) = 0.
CALL pwint_all(stars,atoms,sym,oneD,cell,1,stars%ng3,x)
DO j = 1,stars%ng3
qis(jsp) = qis(jsp) + integrand%pw(j,jsp)*x(j)*stars%nstr(j)
ENDDO
qistot = qistot + qis(jsp)
q(jsp) = q(jsp) + qis(jsp)
qtot = qtot + q(jsp)
END DO ! loop over spins
END SUBROUTINE cdntot_integrate
SUBROUTINE cdntot(stars,atoms,sym,vacuum,input,cell,oneD,&
den,l_printData,qtot,qistot)
USE m_intgr, ONLY : intgr3
......@@ -18,7 +89,6 @@ CONTAINS
IMPLICIT NONE
! .. Scalar Arguments ..
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym),INTENT(IN) :: sym
......@@ -32,82 +102,36 @@ CONTAINS
! .. Local Scalars ..
COMPLEX x(stars%ng3)
REAL q,qis,w,mtCharge
INTEGER i,ivac,j,jspin,n,nz
REAL q(input%jspins),qis(input%jspins),w,mtCharge
INTEGER i,ivac,j,jsp,n,nz
! ..
! .. Local Arrays ..
REAL qmt(atoms%ntype),qvac(2),q2(vacuum%nmz),rht1(vacuum%nmzd,2,input%jspins)
REAL qmt(atoms%ntype,input%jspins),qvac(2,input%jspins)
INTEGER, ALLOCATABLE :: lengths(:,:)
CHARACTER(LEN=20) :: attributes(6), names(6)
! ..
! .. Intrinsic Functions ..
INTRINSIC real
! ..
!
call cdntot_integrate(stars,atoms,sym,vacuum,input,cell,oneD, den, &
q, qis, qmt, qvac, qtot, qistot)
IF (input%film) THEN
ALLOCATE(lengths(4+vacuum%nvac,2))
ELSE
ALLOCATE(lengths(4,2))
END IF
CALL timestart("cdntot")
qtot = 0.e0
qistot = 0.e0
DO jspin = 1,input%jspins
q = 0.e0
! -----mt charge
CALL timestart("MT")
DO n = 1,atoms%ntype
CALL intgr3(den%mt(:,0,n,jspin),atoms%rmsh(:,n),atoms%dx(n),atoms%jri(n),w)
qmt(n) = w*sfp_const
q = q + atoms%neq(n)*qmt(n)
ENDDO
CALL timestop("MT")
! -----vacuum region
IF (input%film) THEN
DO ivac = 1,vacuum%nvac
DO nz = 1,vacuum%nmz
IF (oneD%odi%d1) THEN
rht1(nz,ivac,jspin) = (cell%z1+(nz-1)*vacuum%delz)*&
den%vacz(nz,ivac,jspin)
ELSE
rht1(nz,ivac,jspin) = den%vacz(nz,ivac,jspin)
END IF
END DO
CALL qsf(vacuum%delz,rht1(1,ivac,jspin),q2,vacuum%nmz,0)
qvac(ivac) = q2(1)*cell%area
IF (.NOT.oneD%odi%d1) THEN
q = q + qvac(ivac)*2./real(vacuum%nvac)
ELSE
q = q + cell%area*q2(1)
END IF
ENDDO
END IF
! -----is region
IF (.FALSE.) THEN !Change this for old way of determination of int-charge
CALL convol(stars,x,den%pw(:,jspin),stars%ufft)
qis = x(1)*cell%omtil
ELSE
qis = 0.
CALL pwint_all(stars,atoms,sym,oneD,cell,1,stars%ng3,x)
DO j = 1,stars%ng3
qis = qis + den%pw(j,jspin)*x(j)*stars%nstr(j)
ENDDO
endif
qistot = qistot + qis
q = q + qis
WRITE (6,FMT=8000) jspin,q,qis, (qmt(n),n=1,atoms%ntype)
IF (input%film) WRITE (6,FMT=8010) (i,qvac(i),i=1,vacuum%nvac)
mtCharge = SUM(qmt(1:atoms%ntype) * atoms%neq(1:atoms%ntype))
names(1) = 'spin' ; WRITE(attributes(1),'(i0)') jspin ; lengths(1,1)=4 ; lengths(1,2)=1
names(2) = 'total' ; WRITE(attributes(2),'(f14.7)') q ; lengths(2,1)=5 ; lengths(2,2)=14
names(3) = 'interstitial' ; WRITE(attributes(3),'(f14.7)') qis ; lengths(3,1)=12 ; lengths(3,2)=14
DO jsp = 1,input%jspins
WRITE (6,FMT=8000) jsp,q(jsp),qis(jsp), (qmt(n,jsp),n=1,atoms%ntype)
IF (input%film) WRITE (6,FMT=8010) (i,qvac(i,jsp),i=1,vacuum%nvac)
mtCharge = SUM(qmt(1:atoms%ntype,jsp) * atoms%neq(1:atoms%ntype))
names(1) = 'spin' ; WRITE(attributes(1),'(i0)') jsp ; lengths(1,1)=4 ; lengths(1,2)=1
names(2) = 'total' ; WRITE(attributes(2),'(f14.7)') q(jsp) ; lengths(2,1)=5 ; lengths(2,2)=14
names(3) = 'interstitial' ; WRITE(attributes(3),'(f14.7)') qis(jsp) ; lengths(3,1)=12 ; lengths(3,2)=14
names(4) = 'mtSpheres' ; WRITE(attributes(4),'(f14.7)') mtCharge ; lengths(4,1)=9 ; lengths(4,2)=14
IF(l_printData) THEN
IF(input%film) THEN
DO i = 1, vacuum%nvac
WRITE(names(4+i),'(a6,i0)') 'vacuum', i
WRITE(attributes(4+i),'(f14.7)') qvac(i)
WRITE(attributes(4+i),'(f14.7)') qvac(i,jsp)
lengths(4+i,1)=7
lengths(4+i,2)=14
END DO
......@@ -117,9 +141,7 @@ CONTAINS
CALL writeXMLElementFormPoly('spinDependentCharge',names(1:4),attributes(1:4),lengths)
END IF
END IF
qtot = qtot + q
END DO ! loop over spins
DEALLOCATE (lengths)
WRITE (6,FMT=8020) qtot
IF(l_printData) THEN
CALL writeXMLElementFormPoly('totalCharge',(/'value'/),(/qtot/),reshape((/5,20/),(/1,2/)))
......
......@@ -133,6 +133,8 @@ CONTAINS
n1 = 1
DO in = 1 , nrm
n2 = mr(in)
bsl_r = 0.0
bsl_i = 0.0
DO j = 1,atoms%jri(n1)
cprr2 = cp*atoms%rmsh(j,n1)*atoms%rmsh(j,n1)
gr = stars%sk3(k)*atoms%rmsh(j,n1)
......
......@@ -12,6 +12,7 @@ SUBROUTINE cdncore(mpi,dimension,oneD,input,vacuum,noco,sym,&
stars,cell,sphhar,atoms,vTot,outDen,moments,results)
USE m_constants
USE m_judft
USE m_cdn_io
USE m_cdnovlp
USE m_cored
......
......@@ -12,8 +12,8 @@ include("cmake/tests/test_HDF5.cmake")
include("cmake/tests/test_Wannier90.cmake")
include("cmake/tests/test_Wannier4.cmake")
include("cmake/tests/test_Wannier5.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_LibXC.cmake")
include("cmake/tests/test_ELPA_onenode.cmake")
if (FLEUR_USE_MPI)
......@@ -22,4 +22,6 @@ include("cmake/tests/test_ELPA.cmake")
include("cmake/tests/test_ChASE.cmake")
endif()
include("cmake/tests/test_juDFT.cmake")
include("cmake/compileenv.txt")
......@@ -20,7 +20,6 @@ include(xc-pot/CMakeLists.txt)
include(cdn/CMakeLists.txt)
include(diagonalization/CMakeLists.txt)
include(eigen_soc/CMakeLists.txt)
include(juDFT/CMakeLists.txt)
include(math/CMakeLists.txt)
include(orbdep/CMakeLists.txt)
include(cdn_mt/CMakeLists.txt)
......@@ -54,15 +53,14 @@ inpgen/lapw_input.f inpgen/struct_input.f inpgen/write_struct.f
io/calculator.f global/ss_sym.f global/soc_sym.f math/inv3.f io/rw_symfile.f
kpoints/kptgen_hybrid.f kpoints/od_kptsgen.f kpoints/bravais.f kpoints/divi.f kpoints/brzone.f
kpoints/kptmop.f kpoints/kpttet.f init/bandstr1.F kpoints/ordstar.f kpoints/fulstar.f kpoints/kprep.f
kpoints/tetcon.f kpoints/kvecon.f init/boxdim.f global/radsra.f math/intgr.F global/differ.f math/inwint.f
math/outint.f math/grule.f
)
kpoints/tetcon.f kpoints/kvecon.f init/boxdim.f global/radsra.f global/differ.f math/inwint.f
math/outint.f math/grule.f )
set(inpgen_F90 ${inpgen_F90} global/constants.f90 io/xsf_io.f90
eigen/orthoglo.F90 juDFT/usage_data.F90 math/ylm4.F90
global/sort.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 juDFT/juDFT.F90 global/find_enpara.f90
inpgen/closure.f90 inpgen/inpgen_arguments.F90
juDFT/info.F90 juDFT/stop.F90 juDFT/args.F90 juDFT/time.F90 juDFT/init.F90 juDFT/sysinfo.F90 juDFT/string.f90 io/w_inpXML.f90 kpoints/julia.f90 global/utility.F90
eigen/orthoglo.F90 math/ylm4.F90 mpi/mpi_bc_tool.F90
global/sort.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 global/find_enpara.f90
inpgen/closure.f90 math/intgr.F90
io/w_inpXML.f90 kpoints/julia.f90 global/utility.F90
init/compile_descr.F90 kpoints/kpoints.f90 io/xmlOutput.F90 kpoints/brzone2.f90 cdn/slab_dim.f90 cdn/slabgeom.f90 dos/nstm3.f90 cdn/int_21.f90
cdn/int_21lo.f90 cdn_mt/rhomt21.f90 cdn_mt/rhonmt21.f90 force/force_a21.F90 force/force_a21_lo.f90 force/force_a21_U.f90 force/force_a12.f90
eigen/tlmplm_store.F90 xc-pot/gaunt.f90 kpoints/unfoldBandKPTS.f90)
......@@ -74,36 +72,44 @@ set_source_files_properties(${fleur_F77} PROPERTIES Fortran_FORMAT FIXED)
set_source_files_properties(${inpgen_F90} PROPERTIES Fortran_FORMAT FREE)
set_source_files_properties(${inpgen_F77} PROPERTIES Fortran_FORMAT FIXED)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FLEUR_PRECISION_OPTION}")
if (${FLEUR_USE_SERIAL})
#Serial executables
add_executable(fleur ${fleur_SRC} ${c_filesFleur})
target_compile_definitions(fleur PUBLIC ${FLEUR_DEFINITIONS})
target_link_libraries(fleur ${FLEUR_LIBRARIES})
set_target_properties(fleur PROPERTIES Fortran_MODULE_DIRECTORY fleur_modules COMPILE_OPTIONS -Ifleur_modules)
#inpgen executable
add_executable(inpgen ${inpgen_F77} ${inpgen_F90} ${juDFT_SRC_F90} ${c_filesInpgen})
target_compile_definitions(inpgen PUBLIC ${FLEUR_DEFINITIONS})
target_link_libraries(inpgen ${FLEUR_LIBRARIES})
set_target_properties(inpgen PROPERTIES Fortran_MODULE_DIRECTORY inpgen_modules COMPILE_OPTIONS -Iinpgen_modules)
target_link_libraries(fleur juDFT)
set_target_properties(fleur PROPERTIES Fortran_MODULE_DIRECTORY modules/fleur COMPILE_OPTIONS -Imodules/fleur)
endif()
#parallel executables
if(${FLEUR_USE_MPI})
#fleur_MPI
add_executable(fleur_MPI ${juDFT_HDF} ${juDFT_SRC_F90} ${fleur_SRC} ${c_filesFleur} ${fleur_SRC_MPI})
target_compile_definitions(fleur_MPI PUBLIC ${FLEUR_MPI_DEFINITIONS})
target_compile_options(fleur_MPI PUBLIC ${FLEUR_PRECISION_OPTION})
target_link_libraries(fleur_MPI ${FLEUR_LIBRARIES})
set_target_properties(fleur_MPI PROPERTIES Fortran_MODULE_DIRECTORY fleur_MPI_modules COMPILE_OPTIONS -Ifleur_MPI_modules)
target_link_libraries(fleur_MPI juDFT)
set_target_properties(fleur_MPI PROPERTIES Fortran_MODULE_DIRECTORY modules/fleur_MPI COMPILE_OPTIONS -Imodules/fleur_MPI)
endif ()
#inpgen executable
add_executable(inpgen ${inpgen_F77} ${inpgen_F90} ${juDFT_SRC_F90} ${c_filesInpgen})
target_compile_definitions(inpgen PUBLIC ${FLEUR_DEFINITIONS})
target_compile_options(inpgen PUBLIC ${FLEUR_PRECISION_OPTION})
target_link_libraries(inpgen ${FLEUR_LIBRARIES})
target_link_libraries(inpgen juDFT)
set_target_properties(inpgen PROPERTIES Fortran_MODULE_DIRECTORY modules/inpgen COMPILE_OPTIONS -Imodules/inpgen)
if (${FLEUR_USE_SERIAL})
install(TARGETS fleur inpgen
CONFIGURATIONS Release
DESTINATION bin)
endif()
if (${FLEUR_USE_MPI})
install(TARGETS fleur_MPI
CONFIGURATIONS Release
DESTINATION bin)
endif()
#if (${FLEUR_USE_SERIAL})
#install(TARGETS fleur inpgen
# CONFIGURATIONS Release
# DESTINATION bin)
#endif()
#if (${FLEUR_USE_MPI})
#install(TARGETS fleur_MPI
# CONFIGURATIONS Release
# DESTINATION bin)
#endif()
#cmake file to set compiler flags for some of the known compilers
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
message("Intel Fortran detected")
set(FLEUR_PRECISION_OPTION "-r8")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "13.0.0.0")
set(FLEUR_WARN_MESSAGE "You are using an old version of the Intel Fortran Compiler. Most likely FLEUR will not be build sucessfully. Consider to upgrade your compiler.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -openmp -assume byterecl")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -openmp -assume byterecl")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_OLDINTEL")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_OLDINTEL")
elseif (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "14.1.0.0")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -openmp -assume byterecl")
set(FLEUR_WARN_MESSAGE "You are using an old version of the Intel Fortran Compiler. The execution of the fleur_MPI might fail. Consider to upgrade your compiler.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -openmp -assume byterecl")
elseif (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "17.0.0.0")
set(FLEUR_WARN_MESSAGE "You are using an old version of the Intel Fortran Compiler. The execution of the fleur_MPI might fail. Consider to upgrade your compiler.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -qopenmp -assume byterecl")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -qopenmp -assume byterecl")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -qopenmp -assume byterecl")
endif()
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -xHost -O2 -g")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -CB -DCPP_DEBUG")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "19.0.0.0")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -DCPP_DEBUG")
else()
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -CB -traceback -O0 -g -ftrapuv -check uninit -check pointers -DCPP_DEBUG")
endif()
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set(FLEUR_PRECISION_OPTION "-Mr8;-Mr8intrinsics")
message("PGI Fortran detected")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") #fix problem in cmake
#CPU
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp")
#GPU
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics -Mcuda=cuda9.0,cc60 -Mcudalib=cublas")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics -Mcuda:kepler+ -ta:tesla:cuda7.5 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics -Mcuda:cuda9.0,cc70 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mcuda=cuda9.0,cc60 -Mcudalib=cublas")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mcuda:kepler+ -ta:tesla:cuda7.5 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mcuda:cuda9.0,cc70 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc")
#set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fast -O3")
set(CMAKE_Fortran_FLAGS_RELEASE "-O1 ") # to prevent cmake from putting -fast which auses problems with PGI18.4
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -Mchkstk -Mchkptr -Ktrap=fp -DCPP_DEBUG")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "XL")
message("IBM/BG Fortran detected")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qsmp=omp -qnosave -qarch=qp -qtune=qp -qrealsize=8 -qfixed -qsuppress=1520-022 -qessl")
set(FLEUR_PRECISION_OPTION "-qrealsize=8")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qsmp=omp -qnosave -qarch=qp -qtune=qp -qfixed -qsuppress=1520-022 -qessl")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O4 -qsuppress=1500-036")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g -DCPP_DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/bgsys/local/libxml2/include/libxml2")
......@@ -35,10 +46,11 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "XL")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_AIX")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
message("gfortran detected")
set(FLEUR_PRECISION_OPTION "-fdefault-real-8")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "6.1.0")
message(FATAL_ERROR "Only modern versions of gfortran >6.3 will be able to compile FLEUR\nYou need to specify a different compiler.\nSee the docs at www.flapw.de.\n")
endif()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -fopenmp -fdefault-real-8 ")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -fopenmp ")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O2")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fdump-core -Wall -Wextra -Warray-temporaries -fbacktrace -fcheck=all -finit-real=nan -O0 -g -DCPP_DEBUG")
endif()
......@@ -25,4 +25,11 @@
FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $ELPA_MODULES"
fi
#MAGMA
if [ $MAGMADIR ]
then
CLI_USE_MAGMA=1
FLEUR_LIBDIR="$FLEUR_LIBDIR $MAGMALIB $MKLROOT/lib/intel64"
FLEUR_INCLUDEDIR="$FLEUR_INCLUDEDIR $MAGMADIR/include $MKLROOT/include"
fi
#Set the compilers to mpiifort, mpiicc, mpiicpc
export FC=${FC:=mpiifort}
export CC=${CC:=gcc}
export CXX=${CXX:=mpiicpc}
#Special flags for docker image
export FLEUR_LIBRARIES="/usr/local/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group /usr/local/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64/libmkl_intel_lp64.a /usr/local/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64/libmkl_intel_thread.a /usr/local/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64/libmkl_core.a /usr/local/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a /usr/local/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libiomp5.a -Wl,--end-group -Wl,-Bstatic -liomp5 -lxml2 -lz -llzma -Wl,-Bdynamic -lpthread -lm -ldl -Wl,-Bstatic -lxcf03 -lxc"
export CMAKE_Fortran_FLAGS="-axSSE2 -qopenmp-link static -static_mpi -static-intel"
......@@ -22,6 +22,7 @@ do
-magma) shift; CLI_USE_MAGMA=$1;;
-gpu) shift; CLI_USE_GPU=$1;;
-chase) shift; CLI_USE_CHASE=$1;;
-libxc) shift; CLI_USE_LIBXC=$1;;
-link) shift; CLI_LIBRARIES=$1;;
-libdir) shift; CLI_LIBDIR="$CLI_LIBDIR $1";;
-flags) shift; CLI_FLAGS=$1;;
......@@ -81,10 +82,11 @@ General options:
-cmake_opts # : additional options for cmake can be specified here directly
Command line options to switch on/off features. These options overwrite the results of
the test and might lead to the configuration to fail.
the test and might lead to the configuration to fail.
-hdf5 [TRUE|FALSE] : use HDF5 library
-wannier [TRUE|FALSE] : use Wannier90 library
-mpi [TRUE|FALSE] : compile the MPI parallel version
-libxc [TRUE|FALSE] : use libxc library
Command line option to compile external libraries:
-external # : download and compile external libraries before building FLEUR
......
......@@ -101,11 +101,14 @@ then
echo "set(CLI_FLEUR_USE_GPU $CLI_USE_GPU)" >>config.cmake
fi
if [ "$CLI_USE_LIBXC" ]
then
echo "set(CLI_FLEUR_USE_LIBXC $CLI_USE_LIBXC)" >>config.cmake
fi
if [ "$CLI_USE_SERIAL" ]
then
echo "set(FLEUR_USE_SERIAL $CLI_USE_SERIAL)" >>config.cmake
else
echo "set(FLEUR_USE_SERIAL TRUE)" >>config.cmake
echo "set(CLI_FLEUR_USE_SERIAL $CLI_USE_SERIAL)" >>config.cmake
fi
if [ "$CLI_ELPA_OPENMP" ]
......
......@@ -13,6 +13,10 @@ if (CLI_FLEUR_USE_GPU)
elseif(${CLI_FLEUR_USE_GPU} MATCHES "nvtx")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60,ptxinfo,lineinfo -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt ")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt ")
elseif(${CLI_FLEUR_USE_GPU} MATCHES "magma")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.2,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cc60 -Mcuda=rdc -lcublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
elseif(${CLI_FLEUR_USE_GPU} MATCHES "emu")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas -Minfo=accel ")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas ")
......@@ -20,15 +24,15 @@ if (CLI_FLEUR_USE_GPU)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=,MANAGED")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=,MANAGED")
#Now check for cusolverDN library
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mcuda -ta=tesla,cuda9.1 ")
try_compile(FLEUR_USE_CUSOLVER ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_cusolver.c
LINK_LIBRARIES "-lcusolver"
)
if (FLEUR_USE_CUSOLVER)
set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};-lcusolver")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_CUSOLVER")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_CUSOLVER")
endif()
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mcuda -ta=tesla,cuda9.1 ")
# try_compile(FLEUR_USE_CUSOLVER ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_cusolver.c
# LINK_LIBRARIES "-lcusolver"
# )
# if (FLEUR_USE_CUSOLVER)
# set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};-lcusolver")
# set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_CUSOLVER")
# set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_CUSOLVER")
# endif()
else()
set(FLEUR_USE_GPU FALSE)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MANAGED=")
......
......@@ -31,10 +31,39 @@ endif()
message("HDF5 Library found:${FLEUR_USE_HDF5}")
if (DEFINED CLI_FLEUR_USE_HDF5})
if (CLI_FLEUR_USE_HDF5})
if (DEFINED CLI_FLEUR_USE_HDF5)
if (CLI_FLEUR_USE_HDF5)
if (NOT FLEUR_USE_HDF5)
message(FATAL_ERROR "You asked for HDF5 but cmake couldn't find it. Please set HDF5_ROOT and or give additional compiler/linker flags")