|
1 | 1 | using Pkg |
2 | 2 | pkg"precompile" |
3 | 3 |
|
4 | | -using MPIClusterManagers: mpiexec |
5 | | -using Test |
| 4 | +using Test, MPI |
6 | 5 |
|
7 | | -# Code coverage command line options; must correspond to src/julia.h |
8 | | -# and src/ui/repl.c |
9 | | -const JL_LOG_NONE = 0 |
10 | | -const JL_LOG_USER = 1 |
11 | | -const JL_LOG_ALL = 2 |
12 | | -const coverage_opts = |
13 | | - Dict{Int, String}(JL_LOG_NONE => "none", |
14 | | - JL_LOG_USER => "user", |
15 | | - JL_LOG_ALL => "all") |
| 6 | +nprocs = clamp(Sys.CPU_THREADS, 2, 4) |
16 | 7 |
|
17 | | -function runtests() |
18 | | - nprocs = clamp(Sys.CPU_THREADS, 2, 4) |
19 | | - exename = joinpath(Sys.BINDIR, Base.julia_exename()) |
20 | | - extra_args = [] |
21 | | - @static if !Sys.iswindows() |
22 | | - if occursin( "OpenRTE", read(`$mpiexec --version`, String)) |
23 | | - push!(extra_args,"--oversubscribe") |
24 | | - end |
25 | | - end |
26 | | - |
27 | | - coverage_opt = coverage_opts[Base.JLOptions().code_coverage] |
28 | | - |
29 | | - jlexec = `$exename --code-coverage=$coverage_opt` |
30 | | - mpijlexec = `$mpiexec $extra_args -n $nprocs $jlexec` |
31 | | - |
32 | | - @info "Testing: test_cman_julia.jl" |
33 | | - run(`$jlexec $(joinpath(@__DIR__, "test_cman_julia.jl"))`) |
| 8 | +@info "Testing: test_cman_julia.jl" |
| 9 | +run(`$(Base.julia_cmd()) $(joinpath(@__DIR__, "test_cman_julia.jl")) $nprocs`) |
34 | 10 |
|
| 11 | +if VERSION >= v"1.5" |
35 | 12 | @info "Testing: test_cman_mpi.jl" |
36 | | - run(`$mpijlexec $(joinpath(@__DIR__, "test_cman_mpi.jl"))`) |
37 | | - |
38 | | - @info "Testing: test_cman_tcp.jl" |
39 | | - run(`$mpijlexec $(joinpath(@__DIR__, "test_cman_tcp.jl"))`) |
| 13 | + mpiexec() do cmd |
| 14 | + run(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(@__DIR__, "test_cman_mpi.jl"))`) |
| 15 | + end |
| 16 | +else |
| 17 | + @warn "MPI_TRANSPORT_ALL broken on Julia versions < 1.5\nSee https://github.com/JuliaParallel/MPIClusterManagers.jl/issues/9" |
40 | 18 | end |
41 | 19 |
|
42 | | -runtests() |
| 20 | +@info "Testing: test_cman_tcp.jl" |
| 21 | +mpiexec() do cmd |
| 22 | + run(`$cmd -n $nprocs $(Base.julia_cmd()) $(joinpath(@__DIR__, "test_cman_tcp.jl"))`) |
| 23 | +end |
0 commit comments