Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3ebc4a7
ci: add NVHPC version matrix to GitHub runner CI
sbryngelson Mar 17, 2026
790dfbd
ci: consolidate NVHPC build steps using matrix.target
sbryngelson Mar 17, 2026
e72b8fc
ci: add OpenMP target offload (gpu-omp) to NVHPC matrix
sbryngelson Mar 17, 2026
4f44702
ci: fix NVHPC matrix by adding nvhpc/target as main axes with empty d…
sbryngelson Mar 17, 2026
fed16a2
ci: add matrix details to standard GitHub runner job names
sbryngelson Mar 17, 2026
00857fe
ci: add OpenMPI and HDF5 to NVHPC container setup
sbryngelson Mar 17, 2026
f38b5a2
ci: reduce NVHPC GPU build parallelism to -j 2 to avoid OOM
sbryngelson Mar 17, 2026
581645b
Merge branch 'master' into nvhpc
sbryngelson Mar 18, 2026
5bfaed3
Merge branch 'master' into nvhpc
sbryngelson Mar 18, 2026
23a0bd9
Merge branch 'master' into nvhpc
sbryngelson Mar 18, 2026
5ef74e3
Merge branch 'master' into nvhpc
sbryngelson Mar 27, 2026
5e8b22b
ci: add env diagnostics to NVHPC CPU test step
sbryngelson Mar 28, 2026
65bc2f8
fix: add missing private clauses for GPU offload; disable ZFP in silo…
sbryngelson Mar 29, 2026
066089f
style: format m_riemann_solvers.fpp
sbryngelson Mar 29, 2026
9472f4d
ci: fix git safe.directory in NVHPC containers to silence ownership w…
sbryngelson Mar 29, 2026
ff30d8a
fix: use assumed-shape array in s_initialize_internal_energy_equations
sbryngelson Mar 29, 2026
dc12849
style: format m_start_up.fpp
sbryngelson Mar 29, 2026
627d01a
Revert "style: format m_start_up.fpp"
sbryngelson Mar 29, 2026
4ad88a9
Revert "fix: use assumed-shape array in s_initialize_internal_energy_…
sbryngelson Mar 29, 2026
20288ec
fix: remove system OpenMPI from NVHPC containers; enable IPO for all …
sbryngelson Mar 29, 2026
f64894f
style: format m_time_steppers.fpp
sbryngelson Mar 29, 2026
1a60cbe
ci: move git safe.directory before checkout to fix NVHPC 25.3 clone f…
sbryngelson Mar 29, 2026
419132c
fix: exclude 3 functions from IPO cross-inlining to fix NVHPC 24.11/2…
sbryngelson Mar 29, 2026
b30a38b
fix: add s_mpi_abort and s_mpi_barrier to IPO except list for NVHPC 25.3
sbryngelson Mar 30, 2026
2c4dd4b
fix: add s_prohibit_abort to IPO except list for NVHPC 25.3
sbryngelson Mar 30, 2026
ebf82b4
fix: remove dead noinline directive (handled by CMake except: instead)
sbryngelson Mar 30, 2026
26d82be
fix: add s_int_to_str to IPO except list for NVHPC 25.3
sbryngelson Mar 30, 2026
fb2b897
fix: add s_associate_cbc_coefficients_pointers and totalsize:10000 fo…
sbryngelson Mar 30, 2026
f38948b
fix: remove totalsize:10000 from IPO inline pass (may hurt performance)
sbryngelson Mar 30, 2026
d47b0d7
ci: add NVHPC 25.7 to test matrix
sbryngelson Mar 30, 2026
e623a0e
fix: exclude patch check functions from IPO for NVHPC 25.x pre_proces…
sbryngelson Mar 30, 2026
35f8160
ci: add NVHPC MPI lib path to LD_LIBRARY_PATH for runtime linking
sbryngelson Mar 30, 2026
ef07069
fix: exclude s_check_patches from IPO to prevent pre_process ICE on N…
sbryngelson Mar 30, 2026
1d5249d
ci: add NVHPC 26.1 to test matrix
sbryngelson Mar 30, 2026
2e6a5ff
ci: add NVHPC 26.3 to test matrix
sbryngelson Mar 30, 2026
cf4e6c6
ci: remove 26.3 (not yet released); 26.1 is latest
sbryngelson Mar 30, 2026
8132d1e
ci: add NVHPC 26.3 (latest release) to test matrix
sbryngelson Mar 30, 2026
36d5020
fix: disable cross-file inlining for m_start_up.fpp to fix NVHPC 25.x…
sbryngelson Mar 30, 2026
809c4c6
fix: also disable cross-file inlining for m_cbc.fpp (boundary code, t…
sbryngelson Mar 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 105 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
continue-on-error: true

github:
name: 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) }}
needs: [lint-gate, file-changes, rebuild-cache]
if: >-
!cancelled() &&
Expand All @@ -164,6 +164,8 @@ jobs:
precision: ['']
debug: ['debug', 'no-debug']
intel: [true, false]
nvhpc: ['']
target: ['']
exclude:
- os: macos
intel: true
Expand All @@ -175,11 +177,78 @@ jobs:
debug: no-debug
intel: false

