Skip to content

Commit ed92070

Browse files
committed
fix tests
1 parent 142af82 commit ed92070

File tree

5 files changed

+18
-42
lines changed

5 files changed

+18
-42
lines changed

.appveyor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ environment:
22
matrix:
33
- julia_version: 1.3
44
- julia_version: 1.4
5-
- julia_version: 1.5
65
- julia_version: nightly
76

87
platform:

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ os:
88
julia:
99
- 1.3
1010
- 1.4
11-
- 1.5
1211
- nightly
1312

1413
branches:

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1010
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
1111

1212
[compat]
13-
julia = "1"
1413
MPI = "0.14"
14+
julia = "1"
1515

1616
[extras]
1717
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

test/runtests.jl

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,23 @@
11
using Pkg
22
pkg"precompile"
33

4-
using MPIClusterManagers: mpiexec
5-
using Test
4+
using Test, MPI
65

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)
167

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`)
3410

11+
if VERSION >= v"1.5"
3512
@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"
4018
end
4119

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

test/test_cman_julia.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ using Test
22
using MPIClusterManagers
33
using Distributed
44

5-
using MPIClusterManagers: mpiexec
65
import MPI
76

87
# Start workers via `mpiexec` that communicate among themselves via MPI;
98
# communicate with the workers via TCP
10-
if !Sys.iswindows() && occursin( "OpenRTE", open(f->read(f, String),`$mpiexec --version`))
11-
mgr = MPIManager(np=4, mpirun_cmd=`$mpiexec --oversubscribe -n 4`)
12-
else
13-
mgr = MPIManager(np=4)
14-
end
9+
nprocs = parse(Int, ARGS[1])
10+
11+
mgr = MPIManager(np=nprocs)
1512
addprocs(mgr)
1613

1714
refs = []

0 commit comments

Comments
 (0)