Repository navigation
perf(ims): shorten the dependency chain in the ILU0 backward solve - #3160
Open
jdhughes-dev wants to merge 5 commits into
Open
jdhughes-dev wants to merge 5 commits into
jdhughes-dev wants to merge 5 commits into
Conversation
Contributor
Author
Reviewer Summary
|
jdhughes-dev
force-pushed
the
ilu0-solve
branch
from
November 16, 2026 09:14
64d4351 to
4700845
Compare
jdhughes-dev
marked this pull request as ready for review
November 16, 2026 09:17
4 tasks done
lusol, which applies the ILUT and MILUT preconditioners, accumulated each row of the forward and backward solves in x(i). Because x(i) can alias x(jlu(k)), the compiler stored and reloaded x(i) for every term. Each row is now summed in a local variable and stored once. The order of operations is unchanged, so results are bit-identical, and the routine can still be called in place. Adds unit tests that lusol solves a tridiagonal system that ILUT and MILUT factor exactly, and that it matches the original algorithm to the bit for an inexact factorization, including in place. Refs MODFLOW-ORG#3145
A bare underscore in PRECONDITIONER_LEVELS stops the LaTeX release notes build.
The ILU0 and MILU0 backward solve subtracted the term from the row solved just before first and divided by the diagonal last, so each row waited on the previous row before it could start. The upper factor is now scaled by the inverse of the diagonal after the factorization, and the backward solve subtracts the nearest column last, which makes the linear solve about 14 percent faster per inner iteration with COMPLEXITY SIMPLE and MODERATE. Results change at the level of roundoff. Add unit tests that apply an exact and an inexact factorization. Exclude mf2005/testevt, which is singular once its EVT cells fall below the extinction depth, allow the ternary track in prt_newton_disv1 the few-event difference already allowed on Windows with ifort, and update the prtdry_stay snapshot, in which two rounded event times change by 0.01. Closes MODFLOW-ORG#3145
Starting at the top of the convertible cell, with no specific storage, gave the first Newton matrix no storage term, so it was singular and the solution depended on the bad pivot replacement and roundoff. The ILU0 backward solve change made it fail to converge. Start 0.01 below the top so that specific yield storage is active from the first iteration; the automatic flow reduction checks are unchanged.
With a relaxation factor of 1.0, the MILU0 factorization flipped the sign of the pivots of dry cells about 300 times, so the solution depended on the replaced pivots and roundoff, and the ILU0 backward solve change overflowed in BiCGSTAB on Linux. ILU0 replaces no pivots, takes fewer outer iterations, and gives the same outflow (4.8598) with and without that change, within the test tolerance of the 4.8595 answer.
jdhughes-dev
force-pushed
the
ilu0-solve
branch
from
November 16, 2026 14:26
90ccdf7 to
51f5155
Compare
wpbonelli
pushed a commit
that referenced
this pull request
Nov 16, 2026
The comparison helpers get_dvclose and get_rclose read only IMS files ending in .ims, so a model whose IMS file ends in .ims6 kept the default head and budget tolerances instead of five times its OUTER_DVCLOSE and INNER_RCLOSE. Of the external test models, only test028_sfr_rewet is affected: its head tolerance becomes 0.005 for an OUTER_DVCLOSE of 0.001. That model failed the head comparison in #3160 by 0.00127 m on Linux and Windows, within its solver closure, because its rewetting is sensitive to roundoff.
This branch has not been deployed
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.
The ILU0 and MILU0 backward solve in
ims_base_ilu0asubtracted the term from the row solved just before first and divided by the diagonal last, so each row waited on the previous row before it could start. The upper factor is now scaled by the inverse of the diagonal inims_base_pcilu0, and the backward solve subtracts the nearest column last, which makes the linear solve 10 to 14 percent faster per inner iteration with COMPLEXITY SIMPLE and MODERATE. Results change at the level of roundoff.Builds on #3146, whose commits are included until it merges.
Checklist of items for pull request
ruffon new and modified python scripts in .doc, autotests, doc, distribution, pymake, and utils subdirectories.fprettifyFor additional information see instructions for contributing and instructions for developing.