-
Notifications
You must be signed in to change notification settings - Fork 51
105 lines (87 loc) · 3 KB
/
spack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Spack
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test-spack:
strategy:
fail-fast: false
matrix:
include: # Include GPU build tests
- compiler: gcc
mpi: mpich
gpu: none
# - compiler: gcc
# mpi: mpich
# gpu: cuda
# - compiler: gcc
# mpi: mpich
# gpu: rocm
runs-on: palace_ubuntu-latest_16-core
steps:
- uses: actions/checkout@v4
- name: Configure Open MPI
if: matrix.mpi == 'openmpi'
run: |
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: Configure MPICH
if: matrix.mpi == 'mpich'
run: |
sudo apt-get install -y mpich libmpich-dev
- name: Configure Intel MPI
if: matrix.mpi == 'intelmpi'
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Configure Clang compiler
if: matrix.compiler == 'clang'
run: |
sudo apt-get install -y clang lld
- name: Configure Intel oneAPI compiler
if: matrix.compiler == 'intel'
run: |
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp=2024.2.1-1079 \
intel-oneapi-compiler-fortran=2024.2.1-1079
- uses: vsoch/spack-package-action/install@main
- name: Build Palace
run: |
# Clean up Android SDK install (confuses Spack MKL link line?)
sudo rm -rf $ANDROID_HOME
# Set up Spack to use external packages (MPI, etc.) and local Palace package
# recipe
. /opt/spack/share/spack/setup-env.sh
spack external find --all
spack repo add spack/local
# Configure GPU variant
if [[ "${{ matrix.gpu }}" == 'cuda' ]]; then
GPU_VARIANT="+cuda cuda_arch=70"
elif [[ "${{ matrix.gpu }}" == 'rocm' ]]; then
GPU_VARIANT="+rocm amdgpu_target=gfx900"
else
GPU_VARIANT=""
fi
# Build and install
PALACE_SPEC="local.palace@develop%${{ matrix.compiler }}$GPU_VARIANT ^${{ matrix.mpi }}"
PALACE_SPEC="$PALACE_SPEC ^petsc~hdf5 ^intel-oneapi-mkl"
spack spec $PALACE_SPEC
spack dev-build $PALACE_SPEC
- name: Run tests
if: matrix.gpu == 'none' # Skip tests for GPU builds
env:
NUM_PROC_TEST_MAX: '8'
run: |
# Configure environment
export NUM_PROC_TEST=$(nproc 2> /dev/null || sysctl -n hw.ncpu)
if [[ "$NUM_PROC_TEST" -gt "$NUM_PROC_TEST_MAX" ]]; then
NUM_PROC_TEST=$NUM_PROC_TEST_MAX
fi
. /opt/spack/share/spack/setup-env.sh
spack load palace
# Run tests
julia --project=test/examples -e 'using Pkg; Pkg.instantiate()'
julia --project=test/examples --color=yes test/examples/runtests.jl