Select precision#157
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds CMake-level “precision selection” so ScaLAPACK (and its BLACS/PBLAS/tools/tests) can be built for only selected precisions (single/double/complex/complex16) to reduce build time and binary size.
Changes:
- Introduces top-level CMake options (
BUILD_SINGLE,BUILD_DOUBLE,BUILD_COMPLEX,BUILD_COMPLEX16) and uses them throughout the build to conditionally include sources. - Updates multiple component CMakeLists (TOOLS, SRC, PBLAS, REDIST, traditional tests) to only build targets for enabled precisions.
- Extends CI with a “select-precision” job intended to exercise different precision combinations.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
CMakeLists.txt |
Adds precision selection options; switches to add_compile_definitions. |
TOOLS/LAPACK/CMakeLists.txt |
Builds LAPACK helper/matgen sources conditionally by precision. |
TOOLS/CMakeLists.txt |
Builds TOOLS Fortran/C sources conditionally by precision. |
SRC/CMakeLists.txt |
Splits common vs per-precision sources (and C helpers) for conditional builds. |
PBLAS/CMakeLists.txt |
Uses if(SCALAPACK_BUILD_TESTS) style and keeps test subdirs gated. |
PBLAS/SRC/CMakeLists.txt |
Builds PBLAS sources conditionally by precision. |
PBLAS/SRC/PBBLAS/CMakeLists.txt |
Builds PBblas aux sources conditionally by precision. |
PBLAS/SRC/PTZBLAS/CMakeLists.txt |
Builds PTZBLAS sources conditionally; includes mixed-precision helpers. |
PBLAS/SRC/PTOOLS/CMakeLists.txt |
Builds PTOOLS C sources conditionally by precision. |
PBLAS/TESTING/CMakeLists.txt |
Only builds/ctests PBLAS tests for enabled precisions. |
PBLAS/TIMING/CMakeLists.txt |
Only builds/ctests PBLAS timing targets for enabled precisions. |
BLACS/CMakeLists.txt |
Uses if(SCALAPACK_BUILD_TESTS) style and keeps test subdirs gated. |
BLACS/SRC/CMakeLists.txt |
Attempts to conditionally build BLACS comm/internal sources by precision. |
BLACS/TESTING/CMakeLists.txt |
Skips BLACS testing unless all precisions are enabled. |
REDIST/CMakeLists.txt |
Uses if(SCALAPACK_BUILD_TESTS) style and gates testing subdir. |
REDIST/SRC/CMakeLists.txt |
Builds REDIST sources conditionally by precision. |
REDIST/TESTING/CMakeLists.txt |
Builds REDIST test executables conditionally by precision. |
TESTING/traditional/LIN/CMakeLists.txt |
Builds traditional LIN test executables conditionally by precision. |
TESTING/traditional/EIG/CMakeLists.txt |
Builds traditional EIG test executables conditionally by precision. |
.github/workflows/cmake.yml |
Adds a CI matrix job intended to test different precision selections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a0d89f5 to
beac67b
Compare
beac67b to
60639e7
Compare
langou
approved these changes
Mar 26, 2026
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.
Others picked off good pieces from #77 now merged into Scalapack.
The final and critical piece is in this PR - the ability to select any combination of precisions to save build time and binary size.
This idea is based off of https://github.com/scivision/scalapack, which has been used for several years across HPC and all types of computing platforms.
The variable names are the same as in LAPACK.