Skip to content

Commit 2080aed

Browse files
authored
Don't launch arbitrary number of processes (#559)
1 parent 9a1dd86 commit 2080aed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/mpiexecjl.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ using MPI
1010
# Test installation
1111
@test_logs (:info, r"Installing") (:info, r"Done") MPI.install_mpiexecjl(; destdir = dir)
1212
# Test a run of mpiexec
13+
nprocs_str = get(ENV, "JULIA_MPI_TEST_NPROCS", "")
14+
nprocs = nprocs_str == "" ? clamp(Sys.CPU_THREADS, 2, 4) : parse(Int, nprocs_str)
1315
mpiexecjl = joinpath(dir, "mpiexecjl")
1416
julia = joinpath(Sys.BINDIR, Base.julia_exename())
1517
example = joinpath(@__DIR__, "..", "docs", "examples", "01-hello.jl")
1618
env = ["JULIA_BINDIR" => Sys.BINDIR]
1719
p = withenv(env...) do
18-
run(`$(mpiexecjl) --project=$(dir) $(julia) --startup-file=no -q $(example)`)
20+
run(`$(mpiexecjl) -n $(nprocs) --project=$(dir) $(julia) --startup-file=no -q $(example)`)
1921
end
2022
@test success(p)
2123
# Test help messages

0 commit comments

Comments
 (0)