Skip to content

Commit fd94def

Browse files
committed
Enable direct reading of UPF version >= 2 PP files
1 parent bd9bb45 commit fd94def

17 files changed

+179778
-18
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
container: electronicstructure/sirius
1414
env:
15-
DEVSPEC: sirius@develop %gcc +python +memory_pool +tests +apps +vdwxc +scalapack +fortran build_type=RelWithDebInfo ^openblas ^mpich
15+
DEVSPEC: sirius@develop %gcc +python +memory_pool +tests +pugixml +apps +vdwxc +scalapack +fortran build_type=RelWithDebInfo ^openblas ^mpich
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Configure SIRIUS

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: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,46 +71,46 @@ RUN ldconfig
7171

7272
# create environments for several configurations and install dependencies
7373
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 " && \
74+
spack -e /sirius-env-clang add "sirius@develop %clang build_type=RelWithDebInfo ~cuda ~fortran +tests +pugixml ^openblas%gcc ^libxc%gcc ^mpich%gcc " && \
7575
spack -e /sirius-env-clang develop -p /sirius-src sirius@develop && \
7676
spack -e /sirius-env-clang install --only=dependencies --fail-fast
7777

7878
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" && \
79+
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" && \
8080
spack -e /sirius-env-cuda develop -p /sirius-src sirius@develop && \
8181
spack -e /sirius-env-cuda install --only=dependencies --fail-fast
8282

8383
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" && \
84+
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" && \
8585
spack -e /sirius-env-cuda-mkl-mpich develop -p /sirius-src sirius@develop && \
8686
spack -e /sirius-env-cuda-mkl-mpich install --only=dependencies --fail-fast
8787

8888
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" && \
89+
spack -e /sirius-env-elpa add "sirius@develop %gcc build_type=RelWithDebInfo +tests +pugixml +apps +cuda +scalapack +elpa ^netlib-scalapack ^mpich ^openblas ^elpa+cuda" && \
9090
spack -e /sirius-env-elpa develop -p /sirius-src sirius@develop && \
9191
spack -e /sirius-env-elpa install --only=dependencies --fail-fast
9292

9393
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" && \
94+
spack -e /sirius-env-fp32 add "sirius@develop %gcc build_type=RelWithDebInfo +tests +pugixml +apps +cuda ^mpich ^openblas ^elpa+cuda ^spfft+single_precision+cuda" && \
9595
spack -e /sirius-env-fp32 develop -p /sirius-src sirius@develop && \
9696
spack -e /sirius-env-fp32 install --only=dependencies --fail-fast
9797

9898
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" && \
99+
spack -e /sirius-env-nlcg add "sirius@develop %gcc build_type=RelWithDebInfo +fortran +tests +pugixml +apps +cuda +nlcglib ^openblas ^mpich" && \
100100
spack -e /sirius-env-nlcg develop -p /sirius-src sirius@develop && \
101101
spack -e /sirius-env-nlcg install --only=dependencies --fail-fast
102102

103103
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" && \
104+
spack -e /sirius-env-openmpi add "sirius@develop %gcc +tests +pugixml +apps +scalapack +fortran build_type=RelWithDebInfo ^netlib-scalapack ^openblas ^openmpi" && \
105105
spack -e /sirius-env-openmpi develop -p /sirius-src sirius@develop && \
106106
spack -e /sirius-env-openmpi install --only=dependencies --fail-fast
107107

108108
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" && \
109+
spack -e /sirius-env-cuda-sequential add "sirius@develop %gcc +cuda +tests +pugixml +apps +fortran build_type=RelWithDebInfo ^openblas ^openmpi" && \
110110
spack -e /sirius-env-cuda-sequential develop -p /sirius-src sirius@develop && \
111111
spack -e /sirius-env-cuda-sequential install --only=dependencies --fail-fast
112112

113113
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" && \
114+
spack -e /sirius-env-vdwxc-cuda add "sirius@develop %gcc build_type=RelWithDebInfo +fortran +tests +pugixml +apps +vdwxc +cuda +nlcglib ^openblas ^mpich +cuda" && \
115115
spack -e /sirius-env-vdwxc-cuda develop -p /sirius-src sirius@develop && \
116116
spack -e /sirius-env-vdwxc-cuda install --only=dependencies --fail-fast

ci/baseimage.rocm.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ RUN spack install --fail-fast rocsolver%gcc
4545
RUN spack install --fail-fast hipfft%gcc
4646

4747
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" && \
48+
spack -e /sirius-env-rocm add "sirius@develop %gcc build_type=Release +scalapack +fortran +tests +pugixml +rocm ^openblas ^mpich ^spfft ^umpire+rocm~device_alloc" && \
4949
spack -e /sirius-env-rocm develop -p /sirius-src sirius@develop && \
5050
spack -e /sirius-env-rocm install --only=dependencies --fail-fast

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)