Repository navigation
Reuse sorted row traversal in native CSR ILU factorization - #405
Merged
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.
Native CSR ILU factorization currently restarts a source-row lookup for every target column. At the two partial-row update sites, merge the sorted target columns with the source row using one advancing position. Skip absent source entries with
continueand stop once the source row is exhausted. The production-source diff is +25/-2 lines.Preserve the first duplicate and the arithmetic order for present entries. Missing entries contribute nothing and leave their targets untouched. This deliberately avoids the previous
multiplier * zerocalculation: for an infinite/NaN multiplier or signed-zero target, skipping a structural zero can differ from an explicit IEEE zero multiplication. General CSR indexing and generic-matrix behavior remain unchanged. This is independent of the secondary-variable scheduling PR and changes no ILU scaling, partitioning, or worker policy.Validation
Performance and standard-library comparison
Three rotated rounds under Julia 1.13.2 on a Ryzen 7950X, using Float64 evolved reservoir matrices from the first 20% of the original schedules; each sample is the median of seven numeric factorizations:
Skipping missing entries and stopping at the source-row end reduces numeric factorization time by 7.6% / 10.8% versus the previous cursor, and 21.9% / 22.8% versus the original scan. These are component results, not new whole-simulation speedups.
The earlier standard-library comparison below used the previous cursor with explicit zero multiplication:
searchsortedfirst, mssearchsortedfirst, msThis earlier cursor version reduced numeric factorization time by roughly 14-15%. The best standard-library form was still 9.1% / 5.4% slower than the three-line cursor scan. A separate global row-view binary-search experiment also regressed reservoir factorization, despite helping synthetic long star rows, so general CSR lookup is left alone.
Earlier matched serial full-run pairs measured about 1.33% lower Norne / 0.89% lower Olympus simulation times with the previous zero-multiplying cursor. The clearer skip/break version has new component measurements only; those older whole-run percentages do not measure this revision.
The numerical validation and measurements start from
3b90948f. A test-include placement adjustment keeps this branch mergeable with current maindc6e630cwithout incorporating unrelated solver or worker changes.