Skip to content

Add code_saturne v9.1.0 to validation suite - #19

Open
diskdog wants to merge 2 commits into
spectral-compute:masterfrom
diskdog:add-code_saturne
Open

Add code_saturne v9.1.0 to validation suite#19
diskdog wants to merge 2 commits into
spectral-compute:masterfrom
diskdog:add-code_saturne

Conversation

@diskdog

@diskdog diskdog commented Jun 5, 2026

Copy link
Copy Markdown

Summary

Adds clone, build, and run scripts for code_saturne v9.1.0, an open-source finite-volume CFD solver with CUDA-accelerated linear solvers. The validation runs a Cartesian channel-flow case and confirms that the GPU solver is dispatched and the run completes.

System prerequisites

The build requires packages not covered by the standard test environment:

sudo apt-get install -y autoconf automake libtool openmpi-bin libopenmpi-dev python3-dev

Build notes

code_saturne uses the autoconf/automake toolchain, not CMake.

Two non-obvious points:

  • MPI detection. Ubuntu's multiarch layout places the MPI installation under a non-standard prefix. The script uses ompi_info --path libdir to locate it reliably regardless of distro.
  • Architecture variable. code_saturne uses CUDA_ARCH_NUM (an integer, e.g. 75) rather than the CUDAARCHS variable that test.sh sets. The script bridges these; the fallback of 75 only applies when running outside test.sh.

Validation

02-run.sh creates a 100x100x1 Cartesian channel-flow case (inlet velocity at x=0, pressure outlet at x=1, no-slip walls elsewhere) and runs 10 time steps. It then asserts:

  1. A CUDA device was initialised (CUDA device in run_solver.log).
  2. The GPU sparse matrix-vector product was dispatched (device SpMV variant in performance.log).
  3. The run completed cleanly (END OF CALCULATION in run_solver.log).

Known workaround

CS_CUDA_ALLOC_DEVICE_UVM=1 is set unconditionally at the start of 02-run.sh. Without it, cs_sles_solve_ccc_fv allocates its extended solver buffers as CS_ALLOC_DEVICE (device-only) and then passes them to the CPU-side convergence check, causing a SIGSEGV. The flag remaps cs_alloc_mode_device to CS_ALLOC_HOST_DEVICE_SHARED at initialisation time. See cs_base_cuda.cu:777.

Status

Passes locally on sm_75 under both native CUDA 13.1 and SCALE 1.7.0. Results are marked ? pending CI validation on the repo's target hardware.

@diskdog
diskdog changed the base branch from release to master June 16, 2026 12:19
@diskdog
diskdog force-pushed the add-code_saturne branch from e57c908 to 72cb353 Compare June 16, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant