Skip to content

Commit

Permalink
[MPIPreferences] Explicitly list valid options in error thrown by `us…
Browse files Browse the repository at this point in the history
…e_jll_binary` (#705)
  • Loading branch information
giordano authored Jan 13, 2023
1 parent 06b16fc commit 4f97571
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/MPIPreferences/src/MPIPreferences.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ The `export_prefs` option determines whether the preferences being set should be
stored within `LocalPreferences.toml` or `Project.toml`.
"""
function use_jll_binary(binary = Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll"; export_prefs=false, force=true)
binary in ["MicrosoftMPI_jll", "MPICH_jll", "OpenMPI_jll", "MPItrampoline_jll"] ||
error("Unknown jll: $binary")
known_binaries = ("MicrosoftMPI_jll", "MPICH_jll", "OpenMPI_jll", "MPItrampoline_jll")
binary in known_binaries ||
error("""
Unknown jll: $binary.
Accepted options are:
$(join(known_binaries, ", "))""")
set_preferences!(MPIPreferences,
"_format" => "1.0",
"binary" => binary,
Expand Down

0 comments on commit 4f97571

Please sign in to comment.