Skip to content

Commit 8c0f5a3

Browse files
committed
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into HSolver
2 parents a902e66 + 94481a6 commit 8c0f5a3

File tree

344 files changed

+6894
-1624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+6894
-1624
lines changed

.github/workflows/build_test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Build Test
2-
on: push
2+
on:
3+
push:
4+
pull_request:
35

46
jobs:
57
test:
@@ -11,7 +13,7 @@ jobs:
1113
build_args: ""
1214
name: "Build with GNU compilers"
1315
- tag: gnu
14-
build_args: "-DENABLE_LIBXC=1"
16+
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1"
1517
name: "Build with GNU compilers and extra components"
1618
- tag: intel
1719
build_args: ""
@@ -20,7 +22,7 @@ jobs:
2022
build_args: "-DUSE_CUDA=1"
2123
name: "Build with CUDA kit"
2224
name: ${{ matrix.name }}
23-
container: ghcr.io/${{ github.repository_owner }}/abacus-development-kit:${{ matrix.tag }}
25+
container: ghcr.io/deepmodeling/abacus-development-kit:${{ matrix.tag }}
2426
steps:
2527
- name: Checkout
2628
uses: actions/checkout@v3

.github/workflows/performance.yml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,38 @@ on:
44
workflow_dispatch:
55

66
jobs:
7+
start-runner:
8+
name: Start self-hosted EC2 runner
9+
runs-on: ubuntu-latest
10+
outputs:
11+
label: ${{ steps.start-ec2-runner.outputs.label }}
12+
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
13+
steps:
14+
- name: Configure AWS credentials
15+
uses: aws-actions/configure-aws-credentials@v1
16+
with:
17+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
18+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
19+
aws-region: us-east-2
20+
- name: Start EC2 runner
21+
id: start-ec2-runner
22+
uses: machulav/ec2-github-runner@v2
23+
with:
24+
mode: start
25+
github-token: ${{ secrets.PAT }}
26+
ec2-image-id: ami-04cd9fec4a7a39019
27+
ec2-instance-type: c5.9xlarge
28+
subnet-id: subnet-72d3e53e
29+
security-group-id: sg-06b0c93122c08aeab
30+
731
test:
832
name: Performance test
9-
runs-on: self-hosted
33+
needs: start-runner
34+
runs-on: ${{ needs.start-runner.outputs.label }}
1035
strategy:
1136
matrix:
1237
tag: ["gnu", "intel"]
13-
if: github.repository_owner == 'deepmodeling'
14-
container: ghcr.io/${{ github.repository_owner }}/abacus-development-kit:${{ matrix.tag }}
38+
container: ghcr.io/deepmodeling/abacus-development-kit:${{ matrix.tag }}
1539
timeout-minutes: 2880
1640
steps:
1741
- name: Checkout
@@ -22,7 +46,7 @@ jobs:
2246
- name: Build
2347
run: |
2448
cmake -B build -DENABLE_LIBXC=ON
25-
cmake --build build -j16
49+
cmake --build build -j`nproc`
2650
cmake --install build
2751
- name: Test
2852
run: |
@@ -32,3 +56,25 @@ jobs:
3256
- name: Show Result
3357
run: |
3458
cat examples/performance/sumall.dat
59+
60+
stop-runner:
61+
name: Stop self-hosted EC2 runner
62+
needs:
63+
- start-runner # required to get output from the start-runner job
64+
- test # required to wait when the main job is done
65+
runs-on: ubuntu-latest
66+
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
67+
steps:
68+
- name: Configure AWS credentials
69+
uses: aws-actions/configure-aws-credentials@v1
70+
with:
71+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
72+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
73+
aws-region: us-east-2
74+
- name: Stop EC2 runner
75+
uses: machulav/ec2-github-runner@v2
76+
with:
77+
mode: stop
78+
github-token: ${{ secrets.PAT }}
79+
label: ${{ needs.start-runner.outputs.label }}
80+
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}

.github/workflows/static.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
git diff -U0 HEAD^ | clang-tidy-diff -p1 -path build -export-fixes fixes.yml
2424
- name: Pull request comments from clang-tidy reports
25-
uses: platisd/clang-tidy-pr-comments@1.1.6
25+
uses: platisd/clang-tidy-pr-comments@master
2626
with:
2727
# The GitHub token (or a personal access token)
2828
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -35,3 +35,4 @@ jobs:
3535
# to avoid GitHub API timeouts for heavily loaded
3636
# pull requests
3737
suggestions_per_comment: 10
38+
repo_path_prefix: /__w

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ jobs:
2222
- name: Test
2323
env:
2424
GTEST_COLOR: 'yes'
25+
OMP_NUM_THREADS: '2'
2526
run: |
2627
cmake --build build --target test ARGS="-V"

CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,25 @@ include_directories(${ABACUS_SOURCE_DIR})
3030
add_executable(${ABACUS_BIN_NAME} source/main.cpp)
3131
set(CMAKE_CXX_STANDARD 11)
3232
set(CMAKE_CXX_STANDARD_REQUIRED ON)
33-
add_compile_options(-O2 -g)
3433
add_compile_options(-Wno-write-strings)
34+
set(FETCHCONTENT_QUIET FALSE) # Notify user when cloning git repo
35+
36+
find_program(CCACHE ccache)
37+
if (CCACHE)
38+
set (CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE} ${CMAKE_CXX_COMPILER_LAUNCHER})
39+
set (CMAKE_C_COMPILER_LAUNCHER ${CCACHE} ${CMAKE_C_COMPILER_LAUNCHER})
40+
endif()
41+
42+
# Select 'Release' configuration for best performance;
43+
# this will disable all assertions.
44+
# Other default configurations are also available, see:
45+
# https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#default-and-custom-configurations
46+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
47+
add_compile_options(-O2 -g) # default flag
48+
endif()
3549

3650
find_package(Cereal REQUIRED)
37-
include_directories(${Cereal_INCLUDE_DIR})
51+
include_directories(${CEREAL_INCLUDE_DIR})
3852
add_compile_definitions(USE_CEREAL_SERIALIZATION)
3953

4054
find_package(ELPA REQUIRED)

Dockerfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
# To build this Dockerfile, run `docker build -t abacus - < Dockerfile`.
22
# Pull image with `docker pull ghcr.io/deepmodeling/abacus:latest`.
3-
FROM ubuntu:latest
4-
RUN apt update && apt install -y --no-install-recommends libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev g++ make cmake bc time sudo vim git
3+
FROM ubuntu:22.04
4+
RUN apt update && apt install -y --no-install-recommends \
5+
libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev libxc-dev \
6+
g++ make cmake bc time sudo vim git
57
# If you wish to use the LLVM compiler, replace 'g++' above with 'clang libomp-dev'.
6-
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && cd abacus-develop && cmake -B build && cmake --build build -j`nproc` && cmake --install build && cd .. && rm -rf abacus-develop
8+
9+
ENV GIT_SSL_NO_VERIFY=true TERM=xterm-256color \
10+
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
11+
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
12+
cd abacus-develop && \
13+
cmake -B build && \
14+
cmake --build build -j`nproc` && \
15+
cmake --install build && \
16+
cd .. && rm -rf abacus-develop
717
# If you have trouble cloning repo, replace "github.com" with "gitee.com".
8-
ENV OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
918
CMD mpirun --use-hwthread-cpus abacus
1019

1120
# To run ABACUS built by this image with all available threads, execute `docker run -v <host>:<wd> -w <wd/input> abacus`.

Dockerfile.gnu

