Skip to content

Add support for device vectors through a workaround #1116

Add support for device vectors through a workaround

Add support for device vectors through a workaround #1116

Workflow file for this run

name: linux
on:
push:
branches:
- 'master'
- 'dealii-*'
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
permissions:
contents: read
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_PARALLEL_LEVEL: 4
MAKEFLAGS: "--jobs=4"
jobs:
##################
# release-serial #
##################
release-serial:
# simple serial release build using g++
name: ${{ matrix.ubuntu_version }} release serial
runs-on: ubuntu-24.04
#
# The following condition only runs the workflow on 'push' or if the
# 'pull_request' is not a draft. This is only useful for hackathons or
# other situations when the CI is massively overburdened with pull
# requests.
#
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
strategy:
fail-fast: false
matrix:
ubuntu_version: [jammy, noble]
container:
image: dealii/dependencies:${{ matrix.ubuntu_version }}
options: --user root
steps:
- uses: actions/checkout@v5
- name: info
run: |
python --version
g++ -v
cmake --version
- name: configure deal.II
run: |
# sanitize PYTHONPATH
unset PYTHONPATH
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release \
-D DEAL_II_CXX_FLAGS='-Werror -std=c++20' \
-D DEAL_II_EARLY_DEPRECATIONS=ON \
-DDEAL_II_COMPONENT_PYTHON_BINDINGS=ON \
..
- name: print detailed.log
run: cat build/detailed.log
- name: build
run: |
cd build
make VERBOSE=1
- name: test
run: |
cd build
make \
setup_tests_a-framework \
setup_tests_examples \
setup_tests_quick_tests
ctest -VV
##################
# debug-parallel #
##################
debug-parallel:
# simple parallel debug build using g++
name: ${{ matrix.ubuntu_version }} ${{ matrix.architecture }} debug parallel
runs-on: ${{ matrix.os }}
#
# The following condition only runs the workflow on 'push' or if the
# 'pull_request' is not a draft. This is only useful for hackathons or
# other situations when the CI is massively overburdened with pull
# requests.
#
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
strategy:
fail-fast: false
matrix:
ubuntu_version: [jammy, noble]
os: [ubuntu-24.04, ubuntu-24.04-arm]
include:
- os: ubuntu-24.04
architecture: amd64
flags:
- os: ubuntu-24.04-arm
architecture: arm64
flags: -mno-outline-atomics
container:
image: dealii/dependencies:${{ matrix.ubuntu_version }}
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
steps:
- uses: actions/checkout@v5
- name: info
run: |
mpicc -v
cmake --version
- name: configure deal.II
run: |
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Debug \
-D DEAL_II_CXX_FLAGS='-Werror -std=c++20 ${{ matrix.flags }}' \
-D DEAL_II_EARLY_DEPRECATIONS=ON \
-D DEAL_II_WITH_MPI="ON" \
-D DEAL_II_WITH_CGAL="ON" \
-D DEAL_II_WITH_HDF5="ON" \
-D DEAL_II_WITH_METIS="ON" \
-D DEAL_II_WITH_PETSC="ON" \
-D DEAL_II_WITH_TRILINOS="ON" \
-D DEAL_II_WITH_VTK="ON" \
..
- name: print detailed.log
run: cat build/detailed.log
- name: build
run: |
cd build
make VERBOSE=1
- name: test
run: |
# Remove warning: "A high-performance Open MPI point-to-point
# messaging module was unable to find any relevant network
# interfaces."
export OMPI_MCA_btl_base_warn_component_unused='0'
cd build
make \
setup_tests_a-framework \
setup_tests_examples \
setup_tests_quick_tests
ctest -VV
#########################
# debug-parallel-tpetra #
#########################
debug-parallel-tpetra:
# simple parallel debug build using g++ and trilinos+tpetra
name: ${{ matrix.ubuntu_version }} debug parallel tpetra
runs-on: ubuntu-24.04
#
# The following condition only runs the workflow on 'push' or if the
# 'pull_request' is not a draft. This is only useful for hackathons or
# other situations when the CI is massively overburdened with pull
# requests.
#
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
strategy:
fail-fast: false
matrix:
ubuntu_version: [jammy, noble]
container:
image: dealii/dependencies:${{ matrix.ubuntu_version }}
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
steps:
- uses: actions/checkout@v5
- name: info
run: |
mpicc -v
cmake --version
- name: configure deal.II
run: |
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Debug \
-D DEAL_II_CXX_FLAGS='-std=c++20' \
-D DEAL_II_EARLY_DEPRECATIONS=ON \
-D DEAL_II_WITH_64BIT_INDICES="ON" \
-D DEAL_II_WITH_MPI="ON" \
-D DEAL_II_WITH_P4EST="ON" \
-D DEAL_II_WITH_TRILINOS="ON" \
..
- name: print detailed.log
run: cat build/detailed.log
- name: build
run: |
cd build
make VERBOSE=1
- name: test trilinos_tpetra
run: |
# Remove warning: "A high-performance Open MPI point-to-point
# messaging module was unable to find any relevant network
# interfaces."
export OMPI_MCA_btl_base_warn_component_unused='0'
cd build
make setup_tests_trilinos_tpetra
ctest -VV
######################
# debug-intel-oneapi #
######################
debug-intel-oneapi:
# parallel debug build with Intel oneAPI including MPI and MKL
#
# Based on https://github.com/oneapi-src/oneapi-ci
# For a list of Intel packages see https://oneapi-src.github.io/oneapi-ci/#linux-apt
name: jammy debug intel oneapi
runs-on: [ubuntu-22.04]
#
# The following condition only runs the workflow on 'push' or if the
# 'pull_request' is not a draft. This is only useful for hackathons or
# other situations when the CI is massively overburdened with pull
# requests.
#
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v5
- uses: rscohn2/setup-oneapi@v0
with:
components: |
icx
impi
mkl
tbb
- name: info
run: |
source /opt/intel/oneapi/setvars.sh
export I_MPI_CXX=icpx
mpiicpc -v
cmake --version
- name: configure deal.II
run: |
source /opt/intel/oneapi/setvars.sh
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_CXX_COMPILER=icpx \
-D DEAL_II_CXX_FLAGS='-Werror -Wno-error=tautological-constant-compare' \
-D DEAL_II_EARLY_DEPRECATIONS=ON \
-D DEAL_II_WITH_MPI=ON \
-D DEAL_II_WITH_LAPACK=ON \
-D DEAL_II_WITH_TBB=ON \
-D MPI_DIR=${I_MPI_ROOT} \
-D BLAS_DIR=${MKLROOT} \
-D LAPACK_DIR=${MKLROOT} \
-D TBB_DIR=${TBBROOT} \
..
- name: print detailed.log
run: cat build/detailed.log
- name: build
run: |
source /opt/intel/oneapi/setvars.sh
cd build
make VERBOSE=1
- name: test
run: |
source /opt/intel/oneapi/setvars.sh
cd build
make \
setup_tests_a-framework \
setup_tests_examples \
setup_tests_quick_tests
ctest -VV
#################
# debug-cuda-12 #
#################
debug-cuda-12:
# simple parallel debug build using cuda-12
name: jammy debug cuda-12
runs-on: [ubuntu-22.04]
#
# The following condition only runs the workflow on 'push' or if the
# 'pull_request' is not a draft. This is only useful for hackathons or
# other situations when the CI is massively overburdened with pull
# requests.
#
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
env:
CUDA_ROOT: /usr/local/cuda
steps:
- uses: actions/checkout@v5
- name: modules
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /"
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ginggs/deal.ii-9.6.0-backports
sudo apt-get update
sudo apt-get install -yq --no-install-recommends \
cuda-toolkit-12-3 \
libp4est-dev \
libopenmpi-dev \
numdiff \
openmpi-bin \
libboost-all-dev
# https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
- name: remove unused large packages
run : |
echo "=============================================================================="
echo "Freeing up disk space on CI system"
echo "=============================================================================="
echo "Listing 100 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
df -h
echo "Removing large packages"
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
df -h
echo "Removing large directories"
# deleting 15GB
rm -rf /usr/share/dotnet/
df -h
- uses: lukka/[email protected]
- name: info
run: |
mpicc -v
cmake --version
- uses: actions/checkout@v5
with:
repository: kokkos/kokkos
ref: 4.0.01
path: kokkos
- name: compile and install kokkos
working-directory: kokkos
run: |
mkdir build
cd build
cmake -D BUILD_SHARED_LIBS=ON \
-D CMAKE_CXX_COMPILER=${GITHUB_WORKSPACE}/kokkos/bin/nvcc_wrapper \
-D CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/../kokkos-install \
-D Kokkos_ENABLE_CUDA=ON \
-D Kokkos_ENABLE_CUDA_LAMBDA=ON \
-D Kokkos_ENABLE_CUDA_CONSTEXPR=ON \
-D Kokkos_ARCH_AMPERE80=ON \
..
make install
- name: configure deal.II
run: |
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_CXX_COMPILER=${GITHUB_WORKSPACE}/kokkos/bin/nvcc_wrapper \
-D DEAL_II_CXX_FLAGS='-Werror -Wno-non-template-friend' \
-D DEAL_II_EARLY_DEPRECATIONS=ON \
-D DEAL_II_WITH_KOKKOS="ON" \
-D KOKKOS_DIR=${GITHUB_WORKSPACE}/../kokkos-install \
-D DEAL_II_WITH_MPI="ON" \
-D DEAL_II_MPI_WITH_DEVICE_SUPPORT="ON" \
-D DEAL_II_WITH_P4EST="ON" \
..
- name: print detailed.log
run: cat build/detailed.log
- name: build deal.II
run: |
cd build
make VERBOSE=1
- name: build CUDA tests
run: |
cd build
make setup_tests_matrix_free_kokkos
cd tests/matrix_free_kokkos
make compile_test_executables
#######################
# debug-cuda-12-clang #
#######################
debug-cuda-12-clang:
# simple parallel debug build using cuda-12 and clang
name: jammy debug cuda-12 clang
runs-on: [ubuntu-22.04]
#
# The following condition only runs the workflow on 'push' or if the
# 'pull_request' is not a draft. This is only useful for hackathons or
# other situations when the CI is massively overburdened with pull
# requests.
#
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
env:
CUDA_ROOT: /usr/local/cuda
steps:
- uses: actions/checkout@v5
- name: modules
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /"
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ginggs/deal.ii-9.6.0-backports
sudo apt-get update
sudo apt-get install -yq --no-install-recommends \
cuda-toolkit-12-3 \
libp4est-dev \
libopenmpi-dev \
numdiff \
openmpi-bin \
libboost-all-dev
- uses: lukka/[email protected]
- name: info
run: |
mpicc -v
clang++-19 -v
cmake --version
- uses: actions/checkout@v5
with:
repository: kokkos/kokkos
ref: 4.0.01
path: kokkos
- name: compile and install kokkos
working-directory: kokkos
run: |
mkdir build
cd build
cmake -D BUILD_SHARED_LIBS=ON \
-D CMAKE_CXX_COMPILER=clang++-19 \
-D CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/../kokkos-install \
-D Kokkos_ENABLE_CUDA=ON \
-D Kokkos_ARCH_NATIVE=ON \
-D Kokkos_ARCH_AMPERE80=ON \
..
make install
- name: configure deal.II
run: |
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_CXX_COMPILER=clang++-19 \
-D DEAL_II_FORCE_BUNDLED_BOOST=ON \
-D DEAL_II_CXX_FLAGS="-std=c++17" \
-D DEAL_II_EARLY_DEPRECATIONS=ON \
-D DEAL_II_WITH_KOKKOS="ON" \
-D KOKKOS_DIR=${GITHUB_WORKSPACE}/../kokkos-install \
-D DEAL_II_WITH_MPI="ON" \
-D DEAL_II_MPI_WITH_DEVICE_SUPPORT="OFF" \
-D DEAL_II_WITH_P4EST="ON" \
..
- name: print detailed.log
run: cat build/detailed.log
- name: build deal.II
run: |
cd build
make VERBOSE=1
- name: build CUDA tests
run: |
cd build
make setup_tests_matrix_free_kokkos
cd tests/matrix_free_kokkos
make compile_test_executables
####################
# clang-20-modules #
####################
clang-20-modules:
# simple build testing C++20 modules
name: debian bookworm clang-20 modules
runs-on: [ubuntu-latest]
container:
image: gcc:15-bookworm
# The following condition only runs the workflow on 'push' or if the
# 'pull_request' is not a draft. This is only useful for hackathons or
# other situations when the CI is massively overburdened with pull
# requests.
#
# if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- name: modules
run: |
apt-get update
apt-get install -yq --no-install-recommends \
ninja-build wget lsb-release software-properties-common gnupg
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-20 main" | tee /etc/apt/sources.list.d/llvm.list
echo "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-20 main" | tee -a /etc/apt/sources.list.d/llvm.list
apt-get update && apt-get install -yq --no-install-recommends \
libc++-20-dev clang-tools-20 clang-20
- uses: lukka/[email protected]
- uses: actions/checkout@v5
with:
repository: kokkos/kokkos
ref: release-candidate-4.7.00
path: kokkos
- name: compile and install kokkos
working-directory: kokkos
run: |
mkdir build
cd build
cmake -GNinja \
-D BUILD_SHARED_LIBS=ON \
-D CMAKE_CXX_COMPILER=clang++-20 \
-D CMAKE_CXX_STANDARD=23 \
-D CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/../kokkos-install \
..
ninja install
- uses: actions/checkout@v5
- name: configure deal.II
run: |
mkdir build
cd build
export CXXFLAGS="-stdlib=libc++"
export LDFLAGS="-stdlib=libc++"
cmake -D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_CXX_STANDARD=23 \
-D CMAKE_C_COMPILER=clang-20 \
-D CMAKE_CXX_COMPILER=clang++-20 \
-D DEAL_II_EARLY_DEPRECATIONS=ON \
-D DEAL_II_WITH_CXX20_MODULE=ON \
-D KOKKOS_DIR=${GITHUB_WORKSPACE}/../kokkos-install \
-G Ninja \
..
- name: print detailed.log
run: cat build/detailed.log
- name: build deal.II
run: |
cd build
ninja --verbose dealii_module_debug