-
Notifications
You must be signed in to change notification settings - Fork 732
Add MPI platform tag and have LAMMPS use it #4540
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5032ba8
Add MPI platform tag
vchuravy 0f6be79
Make LAMMPS use the MPI platform tag
vchuravy 52eb8d4
fixup! Add MPI platform tag
vchuravy 39595cf
fixup! Add MPI platform tag
vchuravy ca353e0
fixup! Make LAMMPS use the MPI platform tag
vchuravy 741ffa2
Update platforms/mpi.jl
vchuravy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| module MPI | ||
|
|
||
| const tag_name = "mpi" | ||
|
|
||
| const augment = raw""" | ||
| # Can't use Preferences since we might be running this very early with a non-existing Manifest | ||
| MPIPreferences_UUID = Base.UUID("3da0fdf6-3ccc-4f1b-acd9-58baa6c99267") | ||
| const preferences = Base.get_preferences(MPIPreferences_UUID) | ||
|
|
||
| # Keep logic in sync with MPIPreferences.jl | ||
| const binary = get(preferences, "binary", Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll") | ||
|
|
||
| const abi = if binary == "system" | ||
| get(preferences, "abi") | ||
| elseif binary == "MicrosoftMPI_jll" | ||
| "MicrosoftMPI" | ||
| elseif binary == "MPICH_jll" | ||
| "MPICH" | ||
| elseif binary == "OpenMPI_jll" | ||
| "OpenMPI" | ||
| elseif binary == "MPItrampoline_jll" | ||
| "MPIwrapper" | ||
| else | ||
| error("Unknown binary: $binary") | ||
| end | ||
|
|
||
| function augment_mpi!(platform) | ||
| if !haskey(platform, "mpi") | ||
| platform["mpi"] = abi | ||
| end | ||
| return platform | ||
| end | ||
| """ | ||
|
|
||
| using BinaryBuilder, Pkg | ||
| using Base.BinaryPlatforms | ||
|
|
||
| mpi_abis = ( | ||
| ("MPICH", PackageSpec(name="MPICH_jll"), "", !Sys.iswindows) , | ||
| ("OpenMPI", PackageSpec(name="OpenMPI_jll"), "", !Sys.iswindows), | ||
| ("MicrosoftMPI", PackageSpec(name="MicrosoftMPI_jll"), "", Sys.iswindows), | ||
| ("MPIwrapper", PackageSpec(name="MPItrampoline_jll"), "3", !Sys.iswindows) | ||
| ) | ||
|
|
||
| function augment_platforms(platforms) | ||
| all_platforms = AbstractPlatform[] | ||
| dependencies = [] | ||
| for (abi, pkg, compat, f) in mpi_abis | ||
| pkg_platforms = deepcopy(filter(f, platforms)) | ||
| foreach(pkg_platforms) do p | ||
| p[tag_name] = abi | ||
| end | ||
| append!(all_platforms, pkg_platforms) | ||
| push!(dependencies, Dependency(pkg; compat, platforms=pkg_platforms)) | ||
| end | ||
| return all_platforms, dependencies | ||
| end | ||
|
|
||
| end | ||
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.
Uh oh!
There was an error while loading. Please reload this page.