Skip to content
This repository was archived by the owner on Aug 19, 2026. It is now read-only.

figr: IGR-only miniapp cleanup and feature port #13

figr: IGR-only miniapp cleanup and feature port

figr: IGR-only miniapp cleanup and feature port #13

Workflow file for this run

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