This repository was archived by the owner on Aug 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (152 loc) · 6.97 KB
/
Copy pathtest.yml
File metadata and controls
169 lines (152 loc) · 6.97 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: 'Test Suite'
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
concurrency:
# PRs: group by branch (new push cancels old). Push to master: unique per SHA (never cancelled).
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: ${{ github.event_name != 'push' }}
jobs:
github:
name: ${{ matrix.nvhpc && format('NVHPC {0} ({1})', matrix.nvhpc, matrix.target) || format('Github ({0}, {1}, {2}, intel={3})', matrix.os, matrix.mpi, matrix.debug, matrix.intel) }}
if: >-
!cancelled()
strategy:
matrix:
os: ['ubuntu', 'macos']
mpi: ['mpi']
precision: ['']
debug: ['reldebug', 'no-debug']
intel: [true, false]
nvhpc: ['']
target: ['']
exclude:
- os: macos
intel: true
include:
# NVHPC compiler matrix: cpu (build+test), gpu (build-only, acc then omp)
# Every release from 23.11 through 26.3 (current)
- { nvhpc: '23.11', target: cpu }
- { nvhpc: '23.11', target: gpu }
- { nvhpc: '24.7', target: cpu }
- { nvhpc: '24.7', target: gpu }
- { nvhpc: '24.11', target: cpu }
- { nvhpc: '24.11', target: gpu }
- { nvhpc: '25.9', target: cpu }
- { nvhpc: '25.9', target: gpu }
fail-fast: false
continue-on-error: true
runs-on: ${{ matrix.nvhpc && 'ubuntu-22.04' || format('{0}-latest', matrix.os) }}
container:
image: ${{ matrix.nvhpc && format('nvcr.io/nvidia/nvhpc:{0}-devel-cuda_multi-ubuntu22.04', matrix.nvhpc) || '' }}
options: ${{ matrix.nvhpc && '--security-opt seccomp=unconfined' || '' }}
env:
CC: ${{ matrix.nvhpc && 'nvc' || '' }}
CXX: ${{ matrix.nvhpc && 'nvc++' || '' }}
FC: ${{ matrix.nvhpc && 'nvfortran' || '' }}
OMPI_ALLOW_RUN_AS_ROOT: ${{ matrix.nvhpc && '1' || '' }}
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: ${{ matrix.nvhpc && '1' || '' }}
PMIX_MCA_gds: ${{ matrix.nvhpc && 'hash' || '' }}
OMPI_MCA_hwloc_base_binding_policy: ${{ matrix.nvhpc && 'none' || '' }}
FFLAGS: ${{ matrix.nvhpc && '-tp=px -Kieee -noswitcherror' || '' }}
CFLAGS: ${{ matrix.nvhpc && '-tp=px' || '' }}
CXXFLAGS: ${{ matrix.nvhpc && '-tp=px' || '' }}
steps:
- name: Git safe directory
if: matrix.nvhpc
run: git config --global --add safe.directory /__w/figr/figr
- name: Clone
uses: actions/checkout@v4
- name: Fetch master for coverage diff
run: |
git fetch origin master:master --depth=1
git fetch --deepen=200
continue-on-error: true
- name: Setup MacOS
if: matrix.os == 'macos' && !matrix.nvhpc
run: |
brew update
brew upgrade || true
brew install coreutils python fftw hdf5 gcc@15 boost open-mpi lapack
echo "FC=gfortran-15" >> $GITHUB_ENV
echo "BOOST_INCLUDE=/opt/homebrew/include/" >> $GITHUB_ENV
- name: Setup Ubuntu
if: matrix.os == 'ubuntu' && matrix.intel == false && !matrix.nvhpc
run: |
sudo apt update -y
sudo apt install -y cmake gcc g++ python3 python3-dev hdf5-tools \
libfftw3-dev libhdf5-dev openmpi-bin libopenmpi-dev \
libblas-dev liblapack-dev
- name: Setup Ubuntu (Intel)
if: matrix.os == 'ubuntu' && matrix.intel == true
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
sudo apt-get install -y intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mpi intel-oneapi-mpi-devel
printenv | sort > /tmp/env_before
source /opt/intel/oneapi/setvars.sh
printenv | sort > /tmp/env_after
diff /tmp/env_before /tmp/env_after | grep '^>' | sed 's/^> //' >> $GITHUB_ENV
echo "FC=ifx" >> $GITHUB_ENV
echo "CC=icx" >> $GITHUB_ENV
echo "CXX=icpx" >> $GITHUB_ENV
echo "MPIFC=mpiifx" >> $GITHUB_ENV
echo "MPICC=mpiicx" >> $GITHUB_ENV
echo "MPICXX=mpiicpx" >> $GITHUB_ENV
# --- NVHPC container setup ---
- name: Setup NVHPC
if: matrix.nvhpc
run: |
apt-get update -y
apt-get install -y cmake python3 python3-venv python3-pip \
libfftw3-dev libhdf5-dev hdf5-tools git
# Set up NVHPC HPC-X MPI runtime paths
HPCX_DIR=$(dirname "$(find /opt/nvidia/hpc_sdk -path "*/hpcx/hpcx-*/ompi/bin/mpirun" | head -1)")/../..
MPI_LIB=$(mpifort --showme:link | grep -oP '(?<=-L)\S+' | head -1)
echo "LD_LIBRARY_PATH=${MPI_LIB}:${HPCX_DIR}/ucx/lib:${HPCX_DIR}/ucc/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
# Container MPI fixes: PMIx shared-memory, hwloc binding
echo "PMIX_MCA_gds=hash" >> $GITHUB_ENV
echo "OMPI_MCA_hwloc_base_binding_policy=none" >> $GITHUB_ENV
echo "OMPI_MCA_rmaps_base_oversubscribe=1" >> $GITHUB_ENV
# Debug: confirm compiler flags are set
echo "=== NVHPC Environment ==="
echo "FFLAGS=$FFLAGS"
echo "CFLAGS=$CFLAGS"
echo "CXXFLAGS=$CXXFLAGS"
nvfortran --version
cat /proc/cpuinfo | grep "model name" | head -1
# --- Standard build + test ---
- name: Build
if: '!matrix.nvhpc'
run: |
/bin/bash figr.sh test -v --dry-run -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }} $PRECISION $TEST_ALL
env:
TEST_ALL: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}
PRECISION: ${{ matrix.precision != '' && format('--{0}', matrix.precision) || '' }}
- name: Test
if: '!matrix.nvhpc'
run: |
/bin/bash figr.sh test -v --max-attempts 3 -j $(nproc) $ONLY_CHANGES $TEST_ALL $TEST_PCT
env:
TEST_ALL: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}
TEST_PCT: ${{ matrix.debug == 'reldebug' && '-% 20' || '' }}
ONLY_CHANGES: ${{ github.event_name == 'pull_request' && '--only-changes' || '' }}
# --- NVHPC build + test ---
- name: Build (NVHPC)
if: matrix.nvhpc && matrix.target == 'cpu'
run: /bin/bash figr.sh test -v --dry-run -j $(nproc) --test-all
- name: Build (NVHPC GPU)
if: matrix.nvhpc && matrix.target == 'gpu'
run: |
/bin/bash figr.sh test -v --dry-run -j 2 --test-all --gpu acc
/bin/bash figr.sh test -v --dry-run -j 2 --test-all --gpu mp
- name: Test (NVHPC)
if: matrix.nvhpc && matrix.target == 'cpu'
run: |
ulimit -s unlimited || ulimit -s 65536 || true
/bin/bash figr.sh test -v --max-attempts 3 -j $(nproc) --test-all