Skip to content

Commit ef94cd9

Browse files
Enable direct reading of UPF version >= 2 PP files (#980)
* Enable direct reading of UPF version >= 2 PP files * update spack in cscs-ci * use local spack recipe for cscs-ci * Fix github CI * increase timeout * 4h -> 10h --------- Co-authored-by: Simon Pintarelli <[email protected]>
1 parent e497538 commit ef94cd9

18 files changed

+179789
-21
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
cd ${GITHUB_WORKSPACE}
2222
mkdir build
2323
cd build
24-
spack --color always build-env $DEVSPEC -- cmake .. -DSIRIUS_USE_SCALAPACK=1 -DSIRIUS_USE_VDWXC=1 -DBUILD_TESTING=1 -DSIRIUS_CREATE_FORTRAN_BINDINGS=1 -DSIRIUS_CREATE_PYTHON_MODULE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/sirius_install
24+
spack --color always build-env $DEVSPEC -- cmake .. -DSIRIUS_USE_SCALAPACK=1 -DSIRIUS_USE_VDWXC=1 -DBUILD_TESTING=1 -DSIRIUS_CREATE_FORTRAN_BINDINGS=1 -DSIRIUS_CREATE_PYTHON_MODULE=1 -DSIRIUS_USE_PUGIXML=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/sirius_install
2525
- name: Build SIRIUS
2626
run: |
2727
cd ${GITHUB_WORKSPACE}/build

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ option(SIRIUS_BUILD_APPS "build apps" ON)
3232
option(SIRIUS_USE_OPENMP "use OpenMP" ON)
3333
option(SIRIUS_USE_PROFILER "measure execution of functions with timer" ON)
3434
option(SIRIUS_USE_MEMORY_POOL "use memory pool" ON)
35+
option(SIRIUS_USE_PUGIXML "enable reading of UPF v2 files with pugixml" OFF)
3536
option(SIRIUS_USE_POWER_COUNTER "measure energy consumption with power counters" OFF)
3637
option(BUILD_TESTING "build test executables" OFF) # override default setting in CTest module
3738
option(SIRIUS_USE_VCSQNM "use variable cell stabilized quasi Newton method" OFF)
@@ -135,6 +136,10 @@ include(cmake/hdf5_target.cmake)
135136
find_package(SpFFT 1.0.2 CONFIG REQUIRED)
136137
find_package(SPLA 1.4.0 CONFIG REQUIRED)
137138

139+
if (SIRIUS_USE_PUGIXML)
140+
find_package(pugixml REQUIRED)
141+
endif()
142+
138143
# Check if SpFFT support single precision if required
139144
if(NOT SIRIUS_USE_FP32 STREQUAL "OFF")
140145
if(SPFFT_SINGLE_PRECISION)

ci/baseimage.cuda.Dockerfile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cm
2727
tar zxvf cmake.tar.gz --strip-components=1 -C /usr
2828

2929
# get latest version of spack
30-
RUN git clone -b v0.21.0 https://github.com/spack/spack.git
30+
RUN git clone -b v0.21.2 https://github.com/spack/spack.git
31+
32+
# add local repo to spack
33+
COPY ./spack /opt/spack
34+
RUN spack repo add --scope system /opt/spack
3135

3236
# set the location of packages built by spack
3337
RUN spack config add config:install_tree:root:/opt/local
@@ -71,46 +75,46 @@ RUN ldconfig
7175

7276
# create environments for several configurations and install dependencies
7377
RUN spack env create -d /sirius-env-clang && \
74-
spack -e /sirius-env-clang add "sirius@develop %clang build_type=RelWithDebInfo ~cuda ~fortran +tests ^openblas%gcc ^libxc%gcc ^mpich%gcc " && \
78+
spack -e /sirius-env-clang add "sirius@develop %clang build_type=RelWithDebInfo ~cuda ~fortran +tests +pugixml ^openblas%gcc ^libxc%gcc ^mpich%gcc " && \
7579
spack -e /sirius-env-clang develop -p /sirius-src sirius@develop && \
7680
spack -e /sirius-env-clang install --only=dependencies --fail-fast
7781

7882
RUN spack env create -d /sirius-env-cuda && \
79-
spack -e /sirius-env-cuda add "sirius@develop %gcc build_type=RelWithDebInfo +scalapack +tests +apps +cuda +magma +python ^netlib-scalapack ^mpich ^openblas threads=openmp" && \
83+
spack -e /sirius-env-cuda add "sirius@develop %gcc build_type=RelWithDebInfo +scalapack +tests +pugixml +apps +cuda +magma +python ^netlib-scalapack ^mpich ^openblas threads=openmp" && \
8084
spack -e /sirius-env-cuda develop -p /sirius-src sirius@develop && \
8185
spack -e /sirius-env-cuda install --only=dependencies --fail-fast
8286

8387
RUN spack env create -d /sirius-env-cuda-mkl-mpich && \
84-
spack -e /sirius-env-cuda-mkl-mpich add "sirius@develop %gcc build_type=RelWithDebInfo +tests +apps +cuda +scalapack +magma ^mpich ^intel-oneapi-mkl+cluster" && \
88+
spack -e /sirius-env-cuda-mkl-mpich add "sirius@develop %gcc build_type=RelWithDebInfo +tests +pugixml +apps +cuda +scalapack +magma ^mpich ^intel-oneapi-mkl+cluster" && \
8589
spack -e /sirius-env-cuda-mkl-mpich develop -p /sirius-src sirius@develop && \
8690
spack -e /sirius-env-cuda-mkl-mpich install --only=dependencies --fail-fast
8791

8892
RUN spack env create -d /sirius-env-elpa && \
89-
spack -e /sirius-env-elpa add "sirius@develop %gcc build_type=RelWithDebInfo +tests +apps +cuda +scalapack +elpa ^netlib-scalapack ^mpich ^openblas ^elpa+cuda" && \
93+
spack -e /sirius-env-elpa add "sirius@develop %gcc build_type=RelWithDebInfo +tests +pugixml +apps +cuda +scalapack +elpa ^netlib-scalapack ^mpich ^openblas ^elpa+cuda" && \
9094
spack -e /sirius-env-elpa develop -p /sirius-src sirius@develop && \
9195
spack -e /sirius-env-elpa install --only=dependencies --fail-fast
9296

9397
RUN spack env create -d /sirius-env-fp32 && \
94-
spack -e /sirius-env-fp32 add "sirius@develop %gcc build_type=RelWithDebInfo +tests +apps +cuda ^mpich ^openblas ^elpa+cuda ^spfft+single_precision+cuda" && \
98+
spack -e /sirius-env-fp32 add "sirius@develop %gcc build_type=RelWithDebInfo +tests +pugixml +apps +cuda ^mpich ^openblas ^elpa+cuda ^spfft+single_precision+cuda" && \
9599
spack -e /sirius-env-fp32 develop -p /sirius-src sirius@develop && \
96100
spack -e /sirius-env-fp32 install --only=dependencies --fail-fast
97101

98102
RUN spack env create -d /sirius-env-nlcg && \
99-
spack -e /sirius-env-nlcg add "sirius@develop %gcc build_type=RelWithDebInfo +fortran +tests +apps +cuda +nlcglib ^openblas ^mpich" && \
103+
spack -e /sirius-env-nlcg add "sirius@develop %gcc build_type=RelWithDebInfo +fortran +tests +pugixml +apps +cuda +nlcglib ^openblas ^mpich" && \
100104
spack -e /sirius-env-nlcg develop -p /sirius-src sirius@develop && \
101105
spack -e /sirius-env-nlcg install --only=dependencies --fail-fast
102106

103107
RUN spack env create -d /sirius-env-openmpi && \
104-
spack -e /sirius-env-openmpi add "sirius@develop %gcc +tests +apps +scalapack +fortran build_type=RelWithDebInfo ^netlib-scalapack ^openblas ^openmpi" && \
108+
spack -e /sirius-env-openmpi add "sirius@develop %gcc +tests +pugixml +apps +scalapack +fortran build_type=RelWithDebInfo ^netlib-scalapack ^openblas ^openmpi" && \
105109
spack -e /sirius-env-openmpi develop -p /sirius-src sirius@develop && \
106110
spack -e /sirius-env-openmpi install --only=dependencies --fail-fast
107111

108112
RUN spack env create -d /sirius-env-cuda-sequential && \
109-
spack -e /sirius-env-cuda-sequential add "sirius@develop %gcc +cuda +tests +apps +fortran build_type=RelWithDebInfo ^openblas ^openmpi" && \
113+
spack -e /sirius-env-cuda-sequential add "sirius@develop %gcc +cuda +tests +pugixml +apps +fortran build_type=RelWithDebInfo ^openblas ^openmpi" && \
110114
spack -e /sirius-env-cuda-sequential develop -p /sirius-src sirius@develop && \
111115
spack -e /sirius-env-cuda-sequential install --only=dependencies --fail-fast
112116

113117
RUN spack env create -d /sirius-env-vdwxc-cuda && \
114-
spack -e /sirius-env-vdwxc-cuda add "sirius@develop %gcc build_type=RelWithDebInfo +fortran +tests +apps +vdwxc +cuda +nlcglib ^openblas ^mpich +cuda" && \
118+
spack -e /sirius-env-vdwxc-cuda add "sirius@develop %gcc build_type=RelWithDebInfo +fortran +tests +pugixml +apps +vdwxc +cuda +nlcglib ^openblas ^mpich +cuda" && \
115119
spack -e /sirius-env-vdwxc-cuda develop -p /sirius-src sirius@develop && \
116120
spack -e /sirius-env-vdwxc-cuda install --only=dependencies --fail-fast

ci/baseimage.rocm.Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cm
2323
tar zxvf cmake.tar.gz --strip-components=1 -C /usr
2424

2525
# get latest version of spack
26-
RUN git clone -b v0.21.0 https://github.com/spack/spack.git
26+
RUN git clone -b v0.21.2 https://github.com/spack/spack.git
27+
28+
# add local repo to spack
29+
COPY ./spack /opt/spack
30+
RUN spack repo add --scope system /opt/spack
2731

2832
# set the location of packages built by spack
2933
RUN spack config add config:install_tree:root:/opt/local
@@ -45,6 +49,6 @@ RUN spack install --fail-fast rocsolver%gcc
4549
RUN spack install --fail-fast hipfft%gcc
4650

4751
RUN spack env create -d /sirius-env-rocm && \
48-
spack -e /sirius-env-rocm add "sirius@develop %gcc build_type=Release +scalapack +fortran +tests +rocm ^openblas ^mpich ^spfft ^umpire+rocm~device_alloc" && \
52+
spack -e /sirius-env-rocm add "sirius@develop %gcc build_type=Release +scalapack +fortran +tests +pugixml +rocm ^openblas ^mpich ^spfft ^umpire+rocm~device_alloc" && \
4953
spack -e /sirius-env-rocm develop -p /sirius-src sirius@develop && \
5054
spack -e /sirius-env-rocm install --only=dependencies --fail-fast

ci/cscs-daint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ stages:
99
build base cuda image:
1010
extends: .container-builder-dynamic-name
1111
stage: baseimage
12-
timeout: 2h
12+
timeout: 10h
1313
variables:
1414
DOCKERFILE: ci/baseimage.cuda.Dockerfile
1515
WATCH_FILECHANGES: ci/baseimage.cuda.Dockerfile

spack/packages/sirius/package.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ class Sirius(CMakePackage, CudaPackage, ROCmPackage):
108108
)
109109
variant("nvtx", default=False, description="Use NVTX profiler")
110110

