Conversation
Collaborator
Author
|
Tested cases 1, 2, 3, 4 with |
abishekg7
marked this pull request as ready for review
September 16, 2026 14:21
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.
Previously, using PT-SCOTCH for online graph partitioning with MPAS required the user to build and install it themselves and set SCOTCH= environment variable before building MPAS. While this is a completely functional option, many users may prefer the convenience of an automatic fetch and build process.
This PR adds an option to automatically fetch and build PT-SCOTCH under
src/externalduring the MPAS build. The previously activeSCOTCHvariable is repurposed as atrue or falsebuild option to toggle linking PT-SCOTCH library with the MPAS build. Previously,SCOTCHpointed to the PT-SCOTCH installation path. This is now available through theSCOTCH_ROOTvariable. This allows the user to still link MPAS with custom PT-SCOTCH installations.There are a few different build + link scenarios with these two variables
SCOTCH=falseor unspecified, the regular MPAS build process continues without attempting to build or link against PT-SCOTCH.SCOTCH=trueandSCOTCH_ROOTis not set or unset, the build process automatically fetches and builds the PT-SCOTCH graph-partitioning library, followed by the build of the MPAS model, and then the PT-SCOTCH library is linked as a static library.SCOTCH=trueandSCOTCH_ROOTpoints to the location of an existing PT-SCOTCH installation, the regular MPAS build process completes and then the PT-SCOTCH library is linked as a static library.SCOTCH=trueandSCOTCH_ROOTis set but does not point to the location of an existing PT-SCOTCH installation, the build process exits with an error.Notes:
A new Externals.cfg is added under the src directory so that both the atmosphere and init_atmosphere CORES can use this external
If the automatic PT-SCOTCH fetch and build is successful, it is installed under
src/external/scotch/install. And the libraries under thelibsubdirectory. However, in the case of a user-specified PT-SCOTCH installation, we search both$(SCOTCH_ROOT)/liband$(SCOTCH_ROOT)/lib64subdirectories to find the relevant libraries.SCOTCH=$(SCOTCH)is added to the options tracked byrebuild_check, so switching SCOTCH on/off between builds is detected as an incompatible-option change (triggering the clean/rebuild prompt or AUTOCLEAN).Add a scotch cleanup step (rm -r build install) to the clean target so make clean removes the downloaded/built SCOTCH tree along with the other external libs.
Current limitations
CMake (>= 3.10) is presently required in order to build PT-SCOTCH using the automatic fetch + build method. In addition, all the usual dependencies of PT-SCOTCH need to be present in the environment prior to the build.
We presently support only the linking of static PT-SCOTCH libraries with MPAS. Shared libraries are currently not supported.