# NVHPC compiler matrix (CPU build+test, GPU build-only)
- nvhpc: '23.11'
target: cpu
- nvhpc: '23.11'
target: gpu-acc
- nvhpc: '23.11'
target: gpu-omp
- nvhpc: '24.5'
target: cpu
- nvhpc: '24.5'
target: gpu-acc
- nvhpc: '24.5'
target: gpu-omp
- nvhpc: '24.11'
target: cpu
- nvhpc: '24.11'
target: gpu-acc
- nvhpc: '24.11'
target: gpu-omp
- nvhpc: '25.1'
target: cpu
- nvhpc: '25.1'
target: gpu-acc
- nvhpc: '25.1'
target: gpu-omp
- nvhpc: '25.3'
target: cpu
- nvhpc: '25.3'
target: gpu-acc
- nvhpc: '25.3'
target: gpu-omp
- nvhpc: '25.5'
target: cpu
- nvhpc: '25.5'
target: gpu-acc
- nvhpc: '25.5'
target: gpu-omp
- nvhpc: '25.7'
target: cpu
- nvhpc: '25.7'
target: gpu-acc
- nvhpc: '25.7'
target: gpu-omp
- nvhpc: '26.1'
target: cpu
- nvhpc: '26.1'
target: gpu-acc
- nvhpc: '26.1'
target: gpu-omp
- nvhpc: '26.3'
target: cpu
- nvhpc: '26.3'
target: gpu-acc
- nvhpc: '26.3'
target: gpu-omp

fail-fast: false
continue-on-error: true
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.nvhpc && 'ubuntu-22.04' || format('{0}-latest', matrix.os) }}
container: ${{ matrix.nvhpc && format('nvcr.io/nvidia/nvhpc:{0}-devel-cuda_multi-ubuntu22.04', matrix.nvhpc) || '' }}
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' || '' }}

steps:
- name: Git safe directory
if: matrix.nvhpc
run: git config --global --add safe.directory /__w/MFC/MFC

- name: Clone
uses: actions/checkout@v4

Expand Down Expand Up @@ -222,7 +291,7 @@ jobs:
fi

- name: Setup MacOS
if: matrix.os == 'macos'
if: matrix.os == 'macos' && !matrix.nvhpc
run: |
brew update
brew upgrade || true
Expand All @@ -231,7 +300,7 @@ jobs:
echo "BOOST_INCLUDE=/opt/homebrew/include/" >> $GITHUB_ENV

