-
Notifications
You must be signed in to change notification settings - Fork 115
Replace built-in linear system solver with LAPACK #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…This should increase the computational efficiency and allow ED2 to leverage future developments from lapack.
|
@femeunier would you mind revising this one too as you had originally talked about using lapack (a while ago...)? |
mdietze
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda nuts that most of the changes were to all the various versions of include.mk. Feels like we could probably clear our a lot of those, have institutions keep local versions, and only retain a small number of canonical versions?
| # If you don't have it, leave USENC=0 and type a dummy | ||
| # folder for NC_LIBS (e.g. -L/dev/null or leave it blank) | ||
| USENC=0 | ||
| NC_LIBS=-L/dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why adding LAPACK involve the removal of hdf5 and netcdf info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just some general clean up. I deleted these because ED2 doesn't need NetCDF libraries, this is either legacy from borrowing the include.mk files from BRAMS, or some short-lived attempt to use NetCDF with ED2 a very long time ago. Same thing for HDF, note that the deleted one is for HDF4, not HDF5.
Yes for the clearing out, I think we could delete those specific to cluster, and keep generic examples for different compilers (and maybe OS if they are any different from the compiler ones). |
… configure ifort to load the Maths Kernel when running Intel. I also updated all mk files to do the same. Most include.mk files will be removed in an upcoming pull request.
…rent version of the intel compilers.
|
I tested both with GNU and intel compilers, and the code seems to be running fine. With intel compilers, instead of explicitly installing lapack libraries, it is possible (and actually recommended) to use the Math Kernel Library, through compiler option -qmkl. For reference, the test with Intel was carried out at cannon (Harvard's HPC) used the Intel 25.2.1 version, and a locally installed hdf5 library. The configuration is available at include.mk.cannon. The GNU compilers were tested as part of the continuous integration tests. |
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_INCSandLAPACK_LIBSto 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 :