Skip to content

Commit 6887565

Browse files
committed
Merge branch 'develop' of github.com:deepmodeling/abacus-develop into HSolver
2 parents 3b6b940 + 7b04021 commit 6887565

File tree

140 files changed

+6902
-3876
lines changed

Some content is hidden

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

140 files changed

+6902
-3876
lines changed

.github/workflows/cuda.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CUDA Test
2+
3+
on:
4+
workflow_dispatch:
5+
6+
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: g4dn.xlarge
28+
subnet-id: subnet-72d3e53e
29+
security-group-id: sg-06b0c93122c08aeab
30+
31+
test:
32+
name: Do the job on the runner
33+
needs: start-runner # required to start the main job when the runner is ready
34+
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
35+
container:
36+
image: ghcr.io/deepmodeling/abacus-development-kit:cuda
37+
options: --gpus all
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
- name: Build cuSolver
42+
run: |
43+
nvidia-smi
44+
cmake -B build -DUSE_CUSOLVER_LCAO=ON
45+
cmake --build build -j4
46+
cmake --install build
47+
- name: Test
48+
run: |
49+
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
50+
cd tests/integrate
51+
echo "ks_solver cusolver" >> ./270_NO_MD_2O/INPUT
52+
./Autotest.sh -r 270_NO_MD_2O
53+
54+
stop-runner:
55+
name: Stop self-hosted EC2 runner
56+
needs:
57+
- start-runner # required to get output from the start-runner job
58+
- test # required to wait when the main job is done
59+
runs-on: ubuntu-latest
60+
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
61+
steps:
62+
- name: Configure AWS credentials
63+
uses: aws-actions/configure-aws-credentials@v1
64+
with:
65+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
66+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
67+
aws-region: us-east-2
68+
- name: Stop EC2 runner
69+
uses: machulav/ec2-github-runner@v2
70+
with:
71+
mode: stop
72+
github-token: ${{ secrets.PAT }}
73+
label: ${{ needs.start-runner.outputs.label }}
74+
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}

.github/workflows/container.yml renamed to .github/workflows/devcontainer.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
build_container_and_push:
1010
runs-on: ubuntu-latest
11+
if: github.repository_owner == 'deepmodeling'
1112
strategy:
1213
matrix:
1314
dockerfile: ["gnu","intel","cuda"]
@@ -25,10 +26,19 @@ jobs:
2526
username: ${{ github.actor }}
2627
password: ${{ secrets.GITHUB_TOKEN }}
2728

29+
- name: Login to Aliyun Registry
30+
uses: docker/login-action@v1
31+
with:
32+
registry: ${{ secrets.DP_HARBOR_REGISTRY }}
33+
username: ${{ secrets.DP_HARBOR_USERNAME }}
34+
password: ${{ secrets.DP_HARBOR_PASSWORD }}
35+
2836
- name: Build and Push Container
2937
uses: docker/build-push-action@v2
3038
with:
31-
tags: ghcr.io/${{ github.repository_owner }}/abacus-development-kit:${{ matrix.dockerfile }}
39+
tags: |
40+
ghcr.io/${{ github.repository_owner }}/abacus-development-kit:${{ matrix.dockerfile }}
41+
${{ secrets.DP_HARBOR_REGISTRY }}/dplc/abacus-${{ matrix.dockerfile }}:latest
3242
file: Dockerfile.${{ matrix.dockerfile }}
3343
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/abacus-development-kit:${{matrix.dockerfile}}
3444
cache-to: type=inline

.github/workflows/image.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Image
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build_container_and_push:
10+
runs-on: ubuntu-latest
11+
if: github.repository_owner == 'deepmodeling'
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Docker Buildx
17+
uses: docker/setup-buildx-action@v1
18+
19+
- name: Login to GitHub Container Registry
20+
uses: docker/login-action@v1
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Login to Aliyun Registry
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ${{ secrets.DP_HARBOR_REGISTRY }}
30+
username: ${{ secrets.DP_HARBOR_USERNAME }}
31+
password: ${{ secrets.DP_HARBOR_PASSWORD }}
32+
33+
- name: Build and Push Container
34+
uses: docker/build-push-action@v2
35+
with:
36+
tags: |
37+
ghcr.io/${{ github.repository_owner }}/abacus:latest
38+
${{ secrets.DP_HARBOR_REGISTRY }}/dplc/abacus:latest
39+
file: Dockerfile
40+
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/abacus:latest
41+
cache-to: type=inline
42+
push: true