- name: Setup Ubuntu
if: matrix.os == 'ubuntu' && matrix.intel == false
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 \
Expand All @@ -254,21 +323,53 @@ jobs:
printenv | sort > /tmp/env_after
diff /tmp/env_before /tmp/env_after | grep '^>' | sed 's/^> //' >> $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
MPI_LIB=$(dirname "$(mpifort --showme:link | grep -oP '/\S+/libmpi\S+' | head -1)")
echo "LD_LIBRARY_PATH=${MPI_LIB}:${LD_LIBRARY_PATH}" >> $GITHUB_ENV

# --- Standard build + test ---
- name: Build
if: '!matrix.nvhpc'
run: |
/bin/bash mfc.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 mfc.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 == 'debug' && '-% 20' || '' }}
ONLY_CHANGES: ${{ github.event_name == 'pull_request' && '--only-changes' || '' }}

# --- NVHPC build + test ---
- name: Build (NVHPC)
if: matrix.nvhpc
run: /bin/bash mfc.sh test -v --dry-run -j ${{ matrix.target == 'cpu' && '$(nproc)' || '2' }} --test-all $GPU
env:
GPU: ${{ matrix.target == 'gpu-acc' && '--gpu acc' || matrix.target == 'gpu-omp' && '--gpu mp' || '' }}

- name: Test (NVHPC)
if: matrix.nvhpc && matrix.target == 'cpu'
run: |
echo "=== NVHPC CPU test env debug ==="
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "PATH=$PATH"
echo "which mpirun: $(which mpirun)"
echo "which nvfortran: $(which nvfortran)"
ldd $(find build/install -name simulation -type f | head -1) 2>/dev/null | head -20
echo "=== end debug ==="
/bin/bash mfc.sh test -v --max-attempts 3 -j $(nproc) --test-all

self:
name: "${{ matrix.cluster_name }} (${{ matrix.device }}${{ matrix.interface != 'none' && format('-{0}', matrix.interface) || '' }}${{ matrix.shard != '' && format(' [{0}]', matrix.shard) || '' }})"
needs: [lint-gate, file-changes, rebuild-cache]
Expand Down
20 changes: 14 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Release")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
if (MFC_Unified)
message(STATUS "LTO/IPO is not available with NVHPC using Unified Memory")
elseif (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER "24.11" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "25.9")
message(STATUS "LTO/IPO is not supported in NVHPC Version 24.11 to 25.9. Use >=25.9 or (<=24.11 && > 23.11) Performance will be degraded.")
set(NVHPC_USE_TWO_PASS_IPO FALSE)
elseif(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "23.11")
message(STATUS "LTO/IPO is not supported in NVHPC Version < 23.11. Use a newer version of NVHPC for best performance.")
else()
message(STATUS "Performing IPO using -Mextract followed by -Minline")
set(NVHPC_USE_TWO_PASS_IPO TRUE)
Expand Down Expand Up @@ -453,7 +448,20 @@ function(MFC_SETUP_TARGET)
$<$<COMPILE_LANGUAGE:Fortran>:-Minline>
)
add_dependencies(${ARGS_TARGET} ${ARGS_TARGET}_lib)
target_compile_options(${ARGS_TARGET} PRIVATE -Minline=lib:${ARGS_TARGET}_lib)
target_compile_options(${ARGS_TARGET} PRIVATE -Minline=lib:${ARGS_TARGET}_lib,except:f_is_default,except:s_compute_dt,except:my_inquire,except:s_mpi_abort,except:s_mpi_barrier,except:s_prohibit_abort,except:s_int_to_str,except:s_associate_cbc_coefficients_pointers)

# Exclude m_start_up and m_cbc from cross-file inlining: these are
# initialization/boundary code that trigger NVHPC 25.x fort2 ICE when
# too many functions are cross-inlined into them. GPU hot-path files
# (m_rhs, m_riemann_solvers, m_viscous, m_weno, etc.) keep full IPO.
foreach(_no_inline_file m_start_up m_cbc)
set_source_files_properties(
"${CMAKE_BINARY_DIR}/fypp/${ARGS_TARGET}/${_no_inline_file}.fpp.f90"
TARGET_DIRECTORY ${ARGS_TARGET}
PROPERTIES COMPILE_OPTIONS "-Mnoinline"
)
endforeach()

