Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: CUDA Backend for SN-HPC Solver + Singularity GPU Workflow + CPU/CUDA QoI Validation
Summary
This PR adds an optional CUDA backend for the SN-HPC solver and wires it into build, runtime dispatch, validation, and container workflows. The core goal is to run HPC SN lattice/hohlraum cases on a GPU while preserving existing CPU behavior when CUDA is not enabled or no GPU is visible.
By default, behavior is unchanged: CUDA is opt-in via
-DBUILD_CUDA_HPC=ON, and non-CUDA builds continue to use the existing CPU/OpenMP path.What Changed
Build and Configuration
BUILD_CUDA_HPCinCMakeLists.txt.BUILD_CUDA_HPC=ON.cudart) and CUDA-specific compile settings.src/solvers/snsolver_hpc.cuinclude/solvers/snsolver_hpc_cuda.hppRuntime Solver Dispatch
src/main.cppso HPC runs choose backend at runtime:cudaGetDeviceCount(...) > 0, runSNSolverHPCCUDA.SNSolverHPC.CUDA Solver Implementation
include/solvers/snsolver_hpc_cuda.hppsrc/solvers/snsolver_hpc.cuCPU Solver Consistency Updates
include/solvers/snsolver_hpc.hppandsrc/solvers/snsolver_hpc.cpp:_scalarFluxPrevIterMassandRMS_fluxcomputation to postprocessing based on synchronized scalar fluxValidation Coverage
tests/test_cases.cpp:SN_SOLVER_HPC_CUDA_QOI_VALIDATIONtests/input/validation_tests/SN_solver_hpc/:lattice_hpc_200_cpu_order1.cfglattice_hpc_200_cpu_order2.cfglattice_hpc_200_cuda_order1.cfglattice_hpc_200_cuda_order2.cfgsymmetric_hohlraum_hpc_200_cpu_order2.cfgsymmetric_hohlraum_hpc_200_cuda_order2.cfglattice_hpc_200_csv_referencesymmetric_hohlraum_hpc_200_csv_referenceContainer and Developer Workflow
tools/singularity/kit_rt_MPI_cuda.deftools/singularity/singularity_run_interactive_cuda.shtools/singularity/build_container.shtools/singularity/install_kitrt_singularity.shWhy This Is Needed
The SN-HPC path had no native in-repo GPU backend. This PR introduces a practical single-GPU CUDA implementation and connects it to reproducible build and execution paths, including containerized workflows and automated CPU-vs-CUDA QoI comparison tests.
Behavior and Compatibility
BUILD_CUDA_HPC=ON.Validation Strategy
--nvCUDA run flow in docs/scripts.Known Limitations and Follow-up Work
Reviewer Guide
Suggested review order:
CMakeLists.txtsrc/main.cppsrc/solvers/snsolver_hpc.cusrc/solvers/snsolver_hpc.cpptests/test_cases.cpptools/singularity/kit_rt_MPI_cuda.defREADME.md