Skip to content

Commit

Permalink
Merge branch 'develop' into gint
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanchen authored May 5, 2024
2 parents b6027c6 + 96e8c59 commit e0ee4ab
Show file tree
Hide file tree
Showing 77 changed files with 1,989 additions and 946 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
jobs:
test-coverage:
name: Generate Coverage Report
runs-on: self-hosted
container: ghcr.io/deepmodeling/abacus-development-kit:gnu
runs-on: X64
container: ghcr.io/deepmodeling/abacus-gnu
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
81 changes: 7 additions & 74 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,88 +4,21 @@ on:
workflow_dispatch:

jobs:
start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.PAT }}
ec2-image-id: ami-04cd9fec4a7a39019
ec2-instance-type: g4dn.xlarge
subnet-id: subnet-72d3e53e
security-group-id: sg-06b0c93122c08aeab

test:
name: Do the job on the runner
needs: start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
name: Test on CUDA Build
runs-on: nvidia
container:
image: ghcr.io/deepmodeling/abacus-cuda
options: --gpus all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build cuSolver
with:
submodules: recursive
- name: Build
run: |
nvidia-smi
cmake -B build -DUSE_CUSOLVER_LCAO=ON
cmake -B build -DUSE_CUDA=ON -DBUILD_TESTING=ON
cmake --build build -j4
cmake --install build
cmake -B build -DBUILD_TESTING=ON
cmake --build build -j4 --target hsolver_diago
- name: Test e2e
run: |
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
cd tests/integrate
echo "ks_solver cusolver" >> ./270_NO_MD_2O/INPUT
./Autotest.sh -r 270_NO_MD_2O
- name: Test UT
run: |
cd source/src_pdiag/test/
cp ../../../build/source/src_pdiag/test/hsolver_diago .
./hsolver_diago
bash diago_parallel_test.sh
- name: Test performance
run: |
cd examples/performance
ls -d P1*lcao* > allcase
sed -i '/ks_solver/d' P1*lcao*/INPUT
sed -i '$a ks_solver cusolver' P1*lcao*/INPUT
bash run.sh
cat sumall.dat
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- test # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.PAT }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
# TODO: add tests
23 changes: 18 additions & 5 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on:
push:
branches:
- develop
tags:
- 'v*'
workflow_dispatch:

jobs:
build_container_and_push:
runs-on: self-hosted
runs-on: X64
if: github.repository_owner == 'deepmodeling'
strategy:
matrix:
Expand All @@ -16,6 +19,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/deepmodeling/abacus-${{ matrix.dockerfile }}
registry.dp.tech/deepmodeling/abacus-${{ matrix.dockerfile }}
tags: |
type=semver,pattern={{version}},enable=${{ github.ref_type == 'tag' }}
type=raw,value=latest
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -36,10 +50,9 @@ jobs:
- name: Build and Push Container
uses: docker/build-push-action@v5
with:
tags: |
ghcr.io/deepmodeling/abacus-${{ matrix.dockerfile }}:latest
registry.dp.tech/deepmodeling/abacus-${{ matrix.dockerfile }}:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: Dockerfile.${{ matrix.dockerfile }}
push: true
cache-from: type=registry,ref=ghcr.io/deepmodeling/abacus-${{ matrix.dockerfile }}:latest
cache-to: type=inline
push: true
2 changes: 1 addition & 1 deletion .github/workflows/dynamic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
test:
name: Dynamic analysis
runs-on: self-hosted
runs-on: X64
if: github.repository_owner == 'deepmodeling'
container: ghcr.io/deepmodeling/abacus-gnu
steps:
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/image.yml

This file was deleted.

56 changes: 2 additions & 54 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,9 @@ on:
workflow_dispatch:

jobs:
start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.PAT }}
ec2-image-id: ami-04cd9fec4a7a39019
ec2-instance-type: c5.9xlarge
subnet-id: subnet-72d3e53e
security-group-id: sg-06b0c93122c08aeab

test:
name: Performance test
needs: start-runner
runs-on: ${{ needs.start-runner.outputs.label }}
runs-on: X64
strategy:
matrix:
tag: ["gnu", "intel"]
Expand All @@ -43,39 +18,12 @@ jobs:
- name: Install Requirements
run: |
apt install -y time
- name: Build
run: |
cmake -B build -DENABLE_LIBXC=ON
cmake --build build -j`nproc`
cmake --install build
- name: Test
run: |
test -e /opt/intel/oneapi/setvars.sh && . /opt/intel/oneapi/setvars.sh
. /opt/intel/oneapi/setvars.sh || :
cd tests/performance/
bash run.sh
- name: Show Result
if: always()
run: |
cat tests/performance/sumall.dat
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- test # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.PAT }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
jobs:
test:
name: Test
runs-on: self-hosted
runs-on: X64
if: github.repository_owner == 'deepmodeling'
container:
image: ghcr.io/deepmodeling/abacus-gnu
Expand Down
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ option(COMMIT_INFO "Print commit information in log" ON)
option(ENABLE_FFT_TWO_CENTER "Enable FFT-based two-center integral method." ON)
option(ENABLE_GOOGLEBENCH "Enable GOOGLE-benchmark usage." OFF)
option(ENABLE_RAPIDJSON "Enable rapid-json usage." OFF)
option(ENABLE_CNPY "Enable cnpy usage." OFF)

# enable json support
if(ENABLE_RAPIDJSON)
Expand Down Expand Up @@ -470,6 +471,27 @@ if(ENABLE_DEEPKS)
add_compile_definitions(__DEEPKS)
endif()

if (ENABLE_CNPY)
find_path(cnpy_SOURCE_DIR
cnpy.h
HINTS ${libnpy_INCLUDE_DIR}
)
if(NOT cnpy_SOURCE_DIR)
include(FetchContent)
FetchContent_Declare(
cnpy
GIT_REPOSITORY https://github.com/rogersce/cnpy.git
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(cnpy)
else()
include_directories(${cnpy_INCLUDE_DIR})
endif()
include_directories(${cnpy_SOURCE_DIR})
target_link_libraries(${ABACUS_BIN_NAME} cnpy)
add_compile_definitions(__USECNPY)
endif()

function(git_submodule_update)
if(GIT_SUBMOD_RESULT EQUAL "0")
message(DEBUG "Submodule init'ed")
Expand Down
41 changes: 0 additions & 41 deletions Dockerfile

This file was deleted.

Loading

0 comments on commit e0ee4ab

Please sign in to comment.