Port ILU to GPU - #2858
Open
pcarruscag wants to merge 24 commits into
Open
Conversation
Colored-iterative forward/backward substitution needed too many sweeps to be useful on stiffer systems (e.g. large RANS cases with highly anisotropic near-wall cells), so the triangular solves go back to exact, level-scheduled kernels (one pass, no sweep count). The factorization stays colored/iterative, which converges quickly regardless of matrix stiffness. LINEAR_SOLVER_ILU_GPU_SWEEPS is now a single scalar (build sweeps only) instead of a 3-entry array, since the solves no longer sweep. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Consolidates LINEAR_SOLVER_ILU_FILL_IN, LINEAR_SOLVER_ILU_LEVEL_SCHEDULING, and LINEAR_SOLVER_ILU_GPU_SWEEPS behind one struct/getter (GetIluOptions), following the same pattern already used for other option families (e.g. CMGOptions). Config keys and defaults are unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
pcarruscag
commented
Aug 8, 2026
- CSysMatrix.hpp: trim member-doc comments down to what the members are, drop design/alternatives narrative and CUDA-graph rationale duplicated at the call sites. - CSysMatrix.cpp: factor repeated GPU LDU free/alloc sequences into local helper lambdas (freeLDU, reused GPUAllocAndInit/GPUAllocAndCopy); factor the repeated "GPU dispatch unavailable" error into one GPUNotAvailable(CURRENT_FUNCTION) helper. - Move the static nVar==nEqn / nVar*nVar<=1024 validity checks for the GPU Jacobi/ILU/SpMV paths from every Build/Compute call into Initialize(), where CUDA and the block size are already known and the check only needs to run once. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Single-seed RCM grows from one peripheral, minimum-degree node, so the number of BFS levels tracks the mesh graph diameter. Since the GPU ILU triangular solves are level-scheduled (one kernel launch per level), this produces hundreds of narrow, serialized launches on large meshes. Adds RCM_NUM_SEEDS (default 1, unchanged behavior) to seed the RCM growth from multiple fronts chosen by farthest-point sampling, which bounds the number of levels by the seed set's covering radius instead of the full component diameter while keeping the ordering locally RCM-like around each front. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Picking numSeeds seeds by restarting a full multi-source BFS for each one costs O(numSeeds * (V+E)) and dominates SetRCM_Ordering for large numSeeds. Maintaining the nearest-seed distance incrementally instead - relaxing only the points a new seed brings strictly closer - reuses prior work across rounds and keeps the total cost close to a single BFS. Measured on oneram6 (38k points): 121ms -> 11ms for 128 seeds. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Prints, once per rank-reduced worst case, the number of colors used to schedule the factorization and the number of levels used to schedule the triangular solves, plus their average group size. Narrow levels are the direct symptom of a mesh needing more RCM_NUM_SEEDS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Initialize() runs once per multigrid level, so the report was printed once per level; a function-local static now gates it to a single print per run. Also trims the message to the two numbers that matter. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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 Checklist
pre-commit run --allto format old commits.