Lines changed: 18 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,18 @@
1-
FROM debian:bullseye-slim
2-
3-
RUN apt-get update && apt-get install -y --no-install-recommends libopenblas-dev liblapack-dev libscalapack-mpi-dev git g++ gfortran libssl-dev make cmake vim wget bc unzip python3-numpy
4-
ENV OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
5-
6-
ENV GIT_SSL_NO_VERIFY=1 TERM=xterm-256color
7-
8-
RUN cd /tmp \
9-
&& git clone https://github.com/USCiLab/cereal.git \
10-
&& cp -r cereal/include /usr/local \
11-
&& rm -rf cereal
12-
13-
RUN cd /tmp \
14-
&& wget https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/2021.05.002/elpa-2021.05.002.tar.gz --no-check-certificate --quiet \
15-
&& tar xzf elpa-2021.05.002.tar.gz && rm elpa-2021.05.002.tar.gz \
16-
&& cd elpa-2021.05.002 && mkdir build && cd build \
17-
&& ../configure CFLAGS="-O3 -march=native -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize" \
18-
FCFLAGS="-O2 -mavx" --disable-avx512 \
19-
&& make -j8 && make PREFIX=/usr/local install \
20-
&& ln -s /usr/local/include/elpa-2021.05.002/elpa /usr/local/include/ \
21-
&& cd /tmp && rm -rf elpa-2021.05.002
22-
23-
RUN cd /tmp \
24-
&& wget http://www.fftw.org/fftw-3.3.9.tar.gz --no-check-certificate --quiet \
25-
&& tar zxvf fftw-3.3.9.tar.gz \
26-
&& cd fftw-3.3.9 \
27-
&& ./configure --enable-mpi-fortran --enable-orterun-prefix-by-default FC=gfortran \
28-
&& make -j8 && make PREFIX=/usr/local install \
29-
&& cd /tmp && rm -rf fftw-3.3.9 && rm fftw-3.3.9.tar.gz
30-
31-
RUN cd /tmp \
32-
&& wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip --no-check-certificate --quiet \
33-
&& unzip libtorch-cxx11-abi-shared-with-deps-1.9.1+cpu.zip \
34-
&& cp -r libtorch/include /usr/local \
35-
&& cp -r libtorch/lib /usr/local \
36-
&& cp -r libtorch/share /usr/local \
37-
&& rm -rf libtorch
38-
39-
RUN cd /tmp \
40-
&& wget https://gitlab.com/libxc/libxc/-/archive/5.1.5/libxc-5.1.5.tar.gz --no-check-certificate --quiet \
41-
&& tar xzf libxc-5.1.5.tar.gz \
42-
&& cd libxc-5.1.5 \
43-
&& mkdir build \
44-
&& cmake -B build -DBUILD_TESTING=OFF \
45-
&& cmake --build build \
46-
&& cmake --install build \
47-
&& cd /tmp \
48-
&& rm -rf libxc-5.1.5 \
49-
&& rm libxc-5.1.5.tar.gz
50-
51-
RUN cd /tmp \
52-
&& git clone https://github.com/llohse/libnpy.git \
53-
&& cp libnpy/include/npy.hpp /usr/local/include \
54-
&& rm -rf libnpy
55-
56-
RUN cd /tmp \
57-
&& git clone https://github.com/google/googletest.git \
58-
&& cd googletest && cmake . && make install \
59-
&& rm -rf googletest
1+
FROM ubuntu:22.04
2+
RUN apt update && apt install -y --no-install-recommends \
3+
libopenblas-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev \
4+
libxc-dev libgtest-dev libgmock-dev python3-numpy \
5+
bc cmake git g++ make bc time sudo unzip vim wget
6+
7+
ENV GIT_SSL_NO_VERIFY=true TERM=xterm-256color \
8+
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
9+
10+
RUN git clone https://github.com/llohse/libnpy.git && \
11+
cp libnpy/include/npy.hpp /usr/local/include && \
12+
rm -r libnpy
13+
14+
RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcpu.zip \
15+
--no-check-certificate --quiet -O libtorch.zip && \
16+
unzip -q libtorch.zip && rm libtorch.zip && \
17+
cd libtorch && cp -r . /usr/local && \
18+
cd .. && rm -r libtorch

Dockerfile.intel

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
FROM debian:bullseye-slim
1+
FROM ubuntu:22.04
22

3-
RUN apt-get update && apt-get install -y bc cmake git gnupg gcc g++ python3 sudo wget vim unzip
3+
RUN apt-get update && apt-get install -y \
4+
bc cmake git gnupg gcc g++ python3-numpy sudo wget vim unzip \
5+
libcereal-dev libxc-dev libgtest-dev libgmock-dev
46

57
# Following steps by https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/apt.html .
68
RUN cd /tmp && \
@@ -11,20 +13,22 @@ RUN cd /tmp && \
1113

1214
# To save disk space, only install the required components, but not the whole intel-hpckit.
1315
RUN apt-get update --allow-unauthenticated \
14-
&& apt-get install -y \
16+
&& apt-get install -y --no-install-recommends \
1517
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \
1618
intel-oneapi-compiler-fortran \
1719
intel-oneapi-mkl-devel \
1820
intel-oneapi-mpi-devel
1921

