@@ -36,24 +36,38 @@ istest(f) = endswith(f, ".jl") && startswith(f, "test_")
36
36
testfiles = sort (filter (istest, readdir (testdir)))
37
37
38
38
@testset " $f " for f in testfiles
39
- mpiexec () do cmd
39
+ mpiexec () do mpirun
40
+ cmd = ` $mpirun -n $nprocs $(Base. julia_cmd ()) $(joinpath (testdir, f)) `
40
41
if f == " test_spawn.jl"
41
- run (` $cmd -n 1 $(Base. julia_cmd ()) $(joinpath (testdir, f)) ` )
42
+ # Some command as the others, but always use a single process
43
+ _cmd = deepcopy (cmd)
44
+ _cmd. exec[findfirst (== (" $nprocs " ), _cmd. exec)] = " 1"
45
+ run (_cmd)
42
46
elseif f == " test_threads.jl"
43
47
withenv (" JULIA_NUM_THREADS" => " 4" ) do
44
- run (` $ cmd -n $nprocs $(Base . julia_cmd ()) $( joinpath (testdir, f)) ` )
48
+ run (cmd)
45
49
end
46
50
elseif f == " test_error.jl"
47
- r = run (ignorestatus (` $ cmd -n $nprocs $(Base . julia_cmd ()) $( joinpath (testdir, f)) ` ))
51
+ r = run (ignorestatus (cmd))
48
52
@test ! success (r)
53
+ elseif f == " test_errorhandler.jl" && MPI. identify_implementation ()[1 ] == MPI. UnknownMPI
54
+ try
55
+ run (cmd)
56
+ catch e
57
+ @error """
58
+ $(f) tests failed. This may due to the fact this implementation of MPI doesn't support custom error handlers.
59
+ See the full error message for more details. Some messages may have been written above.
60
+ """ exception= (e, catch_backtrace ())
61
+ @test_broken false
62
+ end
49
63
else
50
64
# MPI_Reduce with MPICH 3.4.2 on macOS when root != 0 and
51
65
# when recvbuf == C_NULL segfaults
52
66
# <https://github.com/pmodels/mpich/issues/5700>
53
67
if get (ENV , " JULIA_MPI_TEST_DISABLE_REDUCE_ON_APPLE" , " " ) != " " && Sys. isapple () && f == " test_reduce.jl"
54
68
return
55
69
end
56
- run (` $ cmd -n $nprocs $(Base . julia_cmd ()) $( joinpath (testdir, f)) ` )
70
+ run (cmd)
57
71
end
58
72
@test true
59
73
end
0 commit comments