Skip to content

Commit 9584ac8

Browse files
authored
Deprecate old mpiexec method (#874)
Keep only the method which returns the path to the `mpiexec` executable, which is the one JLLs prefer nowadays, too.
1 parent 0d57c63 commit 9584ac8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ for (example_title, example_md) in EXAMPLES
3939
println(mdfile, "```")
4040
println(mdfile, "> mpiexecjl -n 4 julia $example_jl")
4141
cd(@__DIR__) do
42-
write(mdfile, mpiexec(cmd -> read(`$cmd -n 4 $(Base.julia_cmd()) --project $example_jl`)))
42+
write(mdfile, read(`$(mpiexec()) -n 4 $(Base.julia_cmd()) --project $example_jl`))
4343
end
4444
println(mdfile, "```")
4545
end

lib/MPIPreferences/src/system.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module System
88
const preloads_env_switch = @load_preference("preloads_env_switch")
99
const mpiexec_path = @load_preference("mpiexec")
1010
mpiexec(;adjust_PATH=true, adjust_LIBPATH=true) = `$mpiexec_path`
11-
mpiexec(f;adjust_PATH=true, adjust_LIBPATH=true) = f(`$mpiexec_path`)
11+
# The following method may be removed in future releases.
12+
Base.@deprecate mpiexec(f;adjust_PATH=true, adjust_LIBPATH=true) f(mpiexec())
1213

1314
libmpi_handle = C_NULL
1415
function __init__()

src/environment.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
2-
mpiexec(fn)
2+
mpiexec()
33
4-
A wrapper function for the MPI launcher executable. Calls `fn(cmd)`, where `cmd` is a `Cmd` object of the MPI launcher.
4+
A wrapper function for the MPI launcher executable. Returns a `Cmd` object pointing to the MPI launcher.
55
66
# Usage
77
88
```jldoctest
9-
julia> mpiexec(cmd -> run(`\$cmd -n 3 echo hello world`));
9+
julia> run(`\$(mpiexec()) -n 3 echo hello world`);
1010
hello world
1111
hello world
1212
hello world

0 commit comments

Comments
 (0)