2022
# These environment variables are the most essential part generated by `source /opt/intel/oneapi/setvars.sh`.
2123
# It is recommended to do it again if this docker image is used for development.
22-
ENV I_MPI_ROOT=/opt/intel/oneapi/mpi/latest \
24+
ENV I_MPI_ROOT='/opt/intel/oneapi/mpi/latest' \
2325
LIBRARY_PATH=/opt/intel/oneapi/tbb/latest/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/latest//libfabric/lib:/opt/intel/oneapi/mpi/latest//lib/release:/opt/intel/oneapi/mpi/latest//lib:/opt/intel/oneapi/mkl/latest/lib/intel64:/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin:/opt/intel/oneapi/compiler/latest/linux/lib \
2426
LD_LIBRARY_PATH=/opt/intel/oneapi/tbb/latest/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/latest//libfabric/lib:/opt/intel/oneapi/mpi/latest//lib/release:/opt/intel/oneapi/mpi/latest//lib:/opt/intel/oneapi/mkl/latest/lib/intel64:/opt/intel/oneapi/debugger/10.1.2/gdb/intel64/lib:/opt/intel/oneapi/debugger/10.1.2/libipt/intel64/lib:/opt/intel/oneapi/debugger/10.1.2/dep/lib:/opt/intel/oneapi/compiler/latest/linux/lib:/opt/intel/oneapi/compiler/latest/linux/lib/x64:/opt/intel/oneapi/compiler/latest/linux/lib/emu:/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin \
2527
PATH=/opt/intel/oneapi/mpi/latest//libfabric/bin:/opt/intel/oneapi/mpi/latest//bin:/opt/intel/oneapi/mkl/latest/bin/intel64:/opt/intel/oneapi/dev-utilities/latest/bin:/opt/intel/oneapi/debugger/10.1.2/gdb/intel64/bin:/opt/intel/oneapi/compiler/latest/linux/bin/intel64:/opt/intel/oneapi/compiler/latest/linux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
26-
MKLROOT=/opt/intel/oneapi/mkl/latest \
27-
I_MPI_ROOT=/opt/intel/oneapi/mpi/latest
28+
MKLROOT='/opt/intel/oneapi/mkl/latest' \
29+
FI_PROVIDER_PATH='/opt/intel/oneapi/mpi/latest/libfabric/lib/prov:/usr/lib64/libfabric' \
30+
CMAKE_PREFIX_PATH='/opt/intel/oneapi/vpl/latest:/opt/intel/oneapi/tbb/latest/env/..:/opt/intel/oneapi/dnnl/latest/cpu_dpcpp_gpu_dpcpp/../lib/cmake:/opt/intel/oneapi/dal/latest:/opt/intel/oneapi/compiler/latest/linux/IntelDPCPP' \
31+
CMPLR_ROOT='/opt/intel/oneapi/compiler/latest'
2832

2933
# Using the Intel Compilers with mpi wrapper.
3034
# Further test on oneAPI Compilers needed: icx, icpx, ifx
@@ -39,12 +43,7 @@ RUN source /opt/intel/oneapi/setvars.sh \
3943
&& tar xzf elpa-2021.05.002.tar.gz && rm elpa-2021.05.002.tar.gz \
4044
&& cd elpa-2021.05.002 && mkdir build && cd build \
4145
&& ../configure FCFLAGS="-qmkl=cluster" \
42-
&& make -j8 \
46+
&& make -j`nproc` \
4347
&& make PREFIX=/usr/local install \
4448
&& ln -s /usr/local/include/elpa-2021.05.002/elpa /usr/local/include/ \
4549
&& cd /tmp && rm -rf elpa-2021.05.002
46-
47-
RUN cd /tmp \
48-
&& git clone https://github.com/USCiLab/cereal.git \
49-
&& cp -r cereal/include /usr/local \
50-
&& rm -rf cereal

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ABACUS is an electronic structure package based on density functional theory(DFT
1717
Please refer to our [GitHub repository](https://github.com/deepmodeling/abacus-develop) for more information and support.
1818
# Table of contents
1919

20+
- [Table of contents](#table-of-contents)
2021
- [Features](#features)
2122
- [Download and install](#download-and-install)
2223
- [Quickstart guide](#quickstart-guide)
@@ -27,6 +28,7 @@ Please refer to our [GitHub repository](https://github.com/deepmodeling/abacus-d
2728
- [Citations](#citations)
2829
- [Development team](#development-team)
2930
- [Communicating and making contributions](#communicating-and-making-contributions)
31+
- [Miscellaneous](#miscellaneous)
3032

3133
# Features
3234

@@ -139,7 +141,7 @@ The following provides basic sample jobs in ABACUS. More can be found in the dir
139141
- [Basic electronic structure calculation with PW basis set](docs/examples/basic-pw.md)
140142
- [Basic electronic structure calculation with LCAO basis set](docs/examples/basic-lcao.md)
141143
- [DFT + dispersion calculations](docs/examples/dispersion.md)
142-
- [DOS, wave functions](docs/examples/dos.md)
144+
- [Density of states](docs/examples/dos.md)
143145
- [Band structure](docs/examples/band-struc.md)
144146
- [Magnetic properties](docs/examples/magnetic.md)
145147
- [Force calculation and structure relaxation](docs/examples/force.md)
@@ -153,6 +155,8 @@ The following provides basic sample jobs in ABACUS. More can be found in the dir
153155
- [Hybrid functional](docs/examples/hybrid.md)
154156
- [Electric field and dipole correction](docs/examples/electric_dipole.md)
155157
- [Stochastic DFT and mix stochastic-deterministic DFT](docs/examples/stochastic.md)
158+
- [Wave functions](docs/examples/wavefunction.md)
159+
- [BSSE for molecular formation energy](docs/examples/BSSE.md)
156160

157161
[back to top](#readme-top)
158162

0 commit comments

Comments
 (0)