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