111+
with when("@7.6:"):
112+
variant("pugixml", default=False, description="Enable direct reading of UPF v2 pseudopotentials")
113+
conflicts("+tests~pugixml")
114+
depends_on("pugixml", when="+pugixml")
115+
111116
depends_on("[email protected]:", type="build")
112117
depends_on("mpi")
113118
depends_on("gsl")
@@ -226,6 +231,7 @@ def cmake_args(self):
226231
self.define_from_variant(cm_label + "USE_PROFILER", "profiler"),
227232
self.define_from_variant(cm_label + "USE_NVTX", "nvtx"),
228233
self.define_from_variant(cm_label + "USE_WANNIER90", "wannier90"),
234+
self.define_from_variant(cm_label + "USE_PUGIXML", "pugixml"),
229235
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
230236
self.define_from_variant("BUILD_TESTING", "tests"),
231237
]

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ target_link_libraries(sirius_cxx PUBLIC ${GSL_LIBRARY}
117117
SpFFT::spfft
118118
SPLA::spla
119119
"${SIRIUS_LINALG_LIB}"
120+
$<$<BOOL:${SIRIUS_USE_PUGIXML}>:pugixml::pugixml>
120121
$<$<BOOL:${SIRIUS_USE_MEMORY_POOL}>:umpire>
121122
$<$<BOOL:${SIRIUS_USE_NVTX}>:nvToolsExt>
122123
$<TARGET_NAME_IF_EXISTS:sirius::cudalibs>
@@ -141,6 +142,7 @@ target_compile_definitions(sirius_cxx PUBLIC
141142
$<$<BOOL:${SIRIUS_USE_MAGMA}>:SIRIUS_MAGMA>
142143
$<$<BOOL:${SIRIUS_USE_ROCM}>:SIRIUS_GPU SIRIUS_ROCM>
143144
$<$<BOOL:${SIRIUS_USE_VDWXC}>:SIRIUS_USE_VDWXC>
145+
$<$<BOOL:${SIRIUS_USE_PUGIXML}>:SIRIUS_USE_PUGIXML>
144146
$<$<BOOL:${SIRIUS_USE_FP32_BOOL}>:SIRIUS_USE_FP32>
145147
$<$<BOOL:${SIRIUS_USE_VCSQNM}>:SIRIUS_VCSQNM>
146148
$<$<BOOL:${SIRIUS_HAVE_LIBVDW_WITH_MPI}>:SIRIUS_HAVE_VDWXC_MPI>

0 commit comments

Comments
 (0)