Nested-dissection supernodal Cholesky for 3D hex meshes
/app/cpu/main.cpp is a multicore CPU program (C++17, OpenMP). It is built as
/app/bin/cpu_baseline with g++ -O3 -march=native -fopenmp -std=c++17 and run as
cpu_baseline INPUT_FILE
It reads one input file and writes its result to stdout.
Nested-dissection supernodal Cholesky on 3D hex meshes
What the program computes
A structured three-dimensional hexahedral mesh defines an SPD matrix. Every cell contributes a seed-dependent positive Laplacian over its eight vertices; every vertex also receives a positive ground stiffness. The program orders vertices by recursive coordinate bisection, discovers separator fronts and their boundary variables, constructs the elimination tree and symbolic column counts, then performs multifrontal FP64 Cholesky. Child Schur complements are assembled into parent fronts. Forward and backward triangular solves recover a known generated displacement field. The final residual is recomputed against the original assembled matrix, not against the factor.
Input format
One line: NX NY NZ SYSTEMS SEED. Dimensions are 1..24 on each axis, SYSTEMS is any positive 32-bit integer, and SEED is an unsigned 64-bit integer. Distinct systems share the mesh geometry but use independent coefficient fields. Small dimensions, including one-vertex and two-vertex sides, are valid.
Output format
The first line contains the mean relative residual and a smooth solution-energy checksum as FP64 numbers. The second line contains exact labeled tokens nnz=, flops=, etree_height=, and pivot_digest=. nnz is the stored supernodal factor nonzero count and flops the symbolic Cholesky operation count. The pivot digest hashes coarse quantized diagonal pivots in global column order.
Hidden inputs
Correctness inputs cover small and uneven mesh dimensions, including 1 and 2, and multiple independent coefficient fields. Timing inputs have many small leaf fronts converging into large separator panels. Floating summaries are compared with relative tolerance 1e-9 and absolute tolerance 1e-11; labeled structural quantities and digest are exact.
Your task
Port this program to CUDA in /app/gpu/main.cu: same command line (PROGRAM INPUT_FILE),
same output on stdout. Then make it as fast as you can on the GPU while keeping the output correct.
The CPU source is the specification: when this text and the code disagree, the code wins.
How you are scored
- Only
/app/gpu/main.cuis collected. It is compiled withnvcc -O3 -arch=sm_90 -std=c++17 -o port /app/gpu/main.cu; no extra libraries are linked. The CUDA runtime and the header-only libraries that ship with the CUDA toolkit (CUB, Thrust, libcu++) are allowed. - Your source must not contain any of:
system(,popen(,fork(,exec*,dlopen(,getenv(,#include <filesystem>,/tests/,/proc/. The program may read only the input file it is given. - Grading runs on one H100 in a fresh container without network. Inputs are generated with a new random seed at grading time, so they cannot be known in advance.
- Correctness: every hidden input (small edge cases plus the timing input) must pass.
Your output must have the same tokens as the CPU program's output. Numeric tokens may differ by at most
atol + rtol*|expected|with rtol = 1e-09 and atol = 1e-11; every other token must be identical. Any mismatch, crash or timeout gives reward 0. - Speed: At scale 1.0, 32 independent 24-by-24-by-24 hex-element systems are ordered by coordinate-bisection nested dissection, yielding thousands of leaf fronts per system and dense 576-column top separators. System count grows with scale without a scale clamp. Your port and our GPU reference are each run on it
once to warm up and then 5 times, interleaved; the time is the wall clock of the whole process
(including CUDA initialisation, input parsing and output). When correct,
reward = min(2, t_reference / t_yours)using the medians. /app/inputs/holds a few public inputs./app/bin/run_public.shcompiles your port with the flags above and compares it against the CPU baseline on each of them.