Skip to content

Commit

Permalink
Update SIRIUS
Browse files Browse the repository at this point in the history
  • Loading branch information
mtaillefumier authored and oschuett committed Feb 3, 2023
1 parent 05bd493 commit 3114f69
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -448,7 +448,7 @@ endif()
# SIRIUS

if(CP2K_USE_SIRIUS)
find_package(sirius REQUIRED)
find_package(sirius 7.4 REQUIRED)
get_target_property(SIRIUS_INCLUDE_DIRS sirius::sirius
INTERFACE_INCLUDE_DIRECTORIES)
if(NOT SIRIUS_INCLUDE_DIRS)
Expand Down
10 changes: 4 additions & 6 deletions src/sirius_interface.F
Expand Up @@ -700,7 +700,7 @@ SUBROUTINE cp_sirius_energy_force(pwdft_env, calculate_forces, calculate_stress_

ALLOCATE (cforces(n2, n1))
cforces = 0.0_C_DOUBLE
CALL sirius_get_forces(gs_handler, 'total', cforces(1, 1))
CALL sirius_get_forces(gs_handler, 'total', cforces)
! Sirius computes the forces but cp2k use the gradient everywhere
! so a minus sign is needed.
! note also that sirius and cp2k store the forces transpose to each other
Expand All @@ -712,7 +712,7 @@ SUBROUTINE cp_sirius_energy_force(pwdft_env, calculate_forces, calculate_stress_

IF (calculate_stress_tensor) THEN
cstress = 0.0_C_DOUBLE
CALL sirius_get_stress_tensor(gs_handler, 'total', cstress(1, 1))
CALL sirius_get_stress_tensor(gs_handler, 'total', cstress)
stress(1:3, 1:3) = cstress(1:3, 1:3)
CALL pwdft_env_set(pwdft_env=pwdft_env, stress=stress)
END IF
Expand Down Expand Up @@ -790,9 +790,9 @@ SUBROUTINE cp_sirius_print_results(pwdft_env, print_section)
END DO
DO ik = 1, nkpts
DO ispn = 1, nspins
CALL sirius_get_band_energies(ks_handler, ik, ispn, slist(1))
CALL sirius_get_band_energies(ks_handler, ik, ispn, slist)
energies(1:nbands, ispn, ik) = slist(1:nbands)
CALL sirius_get_band_occupancies(ks_handler, ik, ispn, slist(1))
CALL sirius_get_band_occupancies(ks_handler, ik, ispn, slist)
occupations(1:nbands, ispn, ik) = slist(1:nbands)
END DO
END DO
Expand Down Expand Up @@ -856,9 +856,7 @@ SUBROUTINE cp_sirius_print_results(pwdft_env, print_section)

DEALLOCATE (energies, occupations, wkpt, slist)
DEALLOCATE (hist, occval, ehist)

END IF

END SUBROUTINE cp_sirius_print_results

END MODULE sirius_interface
Expand Down
7 changes: 5 additions & 2 deletions tools/toolchain/scripts/stage8/install_sirius.sh
Expand Up @@ -6,8 +6,8 @@
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"

sirius_ver="7.3.2"
sirius_sha256="a256508de6b344345c295ad8642dbb260c4753cd87cc3dd192605c33542955d7"
sirius_ver="7.4.3"
sirius_sha256="015679a60a39fa750c5d1bd8fb1ce73945524bef561270d8a171ea2fd4687fec"

source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
Expand Down Expand Up @@ -145,6 +145,7 @@ case "$with_sirius" in
-DCMAKE_Fortran_COMPILER="${MPIFC}" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DBUILD_SHARED_LIBS=OFF \
-DUSE_MEMORY_POOL=OFF \
-DUSE_ELPA=OFF \
${EXTRA_CMAKE_FLAGS} .. \
> cmake.log 2>&1 || tail -n ${LOG_LINES} cmake.log
Expand Down Expand Up @@ -172,6 +173,7 @@ case "$with_sirius" in
-DUSE_CUDA=ON \
-DUSE_ELPA=OFF \
-DGPU_MODEL=P100 \
-DUSE_MEMORY_POOL=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_CXX_COMPILER="${MPICXX}" \
-DCMAKE_C_COMPILER="${MPICC}" \
Expand Down Expand Up @@ -277,6 +279,7 @@ EOF
leak:cublasXtDeviceSelect
leak:sirius::sirius_free_object_handler
leak:sirius::sddk::memory_pool::free
leak:sirius::sddk::memory_block_descriptor::free_subblock
EOF
fi

Expand Down

0 comments on commit 3114f69

Please sign in to comment.