list(PREPEND IPO_TARGETS ${ARGS_TARGET}_lib)
endif()

Expand Down
6 changes: 4 additions & 2 deletions src/simulation/m_riemann_solvers.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,8 @@ contains
& G_L, G_R, rho_avg, H_avg, c_avg, gamma_avg, ptilde_L, ptilde_R, vel_L_rms, vel_R_rms, &
& vel_avg_rms, vel_L_tmp, vel_R_tmp, Ms_L, Ms_R, pres_SL, pres_SR, alpha_L_sum, &
& alpha_R_sum, rho_Star, E_Star, p_Star, p_K_Star, vel_K_star, s_L, s_R, s_M, s_P, s_S, &
& xi_M, xi_P, xi_L, xi_R, xi_MP, xi_PP]')
& xi_M, xi_P, xi_L, xi_R, xi_MP, xi_PP, Ys_L, Ys_R, Cp_iL, Cp_iR, Xs_L, Xs_R, Gamma_iL, &
& Gamma_iR, Yi_avg, Phi_avg, h_iL, h_iR, h_avg_2]')
do l = is3%beg, is3%end
do k = is2%beg, is2%end
do j = is1%beg, is1%end
Expand Down Expand Up @@ -2423,7 +2424,8 @@ contains
& qv_R, qv_avg, c_L, c_R, c_avg, vel_L_rms, vel_R_rms, vel_avg_rms, vel_L_tmp, vel_R_tmp, &
& Ms_L, Ms_R, pres_SL, pres_SR, alpha_L_sum, alpha_R_sum, s_L, s_R, s_M, s_P, s_S, xi_M, &
& xi_P, xi_L, xi_R, xi_MP, xi_PP, nbub_L, nbub_R, PbwR3Lbar, PbwR3Rbar, R3Lbar, R3Rbar, &
& R3V2Lbar, R3V2Rbar]')
& R3V2Lbar, R3V2Rbar, Ys_L, Ys_R, Cp_iL, Cp_iR, Xs_L, Xs_R, Gamma_iL, Gamma_iR, Yi_avg, &
& Phi_avg, h_iL, h_iR, h_avg_2]')
do l = is3%beg, is3%end
do k = is2%beg, is2%end
do j = is1%beg, is1%end
Expand Down
8 changes: 6 additions & 2 deletions toolchain/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ if (MFC_HDF5)
GIT_PROGRESS ON
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
-DBUILD_SHARED_LIBS=OFF
-DFORTRAN_LIBRARIES=ON
-DBUILD_TESTING=OFF
-DHDF5_BUILD_UTILS=OFF
-DHDF5_BUILD_TOOLS=ON
-DHDF5_BUILD_EXAMPLES=OFF
-DHDF5_BUILD_CPP_LIB=OFF
-DHDF5_BUILD_FORTRAN=OFF
-DHDF5_ENABLE_PARALLEL=OFF
)
endif()
endif()
Expand All @@ -82,13 +84,15 @@ if (MFC_SILO)

ExternalProject_Add(silo
GIT_REPOSITORY "https://github.com/LLNL/Silo"
GIT_TAG 0cddaa6865fb49ae7b2110fa1b6f2709592abe0b
GIT_TAG 4.12.0
GIT_SHALLOW ON
GIT_PROGRESS ON
PATCH_COMMAND "${GIT_EXECUTABLE}" stash
&& "${GIT_EXECUTABLE}" apply "${CMAKE_SOURCE_DIR}/Silo.patch"
CMAKE_ARGS -DSILO_ENABLE_SHARED=OFF
-DSILO_ENABLE_SILOCK=OFF
-DSILO_ENABLE_BROWSER=OFF
-DSILO_ENABLE_ZFP=OFF
-DFIND_LIBRARY_USE_LIB64_PATHS=ON
"-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
"-DCMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH}"
Expand Down
Loading