Skip to content

Merge pull request #154 from streeve/optional_energy #551

Merge pull request #154 from streeve/optional_energy

Merge pull request #154 from streeve/optional_energy #551

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
jobs:
CI:
defaults:
run:
shell: bash
strategy:
matrix:
distro: ['ubuntu:latest']
cxx: ['g++', 'clang++']
backend: ['SERIAL', 'OPENMP']
cmake_build_type: ['Debug', 'Release']
kokkos_ver: ['3.7.02']
output: ['HDF5']
include:
- distro: 'ubuntu:latest'
cxx: 'g++'
backend: 'SERIAL'
cmake_build_type: 'Debug'
kokkos_ver: '3.7.02'
output: 'SILO'
- distro: 'ubuntu:latest'
cxx: 'g++'
backend: 'SERIAL'
cmake_build_type: 'Debug'
kokkos_ver: '3.7.02'
output: 'NONE'
- distro: 'ubuntu:latest'
cxx: 'g++'
backend: 'SERIAL'
cmake_build_type: 'Debug'
kokkos_ver: '3.7.02'
output: 'BOTH'
runs-on: ubuntu-20.04
container: ghcr.io/ecp-copa/ci-containers/${{ matrix.distro }}
steps:
- name: Checkout kokkos
uses: actions/checkout@v3
with:
repository: kokkos/kokkos
ref: ${{ matrix.kokkos_ver }}
path: kokkos
- name: Build kokkos
working-directory: kokkos
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
-DKokkos_ENABLE_${{ matrix.backend }}=ON \
-DKokkos_ENABLE_HWLOC=ON
cmake --build build --parallel 2
cmake --install build
- name: Checkout Cabana
uses: actions/checkout@v3
with:
repository: ECP-CoPA/Cabana
# This version is post-release 0.6
ref: f99c7db9d54c57373ada6b16132c20d89d1ebb8e
path: cabana
- name: Build Cabana
working-directory: cabana
run: |
if [[ ${{ matrix.output }} == 'HDF5' ]]; then
cabana_cmake_opts+=( -DCabana_REQUIRE_HDF5=ON -DCMAKE_DISABLE_FIND_PACKAGE_SILO=ON )
elif [[ ${{ matrix.output }} == 'SILO' ]]; then
cabana_cmake_opts+=( -DCabana_REQUIRE_SILO=ON -DCMAKE_DISABLE_FIND_PACKAGE_HDF5=ON )
elif [[ ${{ matrix.output }} == 'BOTH' ]]; then
cabana_cmake_opts+=( -DCabana_REQUIRE_SILO=ON -DCabana_REQUIRE_HDF5=ON )
else
cabana_cmake_opts+=( -DCMAKE_DISABLE_FIND_PACKAGE_SILO=ON -DCMAKE_DISABLE_FIND_PACKAGE_HDF5=ON )
fi
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_INSTALL_PREFIX=$HOME/Cabana \
-DCMAKE_PREFIX_PATH="$HOME/kokkos" \
-DCabana_DISABLE_CAJITA_DEPRECATION_WARNINGS=ON \
${cabana_cmake_opts[@]}
cmake --build build --parallel 2
cmake --install build
- name: Checkout CabanaPD
uses: actions/checkout@v3
- name: Build CabanaPD
run: |
cmake -B build \
-D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" \
-D CMAKE_INSTALL_PREFIX=$HOME/CabanaPD \
-D CMAKE_PREFIX_PATH="$HOME/Cabana" \
-D MPIEXEC_MAX_NUMPROCS=2 \
-D MPIEXEC_PREFLAGS="--oversubscribe" \
-D CabanaPD_ENABLE_TESTING=ON
cmake --build build --parallel 2
cmake --install build
- name: Test CabanaPD
run: |
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
HIP:
defaults:
run:
shell: bash
env:
# Needed because FindMPI relies heavily on the compiler wrappers, which aren't used with hipcc
MPI_LOCATION: /usr/lib/x86_64-linux-gnu/openmpi/
strategy:
matrix:
cxx: ['hipcc']
cmake_build_type: ['Release']
kokkos_ver: ['3.7.02']
runs-on: ubuntu-20.04
container: ghcr.io/ecp-copa/ci-containers/rocm:latest
steps:
- name: Checkout json
uses: actions/checkout@v3
with:
repository: nlohmann/json
ref: v3.11.2
path: json
- name: Build json
working-directory: json
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/json \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DJSON_BuildTests=OFF
cmake --build build --parallel 2
cmake --install build
- name: Checkout kokkos
uses: actions/checkout@v3
with:
repository: kokkos/kokkos
ref: ${{ matrix.kokkos_ver }}
path: kokkos
- name: Build kokkos
working-directory: kokkos
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
-DKokkos_ENABLE_HIP=ON \
-DKokkos_ARCH_VEGA908=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
cmake --build build --parallel 2
cmake --install build
- name: Checkout Cabana
uses: actions/checkout@v3
with:
repository: ECP-CoPA/Cabana
# This version is post-release 0.6
ref: f99c7db9d54c57373ada6b16132c20d89d1ebb8e
path: cabana
- name: Build Cabana
working-directory: cabana
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_INSTALL_PREFIX=$HOME/Cabana \
-DCMAKE_PREFIX_PATH="$HOME/kokkos" \
-DCMAKE_CXX_FLAGS="-I${MPI_LOCATION}/include" \
-DCMAKE_EXE_LINKER_FLAGS="-L${MPI_LOCATION}/lib -lmpi" \
-DCMAKE_SHARED_LINKER_FLAGS="-L${MPI_LOCATION}/lib -lmpi" \
-DCabana_DISABLE_CAJITA_DEPRECATION_WARNINGS=ON \
-DCabana_REQUIRE_MPI=ON
cmake --build build --parallel 2
cmake --install build
- name: Checkout CabanaPD
uses: actions/checkout@v3
- name: Build CabanaPD
run: |
cmake -B build \
-D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-D CMAKE_INSTALL_PREFIX=$HOME/CabanaPD \
-D CMAKE_PREFIX_PATH="$HOME/Cabana;$HOME/json" \
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror -I${MPI_LOCATION}/include" \
-D CMAKE_EXE_LINKER_FLAGS="-L${MPI_LOCATION}/lib -lmpi" \
-D CMAKE_SHARED_LINKER_FLAGS="-L${MPI_LOCATION}/lib -lmpi" \
-D MPIEXEC_MAX_NUMPROCS=2 \
-D MPIEXEC_PREFLAGS="--oversubscribe" \
-D CabanaPD_ENABLE_TESTING=ON
cmake --build build --parallel 2
cmake --install build
CUDA:
defaults:
run:
shell: bash
strategy:
matrix:
cmake_build_type: ['Release']
kokkos_ver: ['3.7.02']
runs-on: ubuntu-20.04
container: ghcr.io/ecp-copa/ci-containers/cuda:12.2.0
steps:
- name: Checkout json
uses: actions/checkout@v3
with:
repository: nlohmann/json
ref: v3.11.2
path: json
- name: Build json
working-directory: json
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/json \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DJSON_BuildTests=OFF
cmake --build build --parallel 2
cmake --install build
- name: Checkout kokkos
uses: actions/checkout@v3
with:
repository: kokkos/kokkos
ref: ${{ matrix.kokkos_ver }}
path: kokkos
- name: Build kokkos
working-directory: kokkos
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
-DKokkos_ENABLE_CUDA=ON \
-DKokkos_ARCH_VOLTA72=ON \
-DKokkos_ENABLE_CUDA_LAMBDA=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
cmake --build build --parallel 2
cmake --install build
- name: Checkout Cabana
uses: actions/checkout@v3
with:
repository: ECP-CoPA/Cabana
# This version is post-release 0.6
ref: f99c7db9d54c57373ada6b16132c20d89d1ebb8e
path: cabana
- name: Build Cabana
working-directory: cabana
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DCMAKE_INSTALL_PREFIX=$HOME/Cabana \
-DCMAKE_PREFIX_PATH="$HOME/kokkos" \
-DCabana_DISABLE_CAJITA_DEPRECATION_WARNINGS=ON \
-DCabana_REQUIRE_MPI=ON
cmake --build build --parallel 2
cmake --install build
- name: Checkout CabanaPD
uses: actions/checkout@v3
- name: Build CabanaPD
run: |
cmake -B build \
-D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" \
-D CMAKE_INSTALL_PREFIX=$HOME/CabanaPD \
-D CMAKE_PREFIX_PATH="$HOME/Cabana;$HOME/json" \
-D MPIEXEC_MAX_NUMPROCS=2 \
-D MPIEXEC_PREFLAGS="--oversubscribe" \
-D CabanaPD_ENABLE_TESTING=ON
cmake --build build --parallel 2
cmake --install build