Skip to content

Commit 4f97571

Browse files
authored
[MPIPreferences] Explicitly list valid options in error thrown by use_jll_binary (#705)
1 parent 06b16fc commit 4f97571

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/MPIPreferences/src/MPIPreferences.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ The `export_prefs` option determines whether the preferences being set should be
7070
stored within `LocalPreferences.toml` or `Project.toml`.
7171
"""
7272
function use_jll_binary(binary = Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll"; export_prefs=false, force=true)
73-
binary in ["MicrosoftMPI_jll", "MPICH_jll", "OpenMPI_jll", "MPItrampoline_jll"] ||
74-
error("Unknown jll: $binary")
73+
known_binaries = ("MicrosoftMPI_jll", "MPICH_jll", "OpenMPI_jll", "MPItrampoline_jll")
74+
binary in known_binaries ||
75+
error("""
76+
Unknown jll: $binary.
77+
Accepted options are:
78+
$(join(known_binaries, ", "))""")
7579
set_preferences!(MPIPreferences,
7680
"_format" => "1.0",
7781
"binary" => binary,

0 commit comments

Comments
 (0)