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