Online distributed graph partitioning using PT-Scotch #1348
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.
This PR enables the use of MPAS atmosphere core without requiring any graph decomposition files specified as input, if the atmosphere core has been built with the Scotch graph partitioning library (built separately).
Building MPAS with Scotch
Instructions to build Scotch are provided later in the description. Once Scotch has been installed, the MPAS atmosphere core can be leveraged to use online graph partitioning by setting the path to Scotch prior to building MPAS.
If MPAS is built/linked with Scotch successfully, you should see a message stating that at the end of the build output.
Usage and run-time behavior
After building MPAS with Scotch, you can still choose whether or not to use online graph partitioning by setting appropriate values for the
config_block_decomp_file_prefix
namelist option.If
config_block_decomp_file_prefix
+mpi_tasks
points to a valid graph decomp file that already exists in the run directory, then it is used to proceed with the model run without invoking Scotch.If
config_block_decomp_file_prefix==''
orconfig_block_decomp_file_prefix
+mpi_tasks
does not match any valid graph decomp file in the run directory, then Scotch graph partitioning is invoked. During this process, the generated partition is saved as a graph decomp file to the run directory so that it may be reused in the following runs without needing to invoke Scotch again.If MPAS has not been built with scotch, any code paths relating to Scotch will not be taken. And an incorrect specification of
config_block_decomp_file_prefix
+mpi_tasks
should lead to the model halting.Downloading and building Scotch
Scotch may be obtained from its gitlab repository or as tarballs from this link
Build instructions are on this page
It can be as simple as
To be able to use the distributed graph partitioning provided by PT-Scotch, you will need to pass an appropriate MPI installation path during the Scotch build.
Other system pre-requisites are Bison and Flex. I have observed that an older Flex version (v2.6.1) on Eris caused the Scotch build to fail. After pulling in a more recent version of Flex v2.6.4 it seemed to build fine. Scotch documentation also references the requirement for a Bison version > 3.4.