Replace built-in linear system solver with LAPACK #410
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.
Update linear system solvers with lapack libraries for improved efficiency.
Description
ED2 used to have a fairly robust linear system solver, however, it used Gaussian elimination for every case, which is not efficient. This pull requests replaces the built-in solver with the Linear Algebra Package (LAPACK) subroutines. LAPACK is a well-known and widely available library, so this change should have minimal impact on the ability to build ED2 in most local and high-performance computing systems.
This change will require new variables
LAPACK_INCS
andLAPACK_LIBS
to be set in include.mk.[machine] files. If Lapack is installed in regular paths (e.g.,/usr/local
), the only addition needed is the list of libraries:Otherwise, the full path may be needed. For example, in MacOS systems using HomeBrew:
I added templates in all tracked include.mk, but they may need to be adjusted.
Collaborators
@femeunier and @rgknox suggested this a while back. @robkooper because I may need to coordinate these edits to keep Docker functional.
Motivation and Context
This change removes the need for computational burdensome matrix inversion algorithms for simpler matrices, and allows leveraging efficient and well tested libraries for solving linear systems in ED2. This is called rather frequently (radiation time step), so using lapack should reduce the runtime.
Types of changes
Checklist:
I will update the documentation if this pull request is merged.
Testing :