Skip to content

#857: conditionally rely on PARALLEL WORKSHARE #1798

#857: conditionally rely on PARALLEL WORKSHARE

#857: conditionally rely on PARALLEL WORKSHARE #1798

Workflow file for this run

---
name: Testing on Linux
on:
push:
branches:
- 'develop'
pull_request:
jobs:
##################################################################################
# Run pre-commit
##################################################################################
pre-commit:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
steps:
- uses: actions/checkout@v4
- name: Run pre-commit
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
##################################################################################
# Build and test on linux, no accelerator
##################################################################################
build-and-test:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
strategy:
matrix:
use_mpi: [MPI=ON, MPI=OFF]
use_openmp: [OPENMP=ON, OPENMP=OFF]
use_smm: [SMM=blas, SMM=libxsmm]
mpi_suffix: [openmpi, mpich]
exclude:
- use_mpi: MPI=OFF
mpi_suffix: mpich
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Coverage \
-DUSE_${{ matrix.use_mpi }} \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_${{ matrix.use_smm }} \
-DMPI_EXECUTABLE_SUFFIX=.${{ matrix.mpi_suffix }} \
-DMPIEXEC_PREFLAGS="$([ "${{ matrix.mpi_suffix }}" = "openmpi" ] && echo "-mca btl ^openib --allow-run-as-root --oversubscribe")" \
-DLCOV_ARGS="--test-name;${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-cpu" \
-DTEST_MPI_RANKS=auto \
..
- name: Build
run: cmake --build build -- --verbose
- name: Test
run: |
cd build
ctest --output-on-failure
- name: Generate coverage info
run: |
cmake --build build -- cov-info
mv build/coverage.info build/coverage-Linux-${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-cpu.info
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-${{ matrix.mpi_suffix }}
path: build/coverage-*.info
- name: Upload coverage data (generated files)
uses: actions/upload-artifact@v4
if: matrix.use_mpi == 'MPI=ON' && matrix.use_openmp == 'OPENMP=ON' && matrix.use_smm == 'SMM=blas' && matrix.mpi_suffix == 'openmpi'
with:
name: coverage-data-${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-${{ matrix.mpi_suffix }}-generated-files
path: |
build/src/dbcsr.h
build/src/tensors/dbcsr_tensor.h
##################################################################################
# Build on CUDA
##################################################################################
build-on-cuda:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04-cuda:develop
strategy:
matrix:
use_openmp: [OPENMP=ON]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_ACCEL=cuda \
-DWITH_GPU=H100 \
-DWITH_EXAMPLES=ON \
-DWITH_CUDA_PROFILING=ON \
..
- name: Build
run: cmake --build build -- --verbose
##################################################################################
# Build on OpenCL
##################################################################################
build-on-opencl:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04-cuda:develop
strategy:
matrix:
use_openmp: [OPENMP=ON]
use_smm: [SMM=libxsmm]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_${{ matrix.use_smm }} \
-DUSE_ACCEL=opencl \
-DWITH_EXAMPLES=ON \
..
- name: Build
run: cmake --build build -- --verbose
##################################################################################
# Build on ROCm
##################################################################################
build-on-rocm:
runs-on: ubuntu-latest
container:
image: ghcr.io/cp2k/dbcsr-build-env-rocm:develop
strategy:
matrix:
use_openmp: [OPENMP=ON]
use_g2g: [G2G=ON, G2G=OFF]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_ACCEL=hip \
-DWITH_GPU=Mi250 \
-DWITH_${{ matrix.use_g2g }} \
-DWITH_EXAMPLES=ON \
-DCMAKE_PREFIX_PATH=/opt/rocm \
..
- name: Build
run: cmake --build build -- --verbose
coverage:
name: Combine & check coverage.
runs-on: ubuntu-latest
needs: build-and-test
container:
image: ghcr.io/cp2k/dbcsr-build-env-ubuntu-22.04:develop
steps:
- uses: actions/checkout@v4
- name: Download coverage data
uses: actions/download-artifact@v4.1.7
with:
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage
run: |
mkdir -p build/src
mv dbcsr.h tensors build/src/
echo *.info | xargs printf -- '-a %s\n' | xargs lcov -o merged.info
genhtml merged.info -o htmlcov
lcov --summary merged.info
- name: Upload merged HTML report
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
# vim: set ts=2 sw=2 tw=0 :