Commit 08f59f4e authored by Matthias Redies's avatar Matthias Redies

merge

parents 41cb66b7 b7d59964
docs/mkdocs/site
init/compileinfo.h
io/xml/inputSchema.h
Testing/*
......
......@@ -66,32 +66,32 @@ 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:
......
[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
......
......@@ -36,8 +36,8 @@ SUBROUTINE magMoms(dimension,input,atoms,noco,vTot,moments)
END DO
8000 FORMAT (/,/,10x,'spin density at the nucleus:',/,10x,'type',t25,&
'input%total',t42,'valence',t65,'core',t90,&
'majority valence and input%total density',/)
'total',t42,'valence',t65,'core',t90,&
'majority valence and total density',/)
8010 FORMAT (i13,2x,3e20.8,5x,2e20.8)
WRITE (6,FMT=8020)
......
......@@ -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)
......@@ -55,14 +54,13 @@ 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 global/differ.f math/inwint.f
math/outint.f math/grule.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 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 juDFT/juDFT.F90 global/find_enpara.f90
inpgen/closure.f90 inpgen/inpgen_arguments.F90 math/intgr.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,17 +72,17 @@ 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)
string(REPLACE ";" " " CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FLEUR_PRECISION_OPTION}")
message("Flags: ${CMAKE_Fortran_FLAGS}")
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})
......@@ -92,18 +90,28 @@ if(${FLEUR_USE_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_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_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()
include(cmake/docker.txt)
#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")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "19.0.0.0")
......@@ -18,20 +23,22 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
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")
......@@ -39,6 +46,7 @@ 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()
......
find_program(DOCKER docker)
if (DOCKER)
if (FLEUR_USE_MPI)
set(dockername fleur_MPI)
else()
set(dockername fleur)
endif()
message("${DOCKER}->${dockername}")
add_custom_command(OUTPUT docker/Dockerfile
COMMAND "mkdir docker"
COMMAND "cp ${CMAKE_CURRENT_SOURCE_DIR}/docker/Dockerfile_${dockername} docker/Dockerfile"
COMMAND "cd docker;${DOCKER} build -t iffregistery.fz-juelich.de/fleur/fleur:${dockername} ."
COMMAND "${DOCKER} push iffregistery.fz-juelich.de/fleur/fleur:${dockername}"
DEPENDS inpgen ${dockername}
COMMENT "Build docker image")
add_custom_target(docker DEPENDS docker/Dockerfile)
endif()
......@@ -8,7 +8,7 @@ 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(juDFT/time.F90 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()
......
#NOSHOW
export FC=mpif90
FLEUR_INCLUDEDIR="/opt/include"
FLEUR_LIBRARIES="-L/opt/lib;-lxcf03;-lxc;-lhdf5_fortran;-lhdf5;-ldl;-L/usr/lib;-L/usr/lib/x86_64-linux-gnu;-lxml2;-lscalapack-openmpi;-lblacsF77init-openmpi;-lblacs-openmpi;-llapack;-lblas"
FLEUR_LIBRARIES="-L/opt/lib;-lxcf03;-lxc;-ldl;-L/usr/lib;-L/usr/lib/x86_64-linux-gnu;-lxml2;-lscalapack-openmpi;-lblacsF77init-openmpi;-lblacs-openmpi;-llapack;-lblas"
......@@ -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")
message(WARNING "You asked for HDF5 but cmake couldn't find it. We will try to download and compile HDF5 along with FLEUR")
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/hdf5-git/src" )
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init external/hdf5-git WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_init OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_update OUTPUT_QUIET ERROR_QUIET)
if( ${_res_init} GREATER 0 OR ${_res_update} GREATER 0 )
message(FATAL_ERROR "HDF5 source could not be downloaded.\n"
"We tried: 'git submodule init external/hdf5-git && git submodule update' and resulted in error" )
endif()
endif()
set(HDF5_EXTERNALLY_CONFIGURED 1)
set(HDF5_EXPORTED_TARGETS "hdf5_fortran-static")
set(HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support")
set(HDF5_BUILD_CPP_LIB OFF CACHE BOOL "Build HDF5 C++ Library")
set(HDF5_BUILD_HL_LIB OFF CACHE BOOL "Build HIGH Level HDF5 Library")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries")
set(HDF5_BUILD_TOOLS OFF CACHE BOOL "Build HDF5 Tools")
set(HDF5_BUILD_EXAMPLES OFF CACHE BOOL "Build HDF5 Library Examples")
set(BUILD_TESTING OFF CACHE BOOL "Build HDF5 Unit Testing")
if (FLEUR_USE_MPI)
set(HDF5_ENABLE_PARALLEL ON CACHE BOOL "Enable parallel build (requires MPI)")
else()
set(HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)")
endif()
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules/hdf5")
add_subdirectory (external/hdf5-git EXCLUDE_FROM_ALL)
set(FLEUR_USE_HDF5 TRUE)
set(FLEUR_USE_HDF5MPI FLEUR_USE_MPI)
set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};hdf5_fortran-static")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/hdf5/static")
endif()
else()
if (FLEUR_USE_HDF5)
......
......@@ -3,6 +3,41 @@ try_compile(FLEUR_USE_LIBXC ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/
LINK_LIBRARIES ${FLEUR_LIBRARIES}
)
if (DEFINED CLI_FLEUR_USE_LIBXC)
if (CLI_FLEUR_USE_LIBXC)
if (NOT FLEUR_USE_LIBXC)
message("You asked for LibXC support but cmake couldn't find it. We will try to download and compile along with FLEUR")
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/libxc-git/src" )
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init external/libxc-git WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_init OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_update OUTPUT_QUIET ERROR_QUIET)
if( ${_res_init} GREATER 0 OR ${_res_update} GREATER 0 )
message(FATAL_ERROR "HDF5 source could not be downloaded.\n"
"We tried: 'git submodule init external/libxc-git && git submodule update' and resulted in error" )
endif()
endif()
#patch libxc
execute_process(COMMAND "sh" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/external/libxc-git" INPUT_FILE "${PROJECT_SOURCE_DIR}/external/patch-libxc.sh")
message("libxc was patched")
set(ENABLE_FORTRAN ON CACHE BOOL "Build Fortran 90 interface")
set(ENABLE_FORTRAN03 ON CACHE BOOL "Build Fortran 2003 interface")
add_subdirectory (external/libxc-git EXCLUDE_FROM_ALL)
set(FLEUR_USE_LIBXC TRUE)
set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};xcf90;xcf03")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I${CMAKE_CURRENT_BINARY_DIR}/external/libxc-git")
endif()
else()
if (FLEUR_USE_LIBXC)
message("LibXC found but you explicitely asked not to use it")
set(FLEUR_USE_LIBXC FALSE)
endif()
endif()
endif()
message("Libxc Library found:${FLEUR_USE_LIBXC}")
if (FLEUR_USE_LIBXC)
......
......@@ -20,4 +20,11 @@ endif()
if (FLEUR_USE_MPI)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MPI")
set(FLEUR_USE_SERIAL FALSE)
else()
set(FLEUR_USE_SERIAL TRUE)
endif()
if (DEFINED CLI_FLEUR_USE_SERIAL)
set(FLEUR_USE_SERIAL CLI_FLEUR_USE_SERIAL)
endif()
\ No newline at end of file
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/juDFT/CMakeLists.txt" )
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init juDFT WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_init OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_update OUTPUT_QUIET ERROR_QUIET)
if( ${_res_init} GREATER 0 OR ${_res_update} GREATER 0 )
message(FATAL_ERROR "HDF5 source could not be downloaded.\n"
"We tried: 'git submodule init external/libxc-git && git submodule update' and resulted in error" )
endif()
endif()
set(JUDFT_USE_MPI ${FLEUR_USE_MPI} CACHE BOOL "Compile with MPI, will also work in serial")
set(JUDFT_USE_HDF5 ${FLEUR_USE_HDF5} CACHE BOOL "Compile with HDF5")
if (DEFINED FLEUR_USE_HDF5MPI)
set(JUDFT_USE_HDF5MPI FLEUR_USE_HDF5MPI CACHE BOOL "Is the HDF5 version able to do parallel IO" )
endif()
#In addition you might want to set
set(JUDFT_COMPILEOPTS ${FLEUR_PRECISION_OPTION})
add_subdirectory(juDFT)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/juDFT/modules/juDFT")
......@@ -9,14 +9,47 @@ diagonalization/chase_diag.F90
diagonalization/symmetrize_matrix.f90
diagonalization/cusolver_diag.F90
diagonalization/elemental.F90
diagonalization/available_solvers.F90
diagonalization/writeout.F90
diagonalization/elpa_20180525_onenode.F90)
if (FLEUR_USE_ELPA_20180525)
set(fleur_F90 ${fleur_F90}
diagonalization/elpa_20180525.F90
)
set(fleur_F90 ${fleur_F90} diagonalization/elpa_20180525.F90)
set(diag_test_files diagonalization/elpa_20180525.F90)
else()
set(fleur_F90 ${fleur_F90}
diagonalization/elpa.F90
set(fleur_F90 ${fleur_F90} diagonalization/elpa.F90)
set(diag_test_files diagonalization/elpa.F90)
endif()
if (FLEUR_USE_HDF5)
set(diag_test_files ${diag_test_files}
diagonalization/diag_test.F90
diagonalization/eigen_diag.F90
diagonalization/lapack_diag.F90
diagonalization/magma.F90
diagonalization/scalapack.F90
#diagonalization/chase_diag.F90
#diagonalization/symmetrize_matrix.f90
diagonalization/cusolver_diag.F90
diagonalization/elemental.F90
diagonalization/available_solvers.F90
diagonalization/writeout.F90
diagonalization/elpa_20180525_onenode.F90
types/types_mat.F90
types/types_mpimat.F90
types/types_gpumat.F90
types/types_setup.F90
io/io_matrix.F90
io/iomatrix_hdf.F90
)
add_executable(diag_test EXCLUDE_FROM_ALL ${diag_test_files} )
target_link_libraries(diag_test ${FLEUR_LIBRARIES})
target_link_libraries(diag_test juDFT)
if (FLEUR_USE_MPI)
target_compile_definitions(diag_test PUBLIC ${FLEUR_MPI_DEFINITIONS})
else()
target_compile_definitions(diag_test PUBLIC ${FLEUR_DEFINITIONS})
endif()
set_target_properties(diag_test PROPERTIES Fortran_MODULE_DIRECTORY modules/diag_test COMPILE_OPTIONS -Imodules/diag_test RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tools")
endif()
!--------------------------------------------------------------------------------
! 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_available_solvers
IMPLICIT NONE
! list of constants indicating the different solvers
! the parameters are set to negative values to indicate that a particular solver is not compiled
! -solvers with numbers below 100 expect a non-distributed matrix
! -solvers with numbers 100-199 expect a distributed (scalapack-type) matrix
! -solvers with numbers higher than 200 can handle both
#ifdef CPP_ELPA
INTEGER,PARAMETER:: diag_elpa=101
#else
INTEGER,PARAMETER:: diag_elpa=-101
#endif
#ifdef CPP_ELEMENTAL
INTEGER,PARAMETER:: diag_elemental=102
#else
INTEGER,PARAMETER:: diag_elemental=-102
#endif
#ifdef CPP_SCALAPACK
INTEGER,PARAMETER:: diag_scalapack=103
#else
INTEGER,PARAMETER:: diag_scalapack=-103
#endif
#ifdef CPP_MAGMA
INTEGER,PARAMETER:: diag_magma=6
#else
INTEGER,PARAMETER:: diag_magma=-6
#endif
#ifdef CPP_CHASE
INTEGER,PARAMETER:: diag_chase=7
#else
INTEGER,PARAMETER:: diag_chase=-7
#endif
#ifdef CPP_CUSOLVER
INTEGER,PARAMETER:: diag_cusolver=8
#else
INTEGER,PARAMETER:: diag_cusolver=-8
#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=201
INTEGER,PARAMETER::diag_all_solver(9)=(/diag_elpa,diag_elemental,diag_scalapack,diag_magma,diag_chase,diag_cusolver,diag_lapack,diag_elpa_1node,diag_debugout/)
CONTAINS
LOGICAL FUNCTION parallel_solver_available()
parallel_solver_available=ANY(diag_all_solver>100)
END FUNCTION parallel_solver_available
FUNCTION select_solver(suggested_solver,parallel) RESULT(diag_solver)
USE m_juDFT
LOGICAL,INTENT(IN):: parallel
INTEGER,INTENT(in):: suggested_solver
INTEGER :: diag_solver
diag_solver=-99
diag_solver=suggested_solver
IF (suggested_solver==0) THEN
!Determine the default solver
IF (parallel) THEN
diag_solver=MINVAL(diag_all_solver,mask=diag_all_solver>100)
ELSE
diag_solver=MINVAL(diag_all_solver,mask=diag_all_solver>0)
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"))=="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 (diag_solver<100.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 (diag_solver>100.AND.diag_solver<200.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 IF
END FUNCTION select_solver
END MODULE m_available_solvers
......@@ -90,7 +90,7 @@ CONTAINS
#ifdef CPP_CHASE
SUBROUTINE init_chase(mpi,DIMENSION,input,atoms,kpts,noco,l_real)
USE m_types_mpimat
USE m_types
USE m_types_setup
USE m_types_mpi
USE m_judft
USE m_eig66_io
......@@ -125,8 +125,8 @@ CONTAINS
#endif
SUBROUTINE chase_diag(hmat,smat,ikpt,jsp,iter,ne,eig,zmat)
USE m_types_mpimat
USE m_types
<