.github/workflows/performance.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Performance test
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test:
8+
name: Performance test
9+
runs-on: self-hosted
10+
strategy:
11+
matrix:
12+
tag: ["gnu", "intel"]
13+
if: github.repository_owner == 'deepmodeling'
14+
container: ghcr.io/${{ github.repository_owner }}/abacus-development-kit:${{ matrix.tag }}
15+
timeout-minutes: 2880
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Install Requirements
20+
run: |
21+
apt install -y time
22+
- name: Build
23+
run: |
24+
cmake -B build -DENABLE_LIBXC=ON
25+
cmake --build build -j16
26+
cmake --install build
27+
- name: Test
28+
run: |
29+
. /opt/intel/oneapi/setvars.sh 2> /dev/null || :
30+
cd examples/performance/
31+
bash run.sh
32+
- name: Show Result
33+
run: |
34+
cat examples/performance/sumall.dat

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
ref: "refs/pull/${{ github.event.number }}/merge"
1717
- name: Build
1818
run: |
19-
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON
19+
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON
2020
cmake --build build -j8
2121
cmake --install build
2222
- name: Test

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ target_link_libraries(${ABACUS_BIN_NAME}
282282
cell
283283
symmetry
284284
md
285+
planewave
285286
surchem
286287
neighbor
287288
orb

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# To build this docker file, run `docker build -t abacus - < Dockerfile`.
2+
FROM ubuntu:latest
3+
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
4+
# If you wish to use the LLVM compiler, replace 'g++' above with 'clang libomp-dev'.
5+
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
6+
# If you have trouble cloning repo, replace "github.com" with "gitee.com".
7+
ENV OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 OMPI_MCA_btl_vader_single_copy_mechanism=none
8+
CMD mpirun --use-hwthread-cpus abacus
9+
10+
# To run ABACUS built by this image with all available threads, execute `docker run -v <host>:<wd> -w <wd/input> abacus`.
11+
# Replace '<host>' with the path to all files(including pseudopotential files), '<wd>' with a path to working directory, and '<wd/input>' with the path to input folder(containing 'INPUT', 'STRU', etc.).
12+
# e.g. after clone the repo to `$HOME` and pulled this image, execute `docker run -v ~/abacus-develop/tests/integrate:/workspace -w /workspace/101_PW_15_f_pseudopots abacus`.
13+
# To run ABACUS with a given MPI process number, execute `docker run -v <host>:<wd> -w <wd/input> -it --entrypoint mpirun abacus -np <processes> abacus`. Note: the first "abacus" is the name of the image, the second "abacus" is the name of the executable file. Do not use '--cpus' flag of 'docker run' to specify the number of processes.
14+
15+
# To use this image as developing environment, execute `docker run -it --entrypoint /bin/bash abacus`.
16+
# Please refer to https://docs.docker.com/engine/reference/commandline/run/ for more details.

Dockerfile.cuda

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ghcr.io/deepmodeling/abacus-development-kit:gnu
22

3-
RUN wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --no-check-certificate --quiet \
4-
&& sh cuda_11.4.2_470.57.02_linux.run --toolkit --silent \
5-
&& rm cuda_11.4.2_470.57.02_linux.run
3+
RUN wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run --no-check-certificate --quiet \
4+
&& sh cuda_11.7.0_515.43.04_linux.run --toolkit --silent \
5+
&& rm cuda_11.7.0_515.43.04_linux.run
66
ENV PATH=/usr/local/cuda/bin:$PATH

docs/input-main.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070

7171
[deepks_out_labels](#out-descriptor) | [deepks_descriptor_lmax](#lmax-descriptor) | [deepks_scf](#deepks-scf) | [deepks_model](#model-file)
7272

73+
- [Electric field and dipole correction](#Electric-field-and-dipole-correction)
74+
75+
[efield](#efield) | [dipole](#dipole) | [edir](#edir) | [emaxpos](#emaxpos) | [eopreg](#eopreg) | [eamp](#eamp)
76+
7377
[back to main page](../README.md)
7478

7579
## Structure of the file
@@ -910,6 +914,48 @@ Warning: this function is not robust enough for version 2.2.0. Please try these
910914
- **Description**: the path of the trained, traced NN model file (generated by deepks-kit). used when deepks_scf is set to 1.
911915
- **Default**: None
912916
917+
### Electric field and dipole correction
918+
919+
This part of variables are relevant to electric field and dipole correction
920+
921+
#### efield
922+
923+
- **Type**: Boolean
924+
- **Description**: If set to true, a saw-like potential simulating an electric field
925+
is added to the bare ionic potential.
926+
- **Default**: false
927+
928+
#### dipole
929+
930+
- **Type**: Boolean
931+
- **Description**: If dipole == true and efield == true, a dipole correction is also
932+
added to the bare ionic potential. If you want no electric field, parameter eamp should be zero. Must be used ONLY in a slab geometry for surface calculations, with the discontinuity FALLING IN THE EMPTY SPACE.
933+
- **Default**: false
934+
935+
#### edir
936+
937+
- **Type**: Integer
938+
- **Description**: The direction of the electric field or dipole correction is parallel to the reciprocal lattice vector, so the potential is constant in planes defined by FFT grid points, edir = 0, 1 or 2. Used only if efield == true.
939+
- **Default**: 2
940+
941+
#### emaxpos
942+
943+
- **Type**: Real
944+
- **Description**: Position of the maximum of the saw-like potential along crystal axis edir, within the unit cell, 0 < emaxpos < 1. Used only if efield == true.
945+
- **Default**: 0.5
946+
947+
#### eopreg
948+
949+
- **Type**: Real
950+
- **Description**: Zone in the unit cell where the saw-like potential decreases, 0 < eopreg < 1. Used only if efield == true.
951+
- **Default**: 0.1
952+
953+
#### eamp
954+
955+
- **Type**: Real
956+
- **Description**: Amplitude of the electric field, in ***Hartree*** a.u.; 1 a.u. = 51.4220632*10^10 V/m. Used only if efield == true. The saw-like potential increases with slope eamp in the region from (emaxpos+eopreg-1) to (emaxpos), then decreases until (emaxpos+eopreg), in units of the crystal vector edir. Important: the change of slope of this potential must be located in the empty region, or else unphysical forces will result.
957+
- **Default**: 0.0
958+
913959
### Exact Exchange
914960
915961
This part of variables are relevant when using hybrid functionals

examples/performance